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))
p <- c(20,80)
pf.list <- list(c(0.5, 1), c(2, 0.9))
# stratum membership
stratum <- sort(rep(1:100, 2))
# the response
Y <- rep(c(1, 0), 100)
# obtain a list with vectors of penalty factors
# \donttest{
lambda.list <- find.default.lambda(response = Y,
penalized = X, stratum = stratum, p = p, pf.list = pf.list)# }
# when `p` and `pf.list` are not provided all covariates are treated as a single block
# \donttest{
lambda <- find.default.lambda(response = Y,
penalized = X, stratum = stratum)# }
Run the code above in your browser using DataLab