Learn R Programming

qtlmt (version 0.1-1)

varStep: Variable selection

Description

Add a variable, drop a variable, or select a subset of variables via variable selection that are optimal for multivariate analysis.

Usage

varAdd1(x, grp, vin=NULL, scope=1:ncol(x), k=0)

varDrop1(x, grp, vin=1:ncol(x), k=0)

varStep(x, grp, scope, k, kf=k/2, direction=c("both",
   "forward","backward"))

Arguments

x
data matrix/frame. Columns are variables to select from.
grp
grouping indicator of observations.
vin
which variables (i.e., columns of x) already in model. It defines the initial model.
scope
which variables (i.e., columns of x) to select from.
k
entry/stay value in backward stepwise.
kf
entry/stay value in forward stepwise.
direction
forward selection, backward elimination or both stepwise.

Value

  • which variable to add (add1), which variable to drop (drop1), or a subset of variables in the final model (step).

See Also

varGroup and varSelect

Examples

Run this code
data(etrait)
varAdd1(traits, grp=mdat[,42], vin=10, scope=1:ncol(traits))
varStep(traits, grp=mdat[,42], k=12, scope=1:ncol(traits),
   direction="back")

Run the code above in your browser using DataLab