[R] stepAIC/lme (1.6.2)

Prof Brian Ripley ripley at stats.ox.ac.uk
Fri May 2 19:16:49 CEST 2003


On Fri, 2 May 2003, Peter B. Mandeville wrote:

> 
> Based on the stepAIC help, I have assumed that it only was for lm, aov, and 
> glm models. 

Even though the help does not mention those classes, and the book actually 
uses stepAIC for coxph?

> I gather from the following correspondence that it also works 
> with lme models.
> 
> Thomas Lumley	07:40 a.m. 28/04/03 -0700	 4	Re: [R] stepAIC/lme problem 
> (1.7.0 only)
> Prof Brian Ripley	04:19 p.m. 28/04/03 +0100	 6	Re: [R] stepAIC/lme problem 
> (1.7.0 only)
> Prof Brian Ripley	06:09 p.m. 29/04/03 +0100	 6	Re: [R] stepAIC/lme problem 
> (1.7.0 only)
> 
> I am using windowsXP and have experimented with the data set HR from the 
> SASmixed library without success with rw1.6.2.
> 
> I would greatly appreciate the correct syntax for version rw1.6.2.

It's as described on the help page, and in Robert Cuffe's example (to 
which those were replies).

data(HR)
fm1HR <- lme(HR ~ Time * Drug + baseHR, data = HR, 
             random = ~ Time | Patient, method = "ML")
stepAIC(fm1HR)

works.  What could be simpler?  (And you can't use method="REML" as this 
is step*AIC*.)

[And that works in 1.7.0 if you update VR.]

-- 
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



More information about the R-help mailing list