Define causal effect from a causal inference framework
Describe what a confounder is using a directed acyclic graph (DAG)
Explain how randomized experiments control for confounders
Explain when and how statistical adjustment can potentially remove confounding
Explain how including cluster means can remove confounders at level 2
E.g., Sector on Achievement coefficient with HSB data
...># Formula: mathach ~ sector + (1 | id)># Data: hsball># ># Fixed effects:># Estimate Std. Error t value># (Intercept) 11.393 0.293 38.91># sector1 2.805 0.439 6.39...sector = 1) vs. public schools (sector = 0)E.g., Sector on Achievement coefficient with HSB data
...># Formula: mathach ~ sector + (1 | id)># Data: hsball># ># Fixed effects:># Estimate Std. Error t value># (Intercept) 11.393 0.293 38.91># sector1 2.805 0.439 6.39...The predicted difference in achievement between students in Catholic (sector = 1) vs. public schools (sector = 0)
^Y∣X=1−^Y∣X=0
What is the causal effect of sector on achievement?
Two interpretations:
What is the causal effect of sector on achievement?
Two interpretations:
Predicting an intervention
What is the causal effect of sector on achievement?
Two interpretations:
Predicting an intervention
Counterfactual
[1] https://doi.org/10.1080/01621459.1986.10478354
[2] https://doi.org/10.1037/h0037350
[3] Pearl, J. (2009). Causality (2nd ed.).
| id | minority | female | ses | sector | mathach (sector = 0) | mathach (sector = 1) |
|---|---|---|---|---|---|---|
| 1224 | 0 | 1 | -1.528 | 0 | 5.88 | NA |
| 1224 | 0 | 1 | -0.588 | 0 | 19.71 | NA |
| 1224 | 0 | 0 | -0.528 | 0 | 20.35 | NA |
| 1224 | 0 | 0 | -0.668 | 0 | 8.78 | NA |
| 1224 | 0 | 0 | -0.158 | 0 | 17.90 | NA |
| 1224 | 0 | 0 | 0.022 | 0 | 4.58 | NA |
| 1308 | 0 | 0 | 0.422 | 1 | NA | 13.23 |
| 1308 | 0 | 0 | 0.562 | 1 | NA | 13.95 |
| 1308 | 1 | 0 | -0.058 | 1 | NA | 13.76 |
| 1308 | 0 | 0 | 0.952 | 1 | NA | 13.97 |
| 1308 | 0 | 0 | 0.622 | 1 | NA | 23.43 |
| 1308 | 0 | 0 | 0.832 | 1 | NA | 9.16 |
sector makes no difference . . .| id | minority | female | ses | sector | mathach (sector = 0) | mathach (sector = 1) | causal effect |
|---|---|---|---|---|---|---|---|
| 1224 | 0 | 1 | -1.528 | 0 | 5.88 | 5.88 | 0 |
| 1224 | 0 | 1 | -0.588 | 0 | 19.71 | 19.71 | 0 |
| 1224 | 0 | 0 | -0.528 | 0 | 20.35 | 20.35 | 0 |
| 1224 | 0 | 0 | -0.668 | 0 | 8.78 | 8.78 | 0 |
| 1224 | 0 | 0 | -0.158 | 0 | 17.90 | 17.90 | 0 |
| 1224 | 0 | 0 | 0.022 | 0 | 4.58 | 4.58 | 0 |
| 1308 | 0 | 0 | 0.422 | 1 | 13.23 | 13.23 | 0 |
| 1308 | 0 | 0 | 0.562 | 1 | 13.95 | 13.95 | 0 |
| 1308 | 1 | 0 | -0.058 | 1 | 13.76 | 13.76 | 0 |
| 1308 | 0 | 0 | 0.952 | 1 | 13.97 | 13.97 | 0 |
| 1308 | 0 | 0 | 0.622 | 1 | 23.43 | 23.43 | 0 |
| 1308 | 0 | 0 | 0.832 | 1 | 9.16 | 9.16 | 0 |
A confounder U is depicted in the following directed acyclic graph (DAG)

U biases the observed association between X and Y from the causal effect of X → Y
E.g., consider minority and ses as potential confounders
| sector | minority |
|---|---|
| 0 | 0.253 |
| 1 | 0.297 |
ses across sectors
Remove all confounds (probabilistically)

We still don't know the counterfactuals, but
| id | minority | female | ses | sector | mathach (sector = 0) | mathach (sector = 1) |
|---|---|---|---|---|---|---|
| 1224 | 0 | 1 | -1.528 | 0 | 5.88 | NA |
| 1224 | 0 | 1 | -0.588 | 0 | 19.71 | NA |
| 1224 | 0 | 0 | -0.528 | 0 | 20.35 | NA |
| 1224 | 0 | 0 | -0.668 | 0 | 8.78 | NA |
| 1224 | 0 | 0 | -0.158 | 0 | 17.90 | NA |
| 1224 | 0 | 0 | 0.022 | 0 | 4.58 | NA |
| 1308 | 0 | 0 | 0.422 | 1 | NA | 13.23 |
| 1308 | 0 | 0 | 0.562 | 1 | NA | 13.95 |
| 1308 | 1 | 0 | -0.058 | 1 | NA | 13.76 |
| 1308 | 0 | 0 | 0.952 | 1 | NA | 13.97 |
| 1308 | 0 | 0 | 0.622 | 1 | NA | 23.43 |
| 1308 | 0 | 0 | 0.832 | 1 | NA | 9.16 |
Statistical control requires causal justification (Wysocki et al., 2022)1
One should adjust for



When all confounding paths between X and Y are successfully adjusted
Depends on causal assumptions
When some confounders are not measured, estimated effects are biased
When wrong variables are adjusted, estimated effects are biased
Do not blindly adjust/control for any variable!

Vaccine → Antibody → Symptom Severity
If adjust for Antibody, may falsely conclude vaccine has no effect
General rule of thumb: if interested in the total effect of X, do not adjust for variables that are potential consequences of X
Draw a DAG to identify variables on the confounding path
| Dept | App_Male | Admit_Male | Percent_Male | App_Female | Admit_Female | Percent_Female |
|---|---|---|---|---|---|---|
| A | 825 | 512 | 62.1 | 108 | 89 | 82.41 |
| B | 560 | 353 | 63.0 | 25 | 17 | 68.00 |
| C | 325 | 120 | 36.9 | 593 | 202 | 34.06 |
| D | 417 | 138 | 33.1 | 375 | 131 | 34.93 |
| E | 191 | 53 | 27.7 | 393 | 94 | 23.92 |
| F | 373 | 22 | 5.9 | 341 | 24 | 7.04 |
| Total | 2691 | 1198 | 44.5 | 1835 | 557 | 30.35 |
m1 <- glm(cbind(Admit, App - Admit) ~ Gender, data = berkeley_admit, family = binomial("logit"))summary(m1)
...># Coefficients:># Estimate Std. Error z value Pr(>|z|) ># (Intercept) -0.2201 0.0388 -5.68 1.4e-08 ***># GenderFemale -0.6104 0.0639 -9.55 < 2e-16 ***># ---># Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1...
berkeley_admit <- berkeley_admit |> group_by(Dept) |> mutate(Gender_cm = App[2] / sum(App))m2 <- glmer(cbind(Admit, App - Admit) ~ Gender + Gender_cm + (Gender | Dept), data = berkeley_admit, family = binomial("logit"))summary(m2)
...># Random effects:># Groups Name Variance Std.Dev. Corr ># Dept (Intercept) 0.743 0.862 ># GenderFemale 0.113 0.336 -0.14># Number of obs: 12, groups: Dept, 6># ># Fixed effects:># Estimate Std. Error z value Pr(>|z|)># (Intercept) 0.613 1.058 0.58 0.56># GenderFemale 0.169 0.172 0.98 0.33># Gender_cm -3.155 2.504 -1.26 0.21...For level-1 X,
including cluster means of X adjusts for differences in X due to cluster-level confounders

Mediation analysis
mediation packagePropensity score
Instrumental variables (IVs)
plm package can perform IV estimation using the so-called Hausman-Taylor estimatorCausal discovery tools
pcalg packageDefine causal effect from a causal inference framework
Describe what a confounder is using a directed acyclic graph (DAG)
Explain how randomized experiments control for confounders
Explain when and how statistical adjustment can potentially remove confounding
Explain how including cluster means can remove confounders at level 2
Keyboard shortcuts
| ↑, ←, Pg Up, k | Go to previous slide |
| ↓, →, Pg Dn, Space, j | Go to next slide |
| Home | Go to first slide |
| End | Go to last slide |
| Number + Return | Go to specific slide |
| b / m / f | Toggle blackout / mirrored / fullscreen mode |
| c | Clone slideshow |
| p | Toggle presenter mode |
| t | Restart the presentation timer |
| ?, h | Toggle this help |
| Esc | Back to slideshow |