Learn R Programming

elasso (version 1.0)

BRLasso: Bootstrap ranking LASSO method.

Description

This function performs a bootstrap ranking LASSO Logistic regression model for variable selection.

Usage

BRLasso(x, y, B = 5, Boots = 100, kfold = 10)

Arguments

x
the predictor matrix
y
the response variable, a factor object with values of 0 and 1
B
the external loop for intersection operation, with the default value 5
Boots
the internal loop for bootstrap sampling, with the default value 100
kfold
the K-fold cross validation, with the default value 10

Examples

Run this code
library(datasets)
head(iris)
X <- as.matrix(subset(iris,iris$Species!="setosa")[,-5])
Y <- as.factor(ifelse(subset(iris,iris$Species!="setosa")[,5]=='versicolor',0,1))
# Fitting a BRLasso Logistic regression model
BRLasso.fit <- BRLasso(x=X, y=Y, B=2, Boots=10, kfold=10)
# Variables selected
BRLasso.fit$Var_selected
# Coefficients of the selected variables
BRLasso.fit$Asso

Run the code above in your browser using DataLab