| To: | <huangp@musc.edu>, <s-news@lists.biostat.wustl.edu> |
|---|---|
| Subject: | Re: loop over a series regression models |
| From: | <Bill.Venables@csiro.au> |
| Date: | Fri, 15 Apr 2005 14:54:10 +1000 |
| Thread-index: | AcVBaxQxFNVcKigJTWW9SKyqsZ1dnQAC5S6A |
| Thread-topic: | [S] loop over a series regression models |
|
Your question "How [do I] write a loop to obtain the output?" implies that you have already decided that you must need a loop. In fact you don't. Here is how I would obtain your output: mydata<- data.frame(x1=1:10, x2=(1:10)^2,
and that's it. Bill V. -----Original Message-----
Dear All, I have a data frame that contains several dependent variables and independent variables. I would like to save the regression coefficients after fitting each dependent variables (with the same independent variables). How to write a loop to do it automatically? For example, I have mydata<- data.frame(x1=1:10, x2=(1:10)^2,
# I want to perform the following
# then save the coefficients:
Question: how to write a loop to obtain the output?
Peng Huang |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | loop over a series regression models, Peng Huang |
|---|---|
| Next by Date: | Question about frailty() in coxph, Hunsicker, Lawrence |
| Previous by Thread: | Calling rpart from a function, Paul Lasky |
| Next by Thread: | Re: loop over a series regression models, Peng Huang |
| Indexes: | [Date] [Thread] [Top] [All Lists] |