stable.clr {penalizedclr} | R Documentation |
Stability selection based on penalized conditional logistic regression
Description
Performs stability selection for conditional logistic regression models with L1 and L2 penalty.
Usage
stable.clr(
response,
stratum,
penalized,
unpenalized = NULL,
lambda.seq,
alpha = 1,
B = 100,
parallel = TRUE,
standardize = TRUE,
event
)
Arguments
response |
The response variable, either a 0/1 vector or a factor with two levels. |
stratum |
A numeric vector with stratum membership of each observation. |
penalized |
A matrix of penalized covariates. |
unpenalized |
A matrix of additional unpenalized covariates. |
lambda.seq |
a sequence of non-negative value to be used as tuning parameter for L1 |
alpha |
The elastic net mixing parameter, a number between 0 and 1. alpha=0 would give pure ridge; alpha=1 gives lasso. Pure ridge penalty is never obtained in this implementation since alpha must be positive. |
B |
A single positive number for the number of subsamples. |
parallel |
Logical. Should the computation be parallelized? |
standardize |
Should the covariates be standardized, a logical value. |
event |
If response is a factor, the level that should be considered a success in the logistic regression. |
Value
A list with a numeric vector Pistab
giving selection probabilities for each penalized covariate, and
a sequence lambda.seq
used.
See Also
stable.clr.g
for stability selection
in penalized conditional logistic regression with multiple penalties for block structured covariates.
Examples
set.seed(123)
# simulate covariates (pure noise in two blocks of 20 and 80 variables)
X <- cbind(matrix(rnorm(4000, 0, 1), ncol = 20), matrix(rnorm(16000, 2, 0.6), ncol = 80))
# stratum membership
stratum <- sort(rep(1:100, 2))
# the response
Y <- rep(c(1, 0), 100)
# default L1 penalty
lambda <- find.default.lambda(response = Y,
penalized = X,
stratum = stratum)
# perform stability selection
stable1 <- stable.clr(response = Y, penalized = X, stratum = stratum,
lambda.seq = lambda)