[R] All possible subset selection?
anoy69 at yahoo.com
Thu May 8 16:50:39 CEST 2003
Thanks to Prof Brian Ripley for the valuable
Zheng Huang & Zhu Wang
--- Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote:
> On Wed, 7 May 2003, zhu wang wrote:
> > I am wondering if there is a function in R to do
> > possible subset selection, e.g. using AIC/BIC. It
> > seems to me the function step can not do all
> > selection.
> That's right, and I know of no function.
> Potentially the computational
> burden is horrendous, even of sorting out which are
> valid subset models.
> For continuous (rather than categorical) variables,
> look at package leaps.
> > I am also want to know why the following functions
> > give me different results. It seems I missed some
> > points here.
> > lm <- lm(y ~., data=somedata)
> > AIC(lm)
> > extractAIC(lm)
> Please don't call the result by the name of a
> extractAIC (as its help says) is a helper function
> for step/add1/drop1,
> and it is designed to report Cp in some lm cases
> when AIC is Cp plus a
> constant. It predates AIC by several years.
> Remember that AIC is only defined up to an additive
> constant, because a
> log-likelihood is (it depends on the dominating
> measure used).
> extractAIC.lm and AIC.lm use different ones, and in
> the case that the
> scale is known, they use different maximizations
> too. (AIC.lm is only
> appropriate if the scale (error variance) is
> Brian D. Ripley,
> ripley at stats.ox.ac.uk
> Professor of Applied Statistics,
> University of Oxford, Tel: +44 1865
> 272861 (self)
> 1 South Parks Road, +44 1865
> 272866 (PA)
> Oxford OX1 3TG, UK Fax: +44 1865
More information about the R-help