View source: R/synthetic_data.R
| generate_realistic_data | R Documentation |
Generates a realistic dataset simulating treatment assignment, covariates, and potential outcomes.
generate_realistic_data(
n,
ncov = 5L,
scenario_mu = "Realistic",
scenario_nu = "Realistic",
is_RCT = FALSE,
seed = NA
)
n |
Number of observations to generate. |
ncov |
Number of baseline covariates (at least 2L and 10L by default). |
scenario_mu |
String indicating the type of scenario for delta_Mu ("Linear", "Threshold", "Mix", "Null", "Constant"). |
scenario_nu |
String indicating the type of scenario for delta_Nu ("Linear", "Threshold", "Mix", "Satisfied"). |
is_RCT |
Logical value indicating whether the scenario is an RCT (FALSE by default). |
seed |
Integer or NA (NA by default). |
A list containing two data frames (df_complete with all potential outcomes and
treatment assignments and df_obs with observed outcomes based on treatment) and the oracular
functions delta_Mu and delta_Nu.
data <- generate_realistic_data(100)
head(data[[1]]) # complete data
head(data[[2]]) # observed data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.