causal_collider_time {quartets}R Documentation

Time-varying Causal Quartet Data

Description

These datasets contains 100 observations, each generated under a different data generating mechanism:

Usage

causal_collider_time

causal_confounding_time

causal_mediator_time

causal_m_bias_time

causal_quartet_time

Format

causal_collider_time: A dataframe with 100 rows and 7 variables:

causal_confounding_time: A dataframe with 100 rows and 7 variables:

causal_mediator_time: A dataframe with 100 rows and 7 variables:

causal_m_bias_time: A dataframe with 100 rows and 9 variables:

An object of class tbl_df (inherits from tbl, data.frame) with 400 rows and 12 columns.

Details

There are two time points:

These datasets help demonstrate that a model that includes only pre-exposure covariates (that is, only adjusting for covariates measured at baseline), will be less prone to potential biases. Adjusting for only pre-exposure covariates "solves" the bias in datasets 1-3. It does not solve the data generated under the "M-bias" scenario, however this is more of a toy example, it has been shown many times that the assumptions needed for this M-bias to hold are often not ones we practically see in data analysis.

References

D'Agostino McGowan L, Barrett M (2023). Causal inference is not a statistical problem. Preprint arXiv:2304.02683v1.

Examples


## incorrect model because covariate is post-treatment
lm(outcome_followup ~ exposure_baseline + covariate_followup,
   data = causal_collider_time)

## correct model because covariate is pre-treatment
## even though the true mechanism dictates that the covariate is a collider,
## because the pre-exposure variable is used, the collider bias does not
## occur.
lm(outcome_followup ~ exposure_baseline + covariate_baseline,
   data = causal_collider_time)

[Package quartets version 0.1.1 Index]