Step function
I am having problem using the step function for a linear regression model. I've created an initial model containing only the intercept. Then using the step function, I've selected three variables to be considered for the model.
x0.lm<- lm(MEDV~1, data = x) anova(x0.lm)
Analysis of Variance Table
Response: MEDV
Df Sum Sq Mean Sq F value Pr(>F)
Residuals 505 42716 85
step(x0.lm, ~ CRIM + ZN + RM)
Start: AIC= 2246.51 MEDV ~ 1 Error in eval(expr, envir, enclos) : Object "MEDV" not found
I am not clear as to why the MEDV object ( the variable I am trying to predict) is not found. I receive an identical message using the command > step(x0.lm). I am using R version 1.1.1. I can run all the examples successfully. Also, I realize that there are differences in the algorithms, but I can run the code above on Splus version 5. Thanks Matt Pocernich -------------- next part -------------- An HTML attachment was scrubbed... URL: https://stat.ethz.ch/pipermail/r-help/attachments/20001129/2f219ad5/attachment.html