I have not been able to use more than 10 predictors, when using the step function with lmRob. I get an error message that contains “rank(x)”, where x is the number of predictors. I can use more than 10 predictors with the non-robust function,
lm. The lmRobMM function will accept more than 10 predictors, but the lmRobMM.object is not compatible with the step function. The problem seems to be occurring because the version of step that works with lmRob, ignores the “scope” argument. The scope argument
allows you to use more than the default limit of predictors.
So, is there a way to use the step function with lmRob, if there are more than 10 predictors. If not, is there another way to use robust stepwise regression with another function that accepts more than 10 predictors?
I’m using S-PLUS 8.0 Enterprise Developer for Windows.
Here is an excerpt from my S-PLUS code (if the number of predictors exceeds 10 in the formula, I get an error message):
multRegression <- function(lmobj)
{
temp.lm <- step(lmobj)
return(temp.lm)
} # end function
.
.
.
temp.formula <- "ave.spd ~ br1mod + inv.str.C. + inv.depth + X16...1000 + X100...1000 + maxspdT + max.sfc.3k + max.2k.3k + ave.2.3k + X2500.ft"
finalPhrase <- paste("lmRob(", temp.formula, ", ", temp.phrase, ", data = "" sep="")
lm.result <- eval(parse(text=finalPhrase))
temp.lm <- multRegression(lm.result)
Joe Barrett
Scientist
ENSCO, Inc.
Cocoa Beach, FL