Learn R Programming

qtlmt (version 0.1-1)

varSelect: Variable selection

Description

Select a specific number of variables via variable selection that are optimal for multivariate analysis.

Usage

varSelect(x, grp, scope, nv, direction=c("backward","forward"))

Arguments

x
data matrix/frame. Columns are variables to select from.
grp
grouping indicator of observations.
scope
which variables (i.e., columns of x) to select from.
nv
how many variables to be selected.
direction
forward selection or backward elimination.

Value

  • variables selected in the model.

See Also

varGroup and varStep

Examples

Run this code
data(etrait)
g55<- varGroup(traits, mdat, zscope=55, method="best")
idx<- sample(1:nrow(traits), replace=FALSE)
varSelect(traits[idx,], grp=mdat[,55], scope=1:ncol(traits[idx,]),
   nv=length(g55[[1]]))

Run the code above in your browser using DataLab