R/generate_synthetic_data_het.R
generate_syn_data_het.Rd
Generates synthetic data set based on different GPS models and covariates with heterogeneous properties.
generate_syn_data_het(
sample_size = 10000,
outcome_type = "continuous",
outcome_sd = 1,
gps_spec = 1,
cova_spec = 1,
em_spec = 1,
heterogenous_intercept = FALSE,
em_as_confounder = FALSE,
beta = 1
)
Number of data samples.
Continuous or binary outcome.
Standard deviation used to generate the outcome in the synthetic data set.
A numerical value (1-7) that indicates the GPS model used to generate synthetic data. See the code for more details.
A numerical value (1-2) to modify the covariates. If
cova_spec == 1
, covariates are mutually independent. See the
code for more details.
A numerical value (1-2) that indicates the effect modification model.
em_spec == 1
: Separates main effects of effect modifiers on treatment
effect (i.e. no interaction between effect modifiers).
em_spec == 2
: Indicates interaction between effect modifiers.
Allow intercepts to differ by effect modifier level.
Effect modifier 1 has linear association with treatment (i.e. is a confounder).
description
synthetic_data
: The function returns a data.frame saved the
constructed synthetic data.
This function is a modified version of a function originally defined in the CausalGPS package.
set.seed(298)
s_data <- generate_syn_data_het(sample_size=100,
outcome_sd = 10,
gps_spec = 1,
cova_spec = 1)