simul_x_block {CompMix}R Documentation

Simulate covariate matrix with block structure

Description

Simulate covariate matrix with block structure

Usage

simul_x_block(n, p, block_idx, sigma2_x = 1, within_rho = 0.6, btw_rho = 0.2)

Arguments

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

Value

a list object of the following

x

covariate matrix of dimension n by p

n

sample size

p

number of covariates

sigma2_x

variance

within_rho

within block correlation

btw_rho

between block correaltion

block_idx

block indices

Author(s)

Wei Hao <weihao@umich.edu>

Examples

dat <- simul_x_block(n = 1000, p = 10, block_idx = rep(1:4,length=10))

[Package CompMix version 0.1.0 Index]