Generate Causal Interventions and Contrasts Section for Methods
boilerplate_report_causal_interventions.Rd
This function generates a markdown-formatted section describing the causal interventions and contrasts for a causal inference study. It details the interventions considered and the approach to contrasts (pairwise, null, or custom).
Usage
boilerplate_report_causal_interventions(
causal_interventions,
exposure_var,
contrasts = "pairwise",
null_intervention = NULL
)
Arguments
- causal_interventions
A character vector specifying the causal interventions. Use "exposure_var" as a placeholder for the exposure variable name.
- exposure_var
A character string specifying the name of the exposure variable.
- contrasts
A character string specifying the type of contrasts. Options are "pairwise", "null", or "custom". Default is "pairwise".
- null_intervention
A character string specifying the null intervention when using "null" contrasts. Default is NULL.
Value
A character string containing the markdown-formatted section on causal interventions and contrasts.
Details
The function replaces "exposure_var" in the causal_interventions and null_intervention with the actual name of the exposure variable.
For contrasts:
"pairwise": Indicates that all interventions will be compared to each other.
"null": Indicates that all interventions will be compared to a specified null intervention.
"custom": Indicates that custom contrasts will be used, which should be defined elsewhere.
Examples
boilerplate_report_causal_interventions(
causal_interventions = c("Increase exposure_var", "Do not change exposure_var"),
exposure_var = "political_conservative",
contrasts = "null",
null_intervention = "Do not change exposure_var"
)
#> ### Causal Interventions and Contrasts
#>
#> #### Interventions
#> This study considers the following causal interventions on the exposure variable 'political_conservative':
#>
#> - Increase political_conservative
#> - Do not change political_conservative
#>
#> #### Contrasts
#> We compare each intervention to the null intervention: "Do not change political_conservative". This approach allows us to evaluate the effect of each intervention relative to a baseline scenario.
#>
#> This approach to defining interventions and contrasts allows us to systematically evaluate the causal effects of interest in our study.