I'm trying to run a simple backwards stepwise multiple linear regression in R using the stepAIC function from the MASS package. The model runs fine, but I can't seem to get the results. When I run "step$anova" I get
Error in step$anova : object of type 'closure' is not subsettable
PCBstep<- stepAIC(PCBiomass, direction="backward")
Oops, It should be
PCBstep$anova in the final line. You can not subset
step, because that is an R's built-in function. (You know the
stats::step function, right?) A function is a closure; that is what the error is complaining about.