Skip to contents

Returns the directed acyclic graph used to generate the cohort, as a dagitty::dagitty() object. Follow-up heart rate HR1 is the crux: it is caused by the baseline dose (drug1 -> HR1, the mediator path) and is itself a confounder of the follow-up dose (HR1 -> drug2, HR1 -> death). That double role is what defeats ordinary adjustment.

Usage

hr_dag()

Value

A dagitty object (requires the suggested dagitty package).

Details

With dagitty you can read off the correct adjustment set and confirm there is no single set of covariates you can condition on to unbiasedly estimate the effect of both doses at once – the formal statement of why you need weighting.

Examples

if (requireNamespace("dagitty", quietly = TRUE)) {
  g <- hr_dag()
  # heart rate is a treatment-affected confounder of the follow-up dose:
  dagitty::adjustmentSets(g, exposure = "drug2", outcome = "death")
}
#> { HR1, baseline_hr, drug1 }