Learn R Programming

qtlmt (version 0.1-3)

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, 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"))

Arguments

x
a data matrix/frame. Columns are variables to select from.
group
a 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

varSelect

Examples

Run this code
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