Re: [R] Help with Loop Please!

2009-09-13 Thread Henrique Dallazuanna
Try this: apply(subset.models[,-1], 1, function(x)lm(as.formula(paste('y ~', paste(names(freeny[,-1])[x], collapse = "+"), sep = "")), data = freeny)) On Sun, Sep 13, 2009 at 10:57 AM, Axel Urbiz wrote: > Hi, > > I’d like to fit one GLM model for each possible combination of inputs (i.

[R] Help with Loop Please!

2009-09-13 Thread Axel Urbiz
Hi, I’d like to fit one GLM model for each possible combination of inputs (i.e. exhaustive search). The package leaps can help me to generate all possible variable subsets, but I’ll appreciate your guidance as of how to generate one model for each of those possible subsets. I’m new in R! Thanks i