gen.sim.data generates data from the following model
Y = X_0 Beta_0^T + X_1 Beta_1^T + Z Gamma^T + E Sigma^1/2,
Z|X_0, X_1 = X_0 Alpha_0^T + X_1 Alpha_1^T + D,
cov(X_0, X_1) ~ Sigma_X
gen.sim.data(
n,
p,
r,
d0 = 0,
d1 = 1,
X.dist = c("binary", "normal"),
alpha = matrix(0.5, r, d0 + d1),
beta = NULL,
beta.strength = 1,
beta.nonzero.frac = 0.05,
Gamma = NULL,
Gamma.strength = sqrt(p),
Gamma.beta.cor = 0,
Sigma = 1,
seed = NULL
)number of observations
number of observed variables
number of confounders
number of nuisance regression covariates
number of primary regression covariates
the distribution of X, either "binary" or "normal"
association of X and Z, a r*d vector (d = d0 + d1)
treatment effects, a p*d vector
strength of beta
if beta is not specified, fraction of nonzeros in beta
confounding effects, a p*r matrix
strength of Gamma, more precisely the mean of square entries of Gamma * alpha
the "correlation" (proportion of variance explained) of beta and Gamma
noise variance, a p*p matrix or p*1 vector or a single real number
random seed
a list of objects
matrix of nuisance covariates
matrix of primary covariates
matrix Y
matrix of confounders
regression coefficients between X and Z
regression coefficients between X and Y
coefficients between Z and Y
noise variance
the nonzero positions in beta
number of confounders