lasso_perm {adapt4pv} | R Documentation |
fit a lasso regression and use standard permutation of the outcome for variable selection
Description
Performed K lasso logistic regression with K different permuted version of the outcome.
For earch of the lasso regression, the \lambda_max
(i.e. the smaller
\lambda
such as all penalized regression coefficients are shrunk to zero)
is obtained.
The median value of these K \lambda_max
is used to for variable selection
in the lasso regression with the non-permuted outcome.
Depends on the glmnet
function from the package glmnet
.
Usage
lasso_perm(x, y, K = 20, keep = NULL, betaPos = TRUE, ncore = 1, ...)
Arguments
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 |
Details
The selected \lambda
with this approach is defined as the closest
\lambda
from the median value of the K \lambda_max
obtained
with permutation of the outcome.
Value
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
lasso-perm approach.
If |
Author(s)
Emeline Courtois
Maintainer: Emeline Courtois
emeline.courtois@inserm.fr
References
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
Examples
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)