[R] Problem with stepAIC, "invalid second argument"
Prof Brian Ripley
ripley at stats.ox.ac.uk
Sun Dec 26 16:56:04 CET 2004
Try ?df to see what you did wrong!
Always use conflicts() before posting to see what you have overridden.
R normally allows you to get away with masking objects, but in this case
it is the R object that is masking yours.
On Sun, 26 Dec 2004, Klaus Thul wrote:
> am I doing something wrong, or is this a bug (R 2.0.1 & 1.9.1,
> linux&windows):
>
> > library(MASS)
> > df <- data.frame(x = rnorm(100), y = rnorm(100), z = rnorm(100))
> > f <- lm(x ~ y + z, data = df)
> > stepAIC(f, scope = list(upper = ~y * z, lower = ~1))
> Start: AIC= -16.56
> x ~ y + z
> Error in eval(expr, envir, enclos) : invalid second argument
--
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