R/generate_synthetic_data_outcome.R
generate_syn_data_outcome.Rd
Generates synthetic outcome variable given covariate, effect modifier, and treatment variables.
generate_syn_data_outcome(
cf,
em,
treat,
outcome_sd = 1,
em_spec = 1,
heterogenous_intercept = FALSE,
beta = 1
)
A data.frame of confounder variables
A data.frame of effect modifier variables
A vector of treatment variable
standard deviation of outcome variable
specification of effect modifier function (possible values: 0, 1, 2)
em_spec == 0
: no effect modification
em_spec == 1
:independent effect modification of em1
and em2
(4 causal effect groups)
em_spec == 2
-> interactive effect modification of em1
and em2
(3 causal effect groups)
whether the intercept of the CRF should vary by effect modifier levels
strength of effect modification (only effective if em_spec is 1 or 2)
A data.frame of simulated data.
set.seed(41)
covariate_data <- generate_syn_data_covs(sample_size = 200,
gps_spec = 1)