View source: R/environment_mix_lib_package.R
lmi_simul_dat | R Documentation |
Simulate data from linear model with interactions
lmi_simul_dat(
n,
p,
q,
block_idx = c(1, 1, 2, 2, 3, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3),
sigma2_x = 1,
within_rho = 0.6,
btw_rho = 0.2,
R2 = 0.8,
effect_size = 1,
effect_size_i = 1,
cancel_effect = TRUE
)
n |
a positive integer to indicate sample size |
p |
a positive integer to specify the number of exposures |
q |
a positive integer to specify the number of non-zero effects |
block_idx |
a vector of positive integers to indicate the block IDs. The length of the vector is p. |
sigma2_x |
a positive numeric scalar for variance of the covariates |
within_rho |
a numeric scalar between 0 and 1 for the within block correlation |
btw_rho |
a numeric scalar between 0 and 1 for the between block correlation |
R2 |
a numeric scalar for R-squared |
effect_size |
a numeric scalar for effect size for main effect |
effect_size_i |
a numeric scalar for effect size for interaction effect |
cancel_effect |
a logic value to indicate whether there is effect cancelation |
a list object of the following
covariate matrix of dimension n by p
sample size
number of covariates
variance
within block correlation
between block correaltion
block indices
Wei Hao <weihao@umich.edu>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.