Dear R People: Is there an "all possible subsets" function in regression, please? Typically, I use the step function. A student asked me about the all possibles. Thanks in advance! R 1.8.1 Windows Sincerely, Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: hodgess at gator.uhd.edu
Look at package leaps. Note that it applies to columns of the design matrix and not terms, so can be nonsensical with categorical predictors (let alone interactions of such). On Sat, 10 Apr 2004, Erin Hodgess wrote:> Dear R People: > > Is there an "all possible subsets" function in regression, please? > > Typically, I use the step function. A student asked me > about the all possibles. > > Thanks in advance! > > R 1.8.1 Windows-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On Sat, 10 Apr 2004, Prof Brian Ripley wrote:> Look at package leaps. Note that it applies to columns of the > design matrix and not terms, so can be nonsensical with categorical > predictors (let alone interactions of such). >A reasonable compromise is to run regsubsets() (in leaps) returning the best hundred or so models of each size, and then refit each model ensuring that the terms are treated sensibly. I use this sometimes for variable screening. -thomas