simul_covariates: Generation of a Design Matrix for Simulations
Description
This function uses a block diagonal covariance matrix for the underlying
multivariate normal data to create the design matrix in blocks of 10, see
the details.
(count) number of covariates (excluding treatment arm).
add_contvars
(flag) whether to add continuous covariates.
arm_factor
(flag) whether to make the arm variable a factor.
Details
The following pattern is repeated for the covariate blocks:
The first 5 covariates are uncorrelated with everything.
The covariates 6 to 8 have "moderate" correlation (0.25) between each other.
The covariates 9 and 10 have "high" correlation (0.5).
By default, only the resulting categorical covariates obtained by thresholding
are included. Optionally also the original continuous covariates are included
in the returned design matrix.