DG {AteMeVs} | R Documentation |
Generation of artificial data
Description
This function is used to generate an artificial dataset, which contains potential outcomes, treatments, and error-prone confounders.
Usage
DG(X,Z,gamma_X,gamma_Z,Sigma_e,outcome="continuous")
Arguments
X |
an |
Z |
an |
gamma_X |
a |
gamma_Z |
a |
Sigma_e |
a |
outcome |
the indicator of the nature of the outcome variable; |
Details
This function is used to generate artificial data, including potential outcomes, binary treatments, and error-prone and precisely measured confounders.
Value
data |
an |
Author(s)
Chen, L.-P. and Yi, G. Y.
References
Yi, G. Y. and Chen, L.-P. (2023). Estimation of the average treatment effect with variable selection and measurement error simultaneously addressed for potential confounders. Statistical Methods in Medical Research, 32, 691-711.
Examples
library(MASS)
n = 800
p_x = 10 # dimension of parameters
p_z = 10
p = p_x + p_z
gamma_X = c(rep(1,2),rep(0,p_x-2))
gamma_Z = c(rep(1,2),rep(0,p_z-2))
gamma = c(gamma_X, gamma_Z)
mu_X = rep(0,p_x)
mu_Z = rep(0,p_z)
Sigma_X = diag(1,p_x,p_x)
Sigma_Z = diag(1,p_z,p_z)
Sigma_e = diag(0.2,p_x)
X = mvrnorm(n, mu_X, Sigma_X, tol = 1e-6, empirical = FALSE, EISPACK = FALSE)
Z = mvrnorm(n, mu_Z, Sigma_Z, tol = 1e-6, empirical = FALSE, EISPACK = FALSE)
data = DG(X,Z,gamma_X,gamma_Z,Sigma_e,outcome="continuous")