← All posts

Causal Inference with DAGs in Pediatric Clinical Research

Clinical Epidemiology ResearchUniqcret doctor knowledgesMethodology and Research DesignEtiology [Methodology]

🎯 Learning Objectives

By the end of this guide, you’ll be able to:

✅ Classify variables into confounders, mediators, colliders, and effect modifiers ✅ Detect bias paths using DAGs ✅ Use DAGitty to build and test your DAG ✅ Apply causal logic to real-world clinical studies


🩺 Clinical Question (New Example)

Does initiating antipyretic treatment within 30 minutes reduce the risk of seizure recurrence in children presenting with febrile seizure?

DEPTh Type: Therapeutic (intervention → outcome)


📌 1. DAG = Directed Acyclic Graph

What’s a DAG?

🧠 DAGs map your thinking, not just your variables.


🧠 2. Classifying Variable Roles

RoleMeaningAdjust?Example
Exposure (X)The treatment or risk factorAntipyretic within 30 minutes
Outcome (Y)The endpointSeizure recurrence within 6 hours
ConfounderCommon cause of X and YInitial fever severity
MediatorLies on causal path X → Y❌*Rate of temperature decline
ColliderCaused by both X and YED length of stay
Effect ModifierAlters strength of X → YUnderlying epilepsy
PrecursorPrecedes X or Y, not necessarily a cause⚠️ CarePrior hospitalization

*Adjust for mediator only if estimating direct effect.


🧪 3. Drawing the DAG

dagitty

dag {

FeverSeverity -> EarlyAntipyretic

FeverSeverity -> SeizureRecurrence

EarlyAntipyretic -> TempDecline

TempDecline -> SeizureRecurrence

Epilepsy -> SeizureRecurrence

Epilepsy -> EarlyAntipyretic

ED_Crowding -> EarlyAntipyretic

}

Adjust for: FeverSeverity, Epilepsy

Don’t adjust for: TempDecline (mediator), ED_Crowding (precursor), LengthOfStay (collider)

🔗 Try it: Open DAG in DAGitty


🔁 4. Understanding Path Types

Path TypeExampleOpen?Adjust?Why?
CausalX → YThis is the path you want to estimate
Backdoor (confounder)X ← C → YBiases effect estimate
Mediated causal pathX → M → Y❌*Keep open if estimating total effect
Collider pathX → Z ← YAdjusting opens a spurious path

🧠 Collider adjustment = new bias creation, not removal.


🧱 5. Backdoor Control

🎯 Backdoor paths = non-causal routes that simulate effects.

To close them:

In our case:


💥 6. Collider Trap in Pediatric Context

New Scenario:

Let’s add:

dagitty

LengthOfStay -> EarlyAntipyretic

LengthOfStay -> SeizureRecurrence But wait — that's wrong. LengthOfStay is affected by both:

dagitty

dag {

EarlyAntipyretic -> LengthOfStay

SeizureRecurrence -> LengthOfStay

}

Here, LengthOfStay is a collider. ❌ Adjusting for it opens a backdoor: EarlyAntipyretic → LOS ← SeizureRecurrence


🎭 7. Effect Modification vs. Interaction

ConceptWhat It MeansExample
Effect ModifierX → Y effect varies by ZAntipyretic works better in children without epilepsy
InteractionX1 and X2 together influence Y differentlyHigh fever + fast antipyretic = exponential benefit

Model it with: X + Z + X*Z Visualize it by: Stratified DAGs or subgroup KM curves


🧩 8. Clinical Reasoning First: Then Model

Use this workflow:

Clinical Question → Variable Roles → DAG → DAGitty Adjustment → Regression Model

❌ Don’t start with a dataset ✅ Start with causal structure


📋 9. DAG Construction Checklist

  1. Define exposure (X) and outcome (Y)
  2. Identify variable roles:
    • Confounders
    • Mediators
    • Colliders
    • Precursors
  3. Draw DAG (DAGitty or pen + paper)
  4. Run Adjustment Sets in DAGitty
  5. Build a regression model with justified covariates

✅ Final Takeaways