Displaying 1 result from an estimated 1 matches for "chldescr".
2011 May 01
0
Dummy variables using rfe in caret for variable selection
I'm trying to run "rfe" for variable selection in the caret package, and am
getting an error. My data frame includes a dummy variable with 3 levels.
x <- chlDescr
y <- chl
#crate dummy variable
levels(x$State) <- c("AL","GA","FL")
dummy <- model.matrix(~State,x)
z <- cbind(dummy, x)
#remove State category variable
w <- z[,c(-4)]
subsets <- c(2:8)
ctrl<- rfeControl(functions = lmFuncs, method="cv"...