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
)

Arguments

sample_size

Number of data samples.

outcome_type

Continuous or binary outcome.

outcome_sd

Standard deviation used to generate the outcome in the synthetic data set.

gps_spec

A numerical value (1-7) that indicates the GPS model used to generate synthetic data. See the code for more details.

cova_spec

A numerical value (1-2) to modify the covariates. If cova_spec == 1, covariates are mutually independent. See the code for more details.

em_spec

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.

heterogenous_intercept

Allow intercepts to differ by effect modifier level.

em_as_confounder

Effect modifier 1 has linear association with treatment (i.e. is a confounder).

beta

description

Value

synthetic_data: The function returns a data.frame saved the constructed synthetic data.

Note

This function is a modified version of a function originally defined in the CausalGPS package.

Examples


set.seed(298)
s_data <- generate_syn_data_het(sample_size=100,
                                outcome_sd = 10,
                                gps_spec = 1,
                                cova_spec = 1)