View source: R/environment_mix_lib_package.R
simul_x_block | R Documentation |
Simulate covariate matrix with block structure
simul_x_block(n, p, block_idx, sigma2_x = 1, within_rho = 0.6, btw_rho = 0.2)
n |
a positive integer to indicate sample size |
p |
a positive integer to specify the number of covariates |
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 |
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>
dat <- simul_x_block(n = 1000, p = 10, block_idx = rep(1:4,length=10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.