powered by
Simulate covariate matrix with block structure
simul_x_block(n, p, block_idx, sigma2_x = 1, within_rho = 0.6, btw_rho = 0.2)
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
a positive integer to indicate sample size
a positive integer to specify the number of covariates
a vector of positive integers to indicate the block IDs. The length of the vector is p.
a positive numeric scalar for variance of the covariates
a numeric scalar between 0 and 1 for the within block correlation
a numeric scalar between 0 and 1 for the between block correlation
Wei Hao <weihao@umich.edu>
dat <- simul_x_block(n = 1000, p = 10, block_idx = rep(1:4,length=10))
Run the code above in your browser using DataLab