generate_cre_dataset {CRE}  R Documentation 
Generates synthetic data with continues or binary outcome.
generate_cre_dataset(
n = 1000,
rho = 0,
n_rules = 2,
p = 10,
effect_size = 2,
binary_covariates = TRUE,
binary_outcome = TRUE,
confounding = "no"
)
n 
An integer number that represents the number of observations. Noninteger values will be converted into an integer number. 
rho 
A positive double number that represents the correlation within the covariates (default: 0, range: (0,1)). 
n_rules 
The number of causal rules. (default: 2, range: 1,2,3,4). 
p 
The number of covariates (default: 10). 
effect_size 
The effect size magnitude in (default: 2, range: >=0). 
binary_covariates 
Whether to use binary or continuous covariates (default: TRUE). 
binary_outcome 
Whether to use binary or continuous outcomes (default: TRUE). 
confounding 
Only for continuous outcome, add confounding variables:

A list of synthetic data containing:
An outcome vector (y
),
A treatment vector (z
),
A covariates matrix (X
) and
An individual treatment vector (ite
)
Set (binary/continuous) covariates domain (binary_covariates
).
Set (binary/continuous) outcome domain (binary_outcome
).
Increase complexity in heterogeneity discovery:
Decreasing the sample size (n
),
adding correlation among variables (rho
),
increasing the number of rules (n_rules
),
increasing the number of covariates (p
),
decreasing the absolute value of the causal effect (effect_size
),
adding linear or notlinear confounders (confounding
).
set.seed(123)
dataset < generate_cre_dataset(n = 1000, rho = 0, n_rules = 2, p = 10,
effect_size = 2, binary_covariates = TRUE,
binary_outcome = TRUE, confounding = "no")