Functions that fit a model until q variables are selected and that returns the indices (and names) of the selected variables.
1 2 3 4 5 6 7  ## package lars:
lars.lasso(x, y, q, ...)
lars.stepwise(x, y, q, ...)
## package glmnet:
glmnet.lasso(x, y, q, ...)
glmnet.lasso_maxCoef(x, y, q, ...)

x 
a matrix containing the predictors or an object of class

y 
a vector or matrix containing the outcome. 
q 
number of (unique) selected variables (or groups of variables depending on the model) that are selected on each subsample. 
... 
additional arguments to the underlying fitting function. 
All fitting functions are named after the package and the type of
model that is fitted: package_name.model
, e.g.,
glmnet.lasso
stands for a lasso model that is fitted using the
package glmnet.
If one wants to use glmnet.lasso_maxCoef
, one must specify the
penalty parameter lambda
(via the ...
argument) or in
stabsel
via args.fitfun(lambda = )
.
A named list with elements
selected 
logical. A vector that indicates which variable was selected. 
path 
logical. A matrix that indicates which variabkle was selected in which step. Each row represents one variable, the columns represent the steps. 
1 2 3 4 5  data("bodyfat", package = "TH.data")
## selected variables
lars.lasso(bodyfat[, 2], bodyfat[,2], q = 3)$selected
lars.stepwise(bodyfat[, 2], bodyfat[,2], q = 3)$selected
glmnet.lasso(bodyfat[, 2], bodyfat[,2], q = 3)$selected

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.