Try variations of this:
library(leaps)
b<-regsubsets(Fertility~.,data=swiss)
w <- summary(b)$which
lapply(1:nrow(w), function(i) coef(lm(Fertility ~., swiss[w[i, ]])))
On Fri, Dec 26, 2008 at 1:57 PM, Murtaza Das wrote:
> Thanks for replying Gabor.
>
> I checked the leaps() function and i think
Thanks for replying Gabor.
I checked the leaps() function and i think it is intended to find the
best combination of predictors in the linear model.
Does leaps have a way to combine different factor columns in my data
frame as follows :
I have the regression model fixed. The combination of predic
See the leaps package.
On Fri, Dec 26, 2008 at 12:37 PM, Murtaza Das wrote:
> Hi,
>
> I am trying to find an efficient way of applying a linear regression
> model to different factor combinations in a data frame.
> I want to obtain the output with minimal or no use of loops if
> possible. Please
Hi,
I am trying to find an efficient way of applying a linear regression
model to different factor combinations in a data frame.
I want to obtain the output with minimal or no use of loops if
possible. Please let me know if this query is unclear.
Thanks,
Murtaza
*
4 matches
Mail list logo