[R] All possible subsets model selection using AICc

Thomas Lumley tlumley at u.washington.edu
Wed Jan 4 00:12:17 CET 2006

On Tue, 3 Jan 2006, Matt Williamson wrote:

> Hello List,
> I was wondering if a package or piece of code exists that will allow all
> possible subsets regression model selection within program R.  I have
> already looked at step(AIC) which does not test differing combinations
> of variables within a model as far as I can tell.  In addition I tried
> to use the leaps command, but that does not use the criterion I am
> looking for.

leaps() or regsubsets() in the leaps package almost certainly do use the 
criterion you are looking for (even though you don't tell us what that 
criterion is).

These functions produce one or more best models of each size, and for 
models of the same size all the commonly-used criteria reduce to ranking 
by residual sum of squares, which is what leaps() and regsubsets() do.


Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

More information about the R-help mailing list