Learn R Programming

qtlmt (version 0.1-3)

varSelect: Variable selection

Description

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

Usage

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

Arguments

x
a data matrix/frame. Columns are variables to select from.
group
a 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,], group=mdat[,55], scope=1:ncol(traits[idx,]),
   nv=length(g55[[1]]))

Run the code above in your browser using DataLab