powered by
Add a variable, drop a variable, or select a subset of variables via variable selection that are optimal for multivariate analysis.
varAdd1(x, group, vin=NULL, scope=1:ncol(x), k=0)varDrop1(x, group, vin=1:ncol(x), k=0)varStep(x, group, scope, k, kf=k/2, direction=c("both", "forward","backward"))
varDrop1(x, group, vin=1:ncol(x), k=0)
varStep(x, group, scope, k, kf=k/2, direction=c("both", "forward","backward"))
a data matrix/frame. Columns are variables to select from.
a grouping indicator of observations.
which variables (i.e., columns of x) already in model. It defines the initial model.
x
which variables (i.e., columns of x) to select from.
entry/stay value in backward stepwise.
entry/stay value in forward stepwise.
forward selection, backward elimination or both stepwise.
which variable to add (add1), which variable to drop (drop1), or a subset of variables in the final model (step).
varSelect
# NOT RUN { data(etrait) varAdd1(traits, group=mdat[,42], vin=10, scope=1:ncol(traits)) varStep(traits, group=mdat[,42], k=12, scope=1:ncol(traits), direction="back") # }
Run the code above in your browser using DataLab