[R] model selection using step
jyan at stat.wisc.edu
Fri Feb 25 03:41:42 CET 2000
I am trying to do a model selection using function step. There are 21
independent variables. I first started from a model with all variables,
the step function does not go anywhere, returning the full model to me.
Q1. Does this have to do with missing values?
Q2. I refit the model after removing all rows including missing values,
but the result still does not change. What am I missing here?
body.m <- lm(BI.PPrem ~ ., data=insure[,c(1, 19:39)])
na <- as.numeric(attr(attr(body.m$model, "na.action"), "names"))
body.m <- lm(BI.PPrem ~ ., data=insure[-na,c(1, 19:39)])
body.step <- step(body.m, scope=list(upper = ~., lower= ~1))
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help