lasso_perm {adapt4pv}  R Documentation 
Performed K lasso logistic regression with K different permuted version of the outcome.
For earch of the lasso regression, the λ_max(i.e. the smaller
λ such as all penalized regression coefficients are shrunk to zero)
is obtained.
The median value of these K λ_max is used to for variable selection
in the lasso regression with the nonpermuted outcome.
Depends on the glmnet
function from the package glmnet
.
lasso_perm(x, y, K = 20, keep = NULL, betaPos = TRUE, ncore = 1, ...)
x 
Input matrix, of dimension nobs x nvars. Each row is an observation
vector. Can be in sparse matrix format (inherit from class

y 
Binary response variable, numeric. 
K 
Number of permutations of 
keep 
Do some variables of 
betaPos 
Should the covariates selected by the procedure be positively
associated with the outcome ? Default is 
ncore 
The number of calcul units used for parallel computing. Default is 1, no parallelization is implemented. 
... 
Other arguments that can be passed to 
The selected λ with this approach is defined as the closest λ from the median value of the K λ_max obtained with permutation of the outcome.
An object with S3 class "log.lasso"
.
beta 
Numeric vector of regression coefficients in the lasso
In 
selected_variables 
Character vector, names of variable(s) selected with the
lassoperm approach.
If 
Emeline Courtois
Maintainer: Emeline Courtois
emeline.courtois@inserm.fr
Sabourin, J. A., Valdar, W., & Nobel, A. B. (2015). "A permutation approach for selecting the penalty parameter in penalized model selection". Biometrics. 71(4), 1185–1194, doi: 10.1111/biom.12359
set.seed(15) drugs < matrix(rbinom(100*20, 1, 0.2), nrow = 100, ncol = 20) colnames(drugs) < paste0("drugs",1:ncol(drugs)) ae < rbinom(100, 1, 0.3) lp < lasso_perm(x = drugs, y = ae, K = 10)