| Title: | Sparse modelling with grouped and correlated features allowing for privileged information |
|---|---|
| Description: | Implements lasso regression (Gaussian, binomial, Poisson, and Cox) for features in heterogeneous groups (e.g., where some groups contain subgroups of correlated features), overlapping groups (i.e., where some features belong to two or more groups), and misspecified groups (i.e., where some group labels are incorrect or missing). Involves an initial ridge regression followed by a final adaptive lasso regression. Exchanges information between features according to their assumed adjacencies or their observed correlations to improve selection and predictive performance. Allows for features that can provide information on other features but must not themselves be selected (i.e., privileged information). |
| Authors: | Armin Rauschenberger [aut, cre] (ORCID: <https://orcid.org/0000-0001-6498-4801>) |
| Maintainer: | Armin Rauschenberger <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-10-11 13:12:09 UTC |
| Source: | https://github.com/rauschenberger/corila |
The R package corila implements
"Sparse modelling with grouped and correlated features
allowing for privileged information" (Rauschenberger, 2026).
This is the first implementation of a novel algorithm,
sharing information based on assumed adjacencies and observed correlations,
and allowing not only for primary but also for auxiliary predictors.
It builds upon adaptive lasso regression with the
glmnet-package.
Use function cv.corila() for model fitting.
Type library(corila) and then ?cv.corila or
help("cv.corila") to open its help file.
See the vignette for further examples.
Type vignette("corila") or browseVignettes("corila")
to open the vignette.
This package also includes the wrapper function multiridge()
for multi-penalty ridge regression with
the multiridge-package.
Armin Rauschenberger (2026). "Sparse modelling with grouped and correlated features allowing for privileged information". In preparation.
First use cv.corila() to fit the model,
and then coef() to extract coefficients
or predict() to make predictions.
?cv.corila ?coef.cv.corila ?predict.cv.corila?cv.corila ?coef.cv.corila ?predict.cv.corila
Extracts coefficients from an object of class "cv.corila".
## S3 method for class 'cv.corila' coef(object, s = "lambda.min", ...)## S3 method for class 'cv.corila' coef(object, s = "lambda.min", ...)
object |
object of class |
s |
character |
... |
(for compatibility with stats::coef) |
This function calls .combine_slopes()
to combine positive and negative coefficients
and .backscale() to bring coefficients back to the original scale.
Returns an -dimensional vector of the estimated coefficients.
The first entry is the estimated intercept,
and the other entries are the estimated slopes.
Armin Rauschenberger (2026). "Sparse modelling with grouped and correlated features allowing for privileged information". In preparation.
Fit models with cv.corila()
and make predictions with predict().
data <- simulate_data() model <- cv.corila(x = data$x_train, y = data$y_train, group = data$group, primary = data$primary) beta_hat <- coef(object = model) y_hat <- predict(object = model, newx = data$x_test) # example for automatic mutation testing (with the R package autotest) data <- simulate_data() model <- cv.corila(x = data$x_train, y = data$y_train, group = as.double(data$group), primary = data$primary, alpha_init = 0.0, foldid = rep(x = seq_len(10L), length.out = nrow(data$x_train)))data <- simulate_data() model <- cv.corila(x = data$x_train, y = data$y_train, group = data$group, primary = data$primary) beta_hat <- coef(object = model) y_hat <- predict(object = model, newx = data$x_test) # example for automatic mutation testing (with the R package autotest) data <- simulate_data() model <- cv.corila(x = data$x_train, y = data$y_train, group = as.double(data$group), primary = data$primary, alpha_init = 0.0, foldid = rep(x = seq_len(10L), length.out = nrow(data$x_train)))
Extracts coefficients from a multi-penalty ridge regression model.
## S3 method for class 'multiridge' coef(object, ...)## S3 method for class 'multiridge' coef(object, ...)
object |
object of type |
... |
(for compatibility with stats::coef) |
Returns an -dimensional vector of estimated coefficients
(estimated intercept and estimated slopes)
if family="gaussian" and family="binomial"
and a -dimensional vector of estimated slopes if family="cox".
Mark A. van de Wiel, Mirrelijn M. van Nee and Armin Rauschenberger (2021). "Fast cross-validation for multi-penalty high-dimensional ridge regression" Journal of Computational and Graphical Statistics 30(4):835-847. doi:10.1080/10618600.2021.1904962.
Fit models with multiridge()
and make predictions with predict().
data <- simulate_data(prob_primary = 1.0) model <- multiridge(x = data$x_train, y = data$y_train, group = data$group) beta_hat <- coef(model) y_hat <- predict(object = model, newx = data$x_test)data <- simulate_data(prob_primary = 1.0) model <- multiridge(x = data$x_train, y = data$y_train, group = data$group) beta_hat <- coef(model) y_hat <- predict(object = model, newx = data$x_test)
Optimises the parameters and the hyperparameters of the sparse group lasso.
cv.corila( x, y, group, primary = NULL, family = "gaussian", alpha_init = 0, cor = "pearson", alpha_final = 1, nfolds = 10L, foldid = NULL, tune = "weight", na_action = "error", silent = FALSE )cv.corila( x, y, group, primary = NULL, family = "gaussian", alpha_init = 0, cor = "pearson", alpha_final = 1, nfolds = 10L, foldid = NULL, tune = "weight", na_action = "error", silent = FALSE )
x |
|
y |
response vector of length |
group |
group structure (multiple options):
|
primary |
|
family |
character string |
alpha_init |
A scalar specifying the method used for obtaining initial coefficients:
|
cor |
character string |
alpha_final |
elastic net mixing parameter for final regression:
numeric between 0 for ridge penalisation
and 1 for lasso penalisation
(default: lasso penalisation with |
nfolds |
positive integer specifying the number of folds
(minimum NB: If |
foldid |
|
tune |
character string for determining the candidate values for the hyperparameters:
(The internal function |
na_action |
character |
silent |
Should messages from |
The numbers of observations (samples) for training or testing
are indicated by and , respectively,
the number of predictors (features) is indicated by ,
and the number of predictor group is indicated by .
Observations are indexed by in ,
predictors are indexed by in ,
and predictor groups are indexed by in .
The number of predictors in the group
is indicated by ,
with for non-overlapping groups.
Returns an object of class "cv.corila",
a list with the following slots:
model:
list with one slot for each combination of hyperparameters,
each slot contains an object of class "glmnet"
hyper:
data frame with one row for each combination of hyperparameters,
four columns for the values of the hyperparameters
(wgt_local, exp_local, wgt_global, and exp_global)
and a column for the cross-validated loss (cvm)
id_hyper:
index of combination of hyperparameters
leading to the lowest cross-validated loss
lambda.min
optimised regularisation hyperparameter
scale:
output from .forescale()
y_hat:
-dimensional vector of fitted values
Armin Rauschenberger (2026). "Sparse modelling with grouped and correlated features allowing for privileged information". In preparation.
Extract coefficients with coef() and make predictions with predict().
This user function repeatedly calls corila()
with different values for the regularisation and mixing hyperparameters.
The arguments of this function are validated with the helper functions listed here.
data <- simulate_data() model <- cv.corila(x = data$x_train, y = data$y_train, group = data$group, primary = data$primary) beta_hat <- coef(object = model) y_hat <- predict(object = model, newx = data$x_test) # example for automatic mutation testing (with the R package autotest) data <- simulate_data() model <- cv.corila(x = data$x_train, y = data$y_train, group = as.double(data$group), primary = data$primary, alpha_init = 0.0, foldid = rep(x = seq_len(10L), length.out = nrow(data$x_train)))data <- simulate_data() model <- cv.corila(x = data$x_train, y = data$y_train, group = data$group, primary = data$primary) beta_hat <- coef(object = model) y_hat <- predict(object = model, newx = data$x_test) # example for automatic mutation testing (with the R package autotest) data <- simulate_data() model <- cv.corila(x = data$x_train, y = data$y_train, group = as.double(data$group), primary = data$primary, alpha_init = 0.0, foldid = rep(x = seq_len(10L), length.out = nrow(data$x_train)))
Calculates the deviance.
## S3 method for class 'cv.corila' deviance(object, ...)## S3 method for class 'cv.corila' deviance(object, ...)
object |
object of class |
... |
(for compatibility with stats::deviance) |
Returns the deviance calculated by glmnet::deviance.glmnet()
for the model with the optimised mixing and regularisation hyperparameters.
Returns a scalar.
The internal function .deviance() calculates
the deviance from fitted and observed values.
# listing S3 methods methods(class = "cv.corila") # simulating data n <- 10L; p <- 20L; q <- 5L x <- matrix(rnorm(n * p), nrow = n , ncol = p) y <- rnorm(n) group <- rep(seq_len(q), length.out = p) primary <- as.logical(rbinom(n = p, size = 1L, prob = 0.5)) # fitting the model object <- cv.corila(x = x, y = y, group = group, primary = primary) # using S3 methods coef(object) predict(object, newx = x) fitted(object) residuals(object) plot(object) print(object) summary(object)# listing S3 methods methods(class = "cv.corila") # simulating data n <- 10L; p <- 20L; q <- 5L x <- matrix(rnorm(n * p), nrow = n , ncol = p) y <- rnorm(n) group <- rep(seq_len(q), length.out = p) primary <- as.logical(rbinom(n = p, size = 1L, prob = 0.5)) # fitting the model object <- cv.corila(x = x, y = y, group = group, primary = primary) # using S3 methods coef(object) predict(object, newx = x) fitted(object) residuals(object) plot(object) print(object) summary(object)
Extracts fitted values.
## S3 method for class 'cv.corila' fitted(object, ...)## S3 method for class 'cv.corila' fitted(object, ...)
object |
object of class |
... |
(for compatibility with stats::fitted) |
Returns a numeric vector of length
(one entry for each training observation).
Use predict() to obtain predicted values (i.e., for testing observations).
# listing S3 methods methods(class = "cv.corila") # simulating data n <- 10L; p <- 20L; q <- 5L x <- matrix(rnorm(n * p), nrow = n , ncol = p) y <- rnorm(n) group <- rep(seq_len(q), length.out = p) primary <- as.logical(rbinom(n = p, size = 1L, prob = 0.5)) # fitting the model object <- cv.corila(x = x, y = y, group = group, primary = primary) # using S3 methods coef(object) predict(object, newx = x) fitted(object) residuals(object) plot(object) print(object) summary(object)# listing S3 methods methods(class = "cv.corila") # simulating data n <- 10L; p <- 20L; q <- 5L x <- matrix(rnorm(n * p), nrow = n , ncol = p) y <- rnorm(n) group <- rep(seq_len(q), length.out = p) primary <- as.logical(rbinom(n = p, size = 1L, prob = 0.5)) # fitting the model object <- cv.corila(x = x, y = y, group = group, primary = primary) # using S3 methods coef(object) predict(object, newx = x) fitted(object) residuals(object) plot(object) print(object) summary(object)
"cv.corila"
Implemented S3 methods for objects of class "cv.corila":
coef(): extracts estimated coefficients
predict(): calculates predicted values
fitted(): extracts fitted values
residuals(): calculates deviance residuals
plot(): visualises observed vs fitted values and estimated coefficients
print(): prints information to the console
summary(): summarises the fitted model
deviance(): extracts the deviance
nobs(): extracts the number of observations
coef() returns a -dimensional vector,
predict() returns an -dimensional vector,
fitted() and residuals()
return an -dimensional vector.
See individual methods for details.
Use cv.corila() to fit the model.
# listing S3 methods methods(class = "cv.corila") # simulating data n <- 10L; p <- 20L; q <- 5L x <- matrix(rnorm(n * p), nrow = n , ncol = p) y <- rnorm(n) group <- rep(seq_len(q), length.out = p) primary <- as.logical(rbinom(n = p, size = 1L, prob = 0.5)) # fitting the model object <- cv.corila(x = x, y = y, group = group, primary = primary) # using S3 methods coef(object) predict(object, newx = x) fitted(object) residuals(object) plot(object) print(object) summary(object)# listing S3 methods methods(class = "cv.corila") # simulating data n <- 10L; p <- 20L; q <- 5L x <- matrix(rnorm(n * p), nrow = n , ncol = p) y <- rnorm(n) group <- rep(seq_len(q), length.out = p) primary <- as.logical(rbinom(n = p, size = 1L, prob = 0.5)) # fitting the model object <- cv.corila(x = x, y = y, group = group, primary = primary) # using S3 methods coef(object) predict(object, newx = x) fitted(object) residuals(object) plot(object) print(object) summary(object)
Fits multi-penalty ridge regression (tuning regularisation hyperparameters and estimating regression coefficients). This is a wrapper function of some functions from the multiridge-package.
multiridge( x, y, group, family = "gaussian", foldid = NULL, nfolds = 10L, penalties = NULL )multiridge( x, y, group, family = "gaussian", foldid = NULL, nfolds = 10L, penalties = NULL )
x |
predictors:
|
y |
response:
|
group |
|
family |
character |
foldid |
|
nfolds |
positive integer specifying the number of folds
(minimum NB: If |
penalties |
|
The numbers of observations (samples) for training or testing
are indicated by and , respectively,
the number of predictors (features) is indicated by ,
and the number of predictor group is indicated by .
Observations are indexed by in ,
predictors are indexed by in ,
and predictor groups are indexed by in .
The number of predictors in the group
is indicated by ,
with for non-overlapping groups.
Returns an object of class "multiridge",
a list with the following slots:
slots from IWLSridge() or IWLSCoxridge()
character family
with value "gaussian" (also for "linear"),
"binomial" (also for "logistic"), or "cox"
-dimensional vector penalties
containing optimised regularisation hyperparameters
(one for each predictor group)
list indices
with nfolds slots (one for each cross-validation fold),
each containing the indices of the observations
list datablocks
with slots (one for each predictor group),
each containing an matrix,
where
-dimensional group vector group (see argument)
list pars with slots family (see above),
the -dimensional vectors mu.x and sd.x
and the scalars mu.y and sd.y
Mark A. van de Wiel, Mirrelijn M. van Nee and Armin Rauschenberger (2021). "Fast cross-validation for multi-penalty high-dimensional ridge regression" Journal of Computational and Graphical Statistics 30(4):835-847. doi:10.1080/10618600.2021.1904962.
Extract coefficients with coef()
or make predictions with predict().
Use cv.corila() to estimate sparse models.
This wrapper function calls various functions from the multiridge-package, namely createXXblocks(), fastCV2(), CVfolds(), optLambdasWrap(), SigmaFromBlocks(), IWLSridge(), and IWLSCoxridge().
The multiridge-package
accepts not only
an matrix but also
a list of length of matrices,
with in .
data <- simulate_data(prob_primary = 1.0) model <- multiridge(x = data$x_train, y = data$y_train, group = data$group) beta_hat <- coef(model) y_hat <- predict(object = model, newx = data$x_test)data <- simulate_data(prob_primary = 1.0) model <- multiridge(x = data$x_train, y = data$y_train, group = data$group) beta_hat <- coef(model) y_hat <- predict(object = model, newx = data$x_test)
Extracts the number of observations.
## S3 method for class 'cv.corila' nobs(object, ...)## S3 method for class 'cv.corila' nobs(object, ...)
object |
object of class |
... |
(for compatibility with stats::nobs) |
Returns a positive integer.
# listing S3 methods methods(class = "cv.corila") # simulating data n <- 10L; p <- 20L; q <- 5L x <- matrix(rnorm(n * p), nrow = n , ncol = p) y <- rnorm(n) group <- rep(seq_len(q), length.out = p) primary <- as.logical(rbinom(n = p, size = 1L, prob = 0.5)) # fitting the model object <- cv.corila(x = x, y = y, group = group, primary = primary) # using S3 methods coef(object) predict(object, newx = x) fitted(object) residuals(object) plot(object) print(object) summary(object)# listing S3 methods methods(class = "cv.corila") # simulating data n <- 10L; p <- 20L; q <- 5L x <- matrix(rnorm(n * p), nrow = n , ncol = p) y <- rnorm(n) group <- rep(seq_len(q), length.out = p) primary <- as.logical(rbinom(n = p, size = 1L, prob = 0.5)) # fitting the model object <- cv.corila(x = x, y = y, group = group, primary = primary) # using S3 methods coef(object) predict(object, newx = x) fitted(object) residuals(object) plot(object) print(object) summary(object)
Plot method for class "cv.corila".
## S3 method for class 'cv.corila' plot(x, ...)## S3 method for class 'cv.corila' plot(x, ...)
x |
object of class |
... |
(for compatibility with base::plot) |
This function generates two figures:
a scatter plot of fitted versus observed values for the Gaussian and the Poisson families, a box plot of predicted probabilities for the two classes for the binomial family, or a histogram of fitted relative risks for the Cox model
estimated coefficients versus indices of predictors
Returns NULL invisibly.
n <- 12L # decrease to 10 to check LOOCV p <- 20L q <- 5L x <- matrix(rnorm(n * p), nrow = n, ncol = p) y <- rnorm(n) group <- rep(seq_len(q), length.out = p) primary <- as.logical(rbinom(n = p, size = 1L, prob = 0.5)) object <- cv.corila(x = x, y = y, group = group, primary = primary) print(object) summary(object)n <- 12L # decrease to 10 to check LOOCV p <- 20L q <- 5L x <- matrix(rnorm(n * p), nrow = n, ncol = p) y <- rnorm(n) group <- rep(seq_len(q), length.out = p) primary <- as.logical(rbinom(n = p, size = 1L, prob = 0.5)) object <- cv.corila(x = x, y = y, group = group, primary = primary) print(object) summary(object)
Makes predictions from an object of class "cv.corila".
## S3 method for class 'cv.corila' predict(object, newx, s = "lambda.min", ...)## S3 method for class 'cv.corila' predict(object, newx, s = "lambda.min", ...)
object |
object of class |
newx |
|
s |
character |
... |
(for compatibility with stats::predict) |
This function calls
.expand_auxiliary() for handling auxiliary predictors,
.forescale()
for standardising the predictor matrix,
and .backscale()
for bringing predicted values back to the original scale
(if family="gaussian").
Returns fitted or predicted values in an
-dimensional or
-dimensional matrix, respectively.
Armin Rauschenberger (2026). "Sparse modelling with grouped and correlated features allowing for privileged information". In preparation.
Fit models with cv.corila(),
extract coefficients with coef(),
and extract fitted values with fitted().
data <- simulate_data() model <- cv.corila(x = data$x_train, y = data$y_train, group = data$group, primary = data$primary) beta_hat <- coef(object = model) y_hat <- predict(object = model, newx = data$x_test) # example for automatic mutation testing (with the R package autotest) data <- simulate_data() model <- cv.corila(x = data$x_train, y = data$y_train, group = as.double(data$group), primary = data$primary, alpha_init = 0.0, foldid = rep(x = seq_len(10L), length.out = nrow(data$x_train)))data <- simulate_data() model <- cv.corila(x = data$x_train, y = data$y_train, group = data$group, primary = data$primary) beta_hat <- coef(object = model) y_hat <- predict(object = model, newx = data$x_test) # example for automatic mutation testing (with the R package autotest) data <- simulate_data() model <- cv.corila(x = data$x_train, y = data$y_train, group = as.double(data$group), primary = data$primary, alpha_init = 0.0, foldid = rep(x = seq_len(10L), length.out = nrow(data$x_train)))
Makes predictions from a multi-penalty ridge regression model.
## S3 method for class 'multiridge' predict(object, newx, ...)## S3 method for class 'multiridge' predict(object, newx, ...)
object |
object of type |
newx |
|
... |
(for compatibility with stats::predict) |
Returns an -dimensional vector of fitted values
or an -dimensional vector of predicted values.
Mark A. van de Wiel, Mirrelijn M. van Nee and Armin Rauschenberger (2021). "Fast cross-validation for multi-penalty high-dimensional ridge regression" Journal of Computational and Graphical Statistics 30(4):835-847. doi:10.1080/10618600.2021.1904962.
Fit models with multiridge()
and extract coefficients with coef().
data <- simulate_data(prob_primary = 1.0) model <- multiridge(x = data$x_train, y = data$y_train, group = data$group) beta_hat <- coef(model) y_hat <- predict(object = model, newx = data$x_test)data <- simulate_data(prob_primary = 1.0) model <- multiridge(x = data$x_train, y = data$y_train, group = data$group) beta_hat <- coef(model) y_hat <- predict(object = model, newx = data$x_test)
Residuals
## S3 method for class 'cv.corila' residuals(object, ...)## S3 method for class 'cv.corila' residuals(object, ...)
object |
object of class |
... |
(for compatibility with stats::residuals) |
This function extracts the observed and fitted values from the fitted model
and calls the internal function .residuals() to calculate the residuals.
Returns a numeric vector of length
(one entry for each training observation).
# listing S3 methods methods(class = "cv.corila") # simulating data n <- 10L; p <- 20L; q <- 5L x <- matrix(rnorm(n * p), nrow = n , ncol = p) y <- rnorm(n) group <- rep(seq_len(q), length.out = p) primary <- as.logical(rbinom(n = p, size = 1L, prob = 0.5)) # fitting the model object <- cv.corila(x = x, y = y, group = group, primary = primary) # using S3 methods coef(object) predict(object, newx = x) fitted(object) residuals(object) plot(object) print(object) summary(object)# listing S3 methods methods(class = "cv.corila") # simulating data n <- 10L; p <- 20L; q <- 5L x <- matrix(rnorm(n * p), nrow = n , ncol = p) y <- rnorm(n) group <- rep(seq_len(q), length.out = p) primary <- as.logical(rbinom(n = p, size = 1L, prob = 0.5)) # fitting the model object <- cv.corila(x = x, y = y, group = group, primary = primary) # using S3 methods coef(object) predict(object, newx = x) fitted(object) residuals(object) plot(object) print(object) summary(object)
Simulates a predictor matrix, an effect vector and a response vector. The simulated datasets can be used for modelling a response based on grouped and correlated primary and auxiliary predictors.
simulate_data( n0 = 50L, n1 = 20L, p = 30L, q = 10L, family = "gaussian", rho_between = 0, rho_within = 0.5, prob_primary = 0.5, prob_group = 0.5, prob_predictor = 0.8, signal_strength = 1, seed = 1L )simulate_data( n0 = 50L, n1 = 20L, p = 30L, q = 10L, family = "gaussian", rho_between = 0, rho_within = 0.5, prob_primary = 0.5, prob_group = 0.5, prob_predictor = 0.8, signal_strength = 1, seed = 1L )
n0 |
number of training observations:
positive integer scalar
(minimum 1,
maximum |
n1 |
number of testing observations:
non-negative integer scalar
(minimum 0,
maximum |
p |
number of predictors:
positive integer scalar
(minimum 1 leads to a single predictor,
maximum |
q |
number of predictor groups:
positive integer scalar
(minimum 1 assigns all predictors to the same group.
maximum |
family |
character string |
rho_between |
correlation coefficient for predictors in different groups:
positive numeric scalar in the unit interval
(minimum 0 leads to uncorrelated predictors between groups,
maximum |
rho_within |
correlation coefficient for predictors within the same group: positive numeric scalar in the unit interval (minimum 0 leads to uncorrelated predictors within each group, maximum 1 leads to identical predictors within each group) |
prob_primary |
probability for each predictor to be primary (rather than auxiliary): numeric scalar in the unit interval (minimum 0 leads to auxiliary predictors only, maximum 1 leads to primary predictors only) |
prob_group |
probability for each predictor group to be active: numeric scalar in the unit interval (minimum 0 makes all groups inactive, maximum 1 makes all groups active) |
prob_predictor |
probability for each predictor in an active group to be active: numeric scalar in the unit interval (minimum 0 makes all predictors inactive, maximum 1 makes all predictors in active groups active) |
signal_strength |
non-negative numeric scalar
for multiplying the effect sizes
(default: |
seed |
random seed for reproducibility: integer scalar (unrestricted) |
Use the objects x_train, y_train, group, and primary
for model training.
Estimated coefficients can be compared with beta.
Use the object x_test for model testing.
Predicted values can be compared with y_test.
Training and testing observations are named train_ or test_,
respectively, followed by a number indexing the observations
(e.g., train_1 or test_1).
Primary and auxiliary predictors are named pri_ or aux_, respectively,
followed by a number indexing the predictor groups, a point,
and a number indexing the predictors within this group
(e.g., pri_1.1 or aux_1.1).
Returns a named list with the following slots:
x_train:
predictor matrix of the training observations
( rows, columns)
y_train:
response vector of the training observations
(length )
group:
integer vector indicating the group of the predictors
(length )
primary:
logical vector indicating
primary (TRUE) and auxiliary (FALSE) predictors
(length )
beta:
numeric vector of the effects of the predictors on the response
(length )
x_test:
predictor matrix for the test observations
y_test:
response vector for the test observations of length
This function calls the internal functions .simulate_predictors(),
.simulate_effects(), and .simulate_response() for simulating the
predictor matrix, the effect vector, or the response vector, respectively.
data <- simulate_data(n0 = 50L, n1 = 20L, p = 30L, q = 10L, family = "gaussian", rho_between = 0.0, rho_within = 0.5, prob_primary = 0.5, signal_strength = 1.0, prob_group = 0.5, prob_predictor = 0.8, seed = 1L) utils::str(data, vec.len = 2L)data <- simulate_data(n0 = 50L, n1 = 20L, p = 30L, q = 10L, family = "gaussian", rho_between = 0.0, rho_within = 0.5, prob_primary = 0.5, signal_strength = 1.0, prob_group = 0.5, prob_predictor = 0.8, seed = 1L) utils::str(data, vec.len = 2L)