DAGs intro, Epidemiology 8h Hein Stigum

advertisement
DAGs intro,
Epidemiology 8h
DAG=Directed Acyclic Graph
Hein Stigum
http://folk.uio.no/heins/
courses
May-16
H.S.
1
Agenda
• DAG concepts
– Causal thinking, Paths
• Analyzing DAGs
– Examples
• DAGs and stat/epi phenomena
–
–
–
–
–
Exercises
Selection bias
Mediation
Time dependent confounding
Effects of adjustments
Drawing DAGs
• Limitations, problems
May-16
H.S.
2
Background
• Potential outcomes:
Neyman, 1923
• Causal path diagrams:
Wright,
1920
• Causal DAGs:
Pearl,
2000
May-16
H.S.
3
Regression purpose
• Prediction models
DAGs are of no interrest
– Predict the outcome from the covariates
– Ex: Air pollution from distance to roads
• Estimation models
DAGs are important
– Estimate effect of exposure on outcome
– Ex: Smokers have RR=20 for lung cancer
May-16
H.S.
4
Why causal graphs?
• Estimate effect of exposure on disease
• Problem
– Association measures are biased
• Causal graphs help:
– Understanding
• Confounding, mediation, selection bias
– Analysis
• Adjust or not
– Discussion
• Precise statement of prior assumptions
May-16
H.S.
5
Causal versus casual
CONCEPTS
(Rothman et al. 2008; Veieroed et al. 2012
May-16
H.S.
6
god-DAG
Causal Graph:
Node = variable
Arrow = cause
E=exposure, D=disease
DAG=Directed Acyclic Graph
Read of the DAG:
Causality
= arrow
Association
= path
Independency = no path
Estimations:
E-D association has two parts:
ED
causal effect
keep open
ECUD bias
try to close
Conditioning (Adjusting): E[C]UD
Time 
May-16
H.S.
7
Association
and
Cause
Association
3
possible
causal
Association
3 possible causal structures
structures
3 possible causal structure
Association
1
1
Yellow
Yellow
fingers
fingers
Lung
Lung
cancer
cancer
Cause
Cause
(reverse cause)
E
Yellow
Yellow
fingers
fingers
Smoke
Smoke
D
Lung
Lung
cancer
cancer
2
2
Yellow
Yellow
fingers
fingers
Confounder
Confounder
Lung
Lung
cancer
cancer
U
U
3
3
Yellow
Yellow
fingers
fingers
Collider
Collider
Lung
Lung
cancer
cancer
+ more complicated structures
May-16
H.S.
8
Confounder idea
A common cause
Smoking
+
Adjust for smoking
Smoking
+
Yellow fingers
Lung cancer
+
Yellow fingers
+
Lung cancer
+
• A confounder induces an association between its effects
• Conditioning on a confounder removes the association
• Condition = (restrict, stratify, adjust)
• Paths
• Simplest form
•
Causal confounding, (exception: see outcome dependent selection)
May-16
H.S.
9
Collider idea
Two causes for selection to study
Selected
+
Yellow fingers
Selected subjects
Selected
+
Lung cancer
+
+
Yellow fingers
Lung cancer
- or
+ and
• Conditioning on a collider induces an association
between its causes
• “And” and “or” selection leads to different bias
•
Paths
• Simplest form
May-16
H.S.
10
Mediator
M
• Have found a cause (E)
• How does it work?
– Mediator (M)
E
direct effect
D
– Paths
𝑇𝑜𝑡𝑎𝑙 𝑒𝑓𝑓𝑒𝑐𝑡 = 𝑖𝑛𝑑𝑖𝑟𝑒𝑐𝑡 + 𝑑𝑖𝑟𝑒𝑐𝑡
𝑖𝑛𝑑𝑖𝑟𝑒𝑐𝑡
𝑀𝑒𝑑𝑖𝑎𝑡𝑒𝑑 𝑝𝑟𝑜𝑝𝑜𝑟𝑡𝑖𝑜𝑛 =
𝑡𝑜𝑡𝑎𝑙
Use ordinary regression methods if:
linear model and
no E-M interaction.
Otherwise, need new methods
May-16
H.S.
11
Concepts: Summing up
Associations visible in data. Causal structure from outside the data.
DAG: no arrow means independence
E
D
Cause
M
E
D
Cause with Mediator
C
E
D
Cause with Confounder
D
Cause with Collider
K
E
May-16
H.S.
12
Causal thinking in analyses
May-16
H.S.
13
Aims in papers
• Standard aim (in introduction)
– “We what to estimate the association between E and D”
• Problems
– Imprecise
– Why adjust
many E-D association
gives no rationale for adjusting
• Solution
– Be bold:
• “We what to estimate the effect of E on D”
– Or more realistic:
• “We what to estimate the association closest to the
effect of E on D ”
May-16
H.S.
14
Regression before DAGs
Use statistical criteria
for variable selection
Risk factors for D:
Variable
OR
E
2.0
C
1.2
Comments
Surprisingly low association
Association
Both can be
misleading!
C
E
May-16
Report all variables in
the model as equals
D
H.S.
15
Statistical criteria for variable selection
C
E
D
- Want the effect of E on D (E precedes D)
- Observe the two associations C-E and C-D
- Assume statistical criteria dictates adjusting for C
(likelihood ratio, Akaike (赤池 弘次) or 10% change in estimate)
The undirected graph above is compatible with three DAGs:
C
C
E
D
Confounder
1. Adjust
Conclusion:
E
C
D
Mediator
2. Direct: adjust
3. Total: not adjust
E
D
Collider
4. Not adjust
The data driven method is correct in 2 out of 4 situations
Need information from outside the data to do a proper analysis
DAGs variable selection: close all non-causal paths
May-16
H.S.
16
Reporting variable as equals:
Association versus causation
Use statistical criteria
for variable selection
Risk factors for D:
Variable
OR
E
2.0
C
1.2
Comments
Surprisingly low association
Association
Causation
C
C
E
D
Symmetrical
C is a confounder for E-D
E is a confounder for C-D
E
Report all variables in
the model as equals
Base adjustments
on a DAG
Report only
the E-effect
D
or use different models
for each variable
Directional
C is a confounder for ED
E is a mediator for CD
Westreich & Greenland 2013
May-16
H.S.
17
Exercise: report variables as equals?
Risk factors for Fractures
Comments (surprises)
Interpret as effect of:
Physical activity 1.2
Protective in other studies?
Obesity
1.0
No effect?
Diabetes adjusted for all other vars.
Phy. act. adjusted for all other vars.
Obesity adjusted for all other vars.
Bone density
0.8
Variable
OR
Diabetes 2
2.0
Bone d.
adjusted for all other vars.
P
physical activity
D
E
fractures
diabetes 2
O
B
obesity bone density
May-16
1. P is a confounder for E→D, but is E
a confounder for P→D?
2. Which effects are reported correctly
in the table?
5 min
H.S.
18
Exercise: Stratify or not
Want the effect of action(A, exposure/treatment) on disease (D). Have stratified on C.
1. Make a guess at the population effect of A on D
2. Calculate the population effect of A on D
3. What is the correct analysis (and RR)? OBS several answers possible!
Population
D
1
A
1
0
C=0
D
sum
risk
210
A
0
1
0
RR=
C=1
D
1
0
sum
risk
10
70
90
330
100
400
500
0.10
0.18
RR=
0.6
40% less disease if treated
Population = crude
A
May-16
1
A0
1
0
sum
risk
200
80
200
20
400
100
500
0.50
0.80
RR=
0.6
40% less disease if treated
Stratified = adjusted for C
C
D
10 min
H.S.
Hernan et al. 2011
19
Causal thinking: Summing up
• Make a clear aim
• Data driven analyses do not work Need causal information
from outside the data. (Data driven prediction models OK though).
• Reporting table of adjusted associations is misleading.
• Simpson’s paradox: causal information resolves the paradox.
May-16
H.S.
20
The Path of the Righteous
Paths
May-16
H.S.
21
Path definitions
Path: any trail from E to D (without repeating itself)
Type: causal, non-causal
State: open, closed
1
2
3
4
Four paths:
Path
ED
EMD
ECD
EKD
Goal:
Keep causal paths of interest open
Close all non-causal paths
May-16
H.S.
22
Four rules
1. Causal path: ED
(all arrows in the same direction) otherwise non-causal
Before conditioning:
2. Closed path: K
(closed at a collider, otherwise open)
Conditioning on:
3. a non-collider closes: [M] or [C]
4. a collider opens:
[K]
(or a descendant of a collider)
May-16
H.S.
23
ANALYZING DAGs
May-16
H.S.
24
Confounding examples
May-16
H.S.
25
Vitamin and birth defects
1. Is there a bias in the crude E-D effect?
2. Should we adjust for C?
3. What happens if age also has a direct effect on D?
Unconditional
Path
1 ED
2 ECUD
Type
Status
Causal
Open
Non-causal Open
Conditioning on C
Path
1 ED
2 EC]UD
3 EC] D
Type
Causal
Non-causal
Non-causal
May-16
May-16
Status
Open
Closed
Closed
Bias
No bias
H.S.
This is an example
of confounding
Question:
Is U a confounder?
26
Exercise: Physical activity and
Coronary Heart Disease (CHD)
We want the total effect of Physical
Activity on CHD.
1. Write down the paths.
2. Are they causal/non-causal,
open/closed?
3. What should we adjust for?
5 minutes
May-16
H.S.
27
Direct and indirect effects
Intermediate variables
May-16
H.S.
28
Exercise: Tea and depression
1. Write down the paths.
O
coffee
E
tea
2. You want the total effect
of tea on depression. What
would you adjust for?
C
caffeine
D
depression
3. You want the direct effect
of tea on depression. What
would you adjust for?
4. Is caffeine an intermediate
variable or a variable on a
confounder path?
10 minutes
Hintikka et al. 2005
May-16
H.S.
29
Exercise: Statin and CHD
C
cholesterol
E
U
lifestyle
D
CHD
statin
1. Write down the paths.
2. You want the total effect of
statin on CHD. What would
you adjust for?
3. If lifestyle is unmeasured, can
we estimate the direct effect of
statin on CHD (not mediated
through cholesterol)?
4. Is cholesterol an intermediate
variable or a collider?
10 minutes
May-16
H.S.
30
Confounder, collider and mediator
Mixed
May-16
H.S.
31
Diabetes and Fractures
We want the total effect of
Diabetes (type 2) on fractures
Conditional
Unconditional
Path
Path
11 E→D
E→D
22 E→F→D
E→F→D
33 E→B→D
E→B→D
44 E←[V]→B→D
E←V→B→D
55 E←[P]→B→D
E←P→B→D
May-16
Type
Type
Causal
Causal
Causal
Causal
Causal
Causal
Non-causal
Non-causal
Non-causal
Non-causal
Status
Status
Open
Open
Open
Open
Open
Open
Closed
Open
Closed
Open
H.S.
Questions:
Mediators
Paths ←→?
More paths?
B a collider?
V and P ind?
Confounders
32
Three concepts
Selection bias
May-16
H.S.
33
Selection bias: concept 1
Simple version
• “Selected different from unselected”
• Prevalence (D)
Old have lower prevalence than young
Old respond less to survey
 Selection bias: prevalence overestimated
• Effect (E→D)
Old have lower effect of E than young
Old respond less to survey
 Selection bias: effect of E overestimated
May-16
H.S.
34
Selection bias: concept 1
“Selected different from unselected”
Paths
smokeCHD
S
age
smoke
CHD
Age
Young
Old
All
Type
Causal
Status
Open
Population RRsmoke Selected RRsmoke
50 %
4.0
75 %
4.0
50 %
2.0
25 %
2.0
3.0
3.5
Normally, selection variables unknown
Name:
interaction based?
May-16
• Properties:
- Need smoke-age interaction
- Cannot be adjusted for, but stratum effects OK
- True RR=weighted average of stratum effects
- RR in “natural” range (2.0-4.0)
- Scale dependent
H.S.
35
Selection bias: concept 2
Simple version
• “Distorted E-D distributions”
• DAG
Collider bias
• Words
Selection by sex and/or age
Distorted sex-age distribution
Old have more disease
Men are more exposed
 Distorted E - D distribution
May-16
H.S.
36
Selection bias: concept 2
“Distorted E-D distributions”
S
sex
age
smoke
CHD
Paths
Type
Status
smokeCHD
Causal
Open
smokesexSageCHD Non-causal Open
Properties:
Name:
Collider stratification bias
Open non-causal path (collider)
Does not need interaction
Can be adjusted for (sex or age)
Not in “natural” range (“surprising bias”)
Selection bias types:
Berkson’s, loss to follow up, nonresponse, self-selection, healthy worker
Hernan et al, A structural approach to selection bias, Epidemiology 2004
May-16
H.S.
37
22
1) “Exclusive or” selection
S=5%
-0.5
0.5
0.0
-1
00
IQ
11
S=95%
S=95%
-2
S=5%
-2
-2
May-16
-1-1
0 0
EMF
H.S.
1
1
2
2
38
Selection bias: concept 3
S
Outcome dependent selection
D
E
Selection into the study based on D.
Get bias among selected.
U
4
5
Explanation:
• Always have exogenous U.
0.6
2
D
3
• D is a collider on E→D←U, S is a
descendant of collider D.
1
1.0
0
• Conditioning on (a descendant of) a
collider opens the E→D←U path,
and U becomes associated with E.
0.6
0
2
3
E
• U now acts a confounder for E→D.
Selected if D<= 2.5 + 0.0*E
Selection depends on:
Strength of E→D. Strength of U→D
Unmatched Case-Control
Example of non-causal confounding
May-16
1
H.S.
39
Exercise: Dust and COPD
Chronic Obstructive Pulmonary Disease
D0
S
cur. worker
H
health
diseases
E
E0
D
COPD
prior dust cur. dust
COPD risks:
Dust
low
Health
good
poor
high
5 % 10 %
10 % 20 %
1. Calculate the RR of dust on COPD
in good and poor health groups.
2. Write down the paths for the effect
of E on D. E0 and D0 are unknown
(past) measures.
3. What would you adjust for?
4. Suppose the crude effect of dust on
COPD is RR=0.7 and the true
RR=2. What do you call this bias?
5. Could the concept 1 (interaction
based) selection bias work here?
10 minutes
May-16
H.S.
40
Convenience sample, homogenous sample
H
1. Convenience:
Conduct the study among
hospital patients?
hospital
E
diabetes
Conditional
Unconditional
Path
1 E→D
2 E→H←D
E→[H]←D
D
2. Homogeneous sample:
Population data,
exclude hospital patients?
fractures
Type
Causal
Non-causal
Non-Causal
Status
Open
Closed
Open
Collider, selection bias
Collider stratification bias: at least on stratum is biased
May-16
H.S.
41
Selection bias summing up
Concept 1
Concept 2
S
S
S
age
smoke
Concept 3
CHD
sex
age
smoke
smoke
CHD
CHD
U
Selected differ from
unselected in E-D
effects
Selected differ from
unselected in E-D
distributions
Selected differ from
unselected in E-D
distributions
Interaction based
selection
Collider stratification
bias
Outcome dependent
selection
“natural” effects
“surprising” effects
variance dependent
Report stratum effects
Adjust
IPW
Quite different concepts
May-16
H.S.
42
MEDIATION ANALYSIS
Hafeman and Schwartz 2009;
Lange and Hansen 2011;
Pearl 2012;
Robins and Greenland 1992;
VanderWeele 2009, 2014
May-16
H.S.
43
Why mediation analysis?
• Have found a cause
• How does it work?
M
A
May-16
direct effect
𝑇𝑜𝑡𝑎𝑙 𝑒𝑓𝑓𝑒𝑐𝑡 = 𝑖𝑛𝑑𝑖𝑟𝑒𝑐𝑡 + 𝑑𝑖𝑟𝑒𝑐𝑡
Y
𝑖𝑛𝑑𝑖𝑟𝑒𝑐𝑡
𝑀𝑒𝑑𝑖𝑎𝑡𝑒𝑑 𝑝𝑟𝑜𝑝𝑜𝑟𝑡𝑖𝑜𝑛 =
𝑡𝑜𝑡𝑎𝑙
H.S.
44
Counterfactual causal effect
• Two possible outcome variables
– Outcome if treated:
– Outcome if untreated:
Y1
Y0
Counterfactuals
Potential outcomes
• Causal effect
– Individual:
– Average:
Y1i-Y0i
E(Y1)-E(Y0)
or other effect measures
Fundamental problem: either Y1 or Y0 is missing
Hernan 2004
May-16
H.S.
45
Classic approach: controlled
effect
May-16
H.S.
46
Controlled Direct effect
Direct effect:
Effect of statin on CHD
“for the same cholesterol”
Fixed M
Fixed M: controlled direct effect
CDE=E(Y|A=1,M=m) - E(Y|A=0,M=m)
m
M
cholesterol
A
statin
Y
CHD
Problems
1. Conceptual: Can we fix cholesterol levels?
2. Technical: A*M Interaction?
3. (Technical: non-linear models?)
0/1
Solution?
Robins and Greenland 1992; VanderWeele 2009
May-16
H.S.
47
New approach: natural effect
May-16
H.S.
48
Natural Direct effect
Direct effect:
Effect of statin on CHD
“for the same cholesterol”
M1
M0
M
statin
0/1
May-16
A set to 0
M0
Natural Direct Effect: Keep M at M0
cholesterol
A
A set to 1
M0
Y
CHD
𝑁𝐷𝐸 = 𝐸 𝑌1,𝑀0 − 𝐸 𝑌0,𝑀0
Takes care of the 3 earlier problems:
1. Don’t need to fix M=m
2. OK for interactions
3. (OK for non-linear models) in 4 slides
H.S.
49
Time Dependent Confounding
May-16
H.S.
50
Motivating example
Population:
Exposure:
Alcohol use at two time points
Mediator/confounder: HDL cholesterol
Outcome:
Coronary Heart Disease
HDL
A1
A2
CHD
Time Dependent Confounder:
a confounder (HDL)
that depends on
earlier exposure (A1)
Estimate: Joint effect of alcohol use (or effect of A1 and A2)
Simplified DAG, several variables and arrows missing
Could have HDL1 and HDL2
Common situation in patient-doctor follow up!
May-16
HS
51
Alcohol and CHD
DAG
Process graph
HDL
HDL
A1
A2
CHD
Alcohol
CHD
HDL is a confounder
HDL is a mediator
The process graph is simpler but less specific
Ordinary adjustment does not work
Must use Inverse Probability of Treatment Weighting, IPTW
May-16
HS
52
Patient-Doctor
prognostic
factor
treatment
May-16
Treatment regulated by
level of prognostic factor.
Both affect later disease.
disease
HS
53
Statins, cholesterol and CHD
cholesterol
statin
May-16
U
Variant 1 and 2 combined
CHD
U=unmeasured common factor,
lifestyle: diet, exercise
HS
54
Exercise: TimeDependentConfounding, Variants
Variant 1:
C2
E1
E2
D
Variant 1:
a) Show the paths from E1 to D
b) Show the paths from E2 to D
c) Can you estimate the joint effect (E1+E2)
in one ordinary regression model?
Variant 2:
E1
C2
U
E2
D
May have both combined
May-16
Variant 2:
If time, do the same for variant 2
10 min
HS
55
Four methods,
focus on just one: MSM using IPTW
Analysis under Time Dependent Confounding
May-16
HS
56
Inverse Probability of Treatment Weighting
C
Simple point treatment (exposure)
E
C
1
0
D
Focus on probability of being exposed (binary)
Subjects
Probabilities
Weights
E
E
E
1
0
300
200
100
400
sum
400
600
1000
"Subjects"
N*w
C
1
0
E
N*w
1
0
400
600
1001
400
600
1000
May-16
sum
800
1200
2000
𝑃(𝐸)
1
C
1
0
0.75
0.33
𝑃(𝐸)
sum
0
0.25 1
0.67 1
1/𝑃(𝐸) 1/𝑃(𝐸)
C
1
0
1
0
1.3
3.0
4.0
1.5
Propensity
scores


C
E
D
Weighted analysis!
HS
57
Inverse Probability of Treatment Weighting, Exercise
Sample:
200 females,
800 males,
Sex
100 use Paracet
200 use Paracet
Paracet
D
1. Calculate the risk of Paracet use for each sex.
2. Calculate the RR of Paracet use for females versus males
3. Do an inverse probability of treatment weighting for Paracet.
4. Calculate the RR of Paracet use for females versus males in the
reweighted pseudo data
5. Explain the results in the DAG
8 min
May-16
HS
58
Inverse Probability of Treatment Weighting
Time varying treatment (exposure)
Weights:
C1
C2
E1
E2
D
w1
w2
Weight at E2:
Weight for the entire exposure and covariate history
up to time 2
E is treatment, D is disease
C is a prognostic factor
Weight by w1*w2
Ordinary
weights:
Stabilized
weights:
May-16
𝑡
𝑤 𝑡 =
𝑘=1
𝑡
𝑤𝑠 𝑡 =
𝑘=1
Time points t1 and t2
1
𝑃(exposure at k|cov. and exp. up to k)
Vary a lot
𝑃(exposure at k|exposure up to k)
𝑃(exposure at k|cov. and exp. up to k)
Vary less
Cole and Hernan 2008. Veieroed, Lydersen et al. 2012. Daniel, Cousens et al. 2013
HS
59
Marginal Structural Model
C1
E1
C2
ws
E2
DAG for the reweighted pseudo data
D
MSM:
The expected value of a counterfactual outcome D
under a hypothetical exposure 𝑒=(e1,e2):
𝐸 𝐷𝑒 = 𝛼0 + 𝛼1 𝑒1 + 𝛼2 𝑒2
Joint effect = 𝐸 𝐷1 − 𝐸 𝐷0
May-16
Veieroed, Lydersen et al. 2012. Daniel, Cousens et al. 2013. Rothman, Greenland et al. 2008
HS
60
MSM in Stata
* Probability of E1
regress E1 C1
C1
C2
E1
E2
predict p1
replace p1=1-p1 if E1==0
D
* Probability of E2
regress E2 E1 C1 C2
predict p2
replace p2=1-p2 if E2==0
𝑡
* Weights
generate w=1/(p1*p2)
𝑤 𝑡 =
𝑘=1
1
𝑃(exposure at k|cov. and exp. up to k)
* MSM
𝐸 𝐷𝑒 = 𝛼0 + 𝛼1 𝑒1 + 𝛼2 𝑒2
regress D E1 E2 [pw=w]
Easy-peasy!
May-16
HS
61
Time dependent confounding,
Summary
• Occurrence
– is not rare
– depends on the data generating process
• Analysis
– Use Marginal Structural Models (MSM)
– solved with Inverse Probability of Treatment
Weighting (IPTW)
May-16
HS
62
Effects of adjustment
May-16
H.S.
63
Effects of adjustment
A
E
C
B
What variables should we adjust for?
D
What are the effects of adjustment?
Variable Adjust
A
B
C
no
maybe
yes
Bias
Precision
?
reduce precision (collinearity)
no
improve precision (model dependent)
remove confounding ?
Effects of adjustment: Precision
B
Should we adjust for B?
DAG: no bias from B, need not adjust
E
D
May include B to improve precision, depends on model!
Linear regression
Logistic regression
crude
crude
adjusted
adjusted
.9
1
1.1
Effect of E on D with 95% CI
1.2
1.4
1.6
Effect of E on D with 95% CI
Including B: better precision
Including B: worse precision
OR not collapsible
Robinson and Jewell 1991; Xing and Xing 2010
May-16
H.S.
65
Non-collapsibility of the odds
ratio
May-16
H.S.
66
Non-collapsibility of the OR
Population
D
C
OR=10
OR=3.6
OR=5.1
A
A
D
1
0
1
0
sum
470
1 775
530
7 225
1 000
9 000
10 000
OR=
3.6
C=0
A
0
D
1
0
sum
105
225
395
4 275
500
4 500
5 000
OR=
5.1
May-16
0.89
0.25
C=1
D
1
odds
odds
0.27
0.05
1
A0
H.S.
1
0
sum
365
1 550
135
2 950
500
4 500
5 000
OR=
5.1
odds
2.70
0.53
67
Non-collapsibility of the OR
C
OR=10
E
D
Non-collapsibility depends on frequency of D
Logistic regression
crude
adjusted
D=22% :
Not collapsible
crude
adjusted
D=6% :
Appr. collapsible
crude
adjusted
D=1% :
Collapsible
2
May-16
3
4
5
OR for E on D
H.S.
6 7
68
Summing up so far
A
• Adjustment
C
E
– Should not adjust for A
– May adjust for B
– Should adjust for C
B
D
(reduce precision)
(improve precision)
(remove confounding)
• Collapsibility
– Collapsible measures:
• Risk Difference (RD), Rate Difference, Risk Ratio (RR)
– Non-collapsible measures:
• Odds Ratio (OR), Rate Ratio (HRR)
• Adjusting for B changes OR (and the HRR) but not due
to confounding
May-16
H.S.
69
METHODS TO REMOVE
CONFOUNDING
May-16
H.S.
70
Methods to remove confounding
Method
Action
DAG effect
C
Condition: Restrict, Stratify, Adjust
Close path
E
D
C
Cohort matching, Propensity Score
Inverse Probability Treatment Weighting
Remove CE arrow
E
D
C
Case-Control matching?
Other methods?
May-16
Remove CD arrow
H.S.
E
D
71
Matching:
Cohort vs Case-Control
May-16
H.S.
72
Matching in cohort, binary E
Matching:
For every exposed person with a value of C,
find an unexposed person with the same value of C
S
E
 selected based on E and C
 E independent of C after matching
 All open paths between C and E must
C→E
C→[S]←E
C
D
C
sum to “null”
E
Cohort matching removes confounding
D
Unfaithful DAG
Cohort matching is not common,
except in propensity score matching
May-16
H.S.
Mansournia et al. 2013; Shahar and Shahar 2012
73
Matching in Case Control, binary D
C
Matching:
For every case with a value of C,
find a control with the same value of C
E
 selected based on D and C
 D independent of C after matching
 All open paths between C and D must
C→[S]←D
D
C
C→D
sum to “null”
C→E→D
S
E
S
D
Case-Control matching does not removes confounding,
unless E→D=0 (or C→E=0)
 must adjust for C in all analyses
Case-Control matching common, may improve precision
May-16
H.S.
(Mansournia et al. 2013; Shahar and Shahar 2012
74
Drawing DAGs
May-16
H.S.
75
Technical note on drawing DAGs
• Drawing tools in Word (Add>Figure)
• Use Dia
• Use DAGitty
• Hand-drawn figure.
May-16
H.S.
76
Direction of arrow
C
Smoking
?
E
D
Phys. Act.
Diabetes 2
H
C
Health con.
Smoking
E
D
Phys. Act.
Diabetes 2
May-16
Does physical activity reduce smoking,
or
does smoking reduce physical activity?
Maybe an other variable
(health consciousness)
is causing both?
H.S.
77
Drawing a causal DAG
Start: E and D
add: [S]
add: C-s
1 exposure, 1 disease
variables conditioned by design
all common causes of 2 or more
variables in the DAG
C
V
E
D
C must be included
V may be excluded
M may be excluded
K may be excluded
common cause
exogenous
mediator
unless we condition
M
K
May-16
H.S.
78
Exercise: Drawing survivor bias
1. We what to study the effect of exposure early in life (E)
on disease (D) later in life.
2. Exposure (E) decreases survival (S) in the period
before D (deaths from other causes than D).
3. A risk factor (R) reduces survival (S) in the period before D.
4. The risk factor (R) increases disease (D).
5. Only survivors are available for analysis (look at Collider
idea).
Draw and analyze the DAG
10 minutes
May-16
H.S.
79
Free program to draw and analyze DAGS
DAGitty
May-16
H.S.
80
DAGitty background
• DAGitty
– Draw
– Analyze
– Test
DAGs
DAGs
DAGs
• Web page
– http://www.dagitty.net/
– Run or download
May-16
HS
81
Interface
May-16
HS
82
Draw model
• Draw new model
– Model>New model, Exposure, Outcome
• New variables, connect, rename
–
–
–
–
n
c
r
d
new variable
(or double click)
connect
(hit c over V1 and over V2 to connect)
rename
delete
• Status (toggle on/off)
–
–
–
–
May-16
e
o
u
a
exposure
outcome
unobserved
adjusted
HS
83
Export DAG
• Export to Word or PowerPoint
– “Zoom” the DAGitty drawing first (Ctrl-roll)
– Use “Snipping tool” or
– use Model>Export as PDF
Without zooming
May-16
With zooming
HS
84
Model code
Variable
Age 1
Birth%20defects O
Obesity 1
Vitamin E
@
@
@
@
x
0.151,
0.468,
0.470,
0.145,
y
0.840
1.001
0.845
1.001
0
x
Arrow list
Age Obesity Vitamin
Obesity Birth%20defects
Vitamin Birth%20defects
y
May change the x and y values to align the variables
May-16
HS
85
Changed model code
Aligning x and y coordinates (no space after ,)
Age 1
Birth%20defects O
Obesity 1
Vitamin E
@0.1,0.8
@0.5,1.0
@0.5,0.8
@0.1,1.0
0.1
0
0.5
0.8
Age Obesity Vitamin
Obesity Birth%20defects
Vitamin Birth%20defects
1.0
Copy, paste and Update DAG
May-16
HS
y
86
x
Exercises
May-16
HS
87
Excercise
1. Draw the Vitamin-Birth defects DAG
1. Use Obesity as an observed variable.
1. Interpret the “Causal effect identification”
2. Interpret the “Testable implications”
2. Add arrow from Age to Birth defects
1. Interpret the “Causal effect identification”
2. Interpret the “Testable implications”
3. Make obesity an unobserved variable
1. Interpret the “Causal effect identification”
2. Interpret the “Testable implications”
May-16
HS
88
Excercise
1. Draw the Statin-CHD DAG
Use Lifestyle as an unobserved variable.
1. Interpret the “Causal effect ident.” for total effects
2. Interpret the “Causal effect ident.” for direct effects
3. Interpret the “Testable implications”
May-16
HS
89
Real world examples
May-16
H.S.
90
Endurance training and Atrial fibrillation
Tobacco
Socioeconomic
Status **
Endurance
training
Cardiovascular
factors *
Alcohol
consumption
BMI
Diabetes
Genetic disposition
Atrial
fibrillation
Hyperhyreosis
Health ***
consciousness
Height
Gender
Long-distance
racing
Several arrows missing!
Age
*Hypertension, heart disease, high cholesterol
** Socioeconomic status: Education, marital status
*** Unmeasured factors
(Blue: Mediators, red: confounders, violet: colliders)
Myrstad et al. 2014b
Randomized experiments
Mendelian randomization
May-16
H.S.
92
Strength of arrow, randomization
E
Not
deterministic
C1
D
C2
C1, C2, C3 exogenous
C3
C
R
full
compliance
deterministic
E
Full compliance
 no E-D confounding
D
U
R
not full
compliance
E
D
Sub analysis conditioning on E
may lead to bias
May-16
Not full compliance
 weak E-D confounding
but R-D is unconfounded
Path
1 RED
2 REUD
H.S.
Type
Status
Causal
open
non-causal closed
93
Randomized experiments
C
E
Observational study
D
C
R
E
D
U
R c E IVe
ITTe
D
Randomized experiment with full compliance
R= randomized treatment
E= actual treatment.
R=E
Randomized experiment with less than full
compliance (c)
If linear model: ITTe=c*IVe, c<1
IntentionToTreat effect:
effect of R on D (unconfounded)
population
PerProtocol:
crude
effect of E on D (confounded by U)
InstrumentalVariable effect: adjusted effect of E on D (if c is known, 2SLS) individual
May-16
H.S.
94
RCT exercise
E
R
+
-
+
85
0
85
15
100
115
D
R
+
-
+
43
63
106
57
37
94
D
E
+
-
+
32
74
106
53
41
94
N
Risk
100
100
200
0.85
0.00
N
Risk
1.
100
100
0.43
0.63
Calculate the compliance (c) as a
risk difference from the table.
2.
Calculate the intention to treat effect
(ITTe) as a risk difference.
N
Risk
3.
85
115
0.38
0.64
Calculate the per-protocol effect (PP)
as a risk difference.
4.
Calculate the instrumental variable
effect (IVe).
5.
Explain the results in words.
R+ means randomized to treatment,
E+ means treated and D+ means getting disease.
0.85 is the risk of treatment for R+ subjects,
0.00 is the risk for R- subjects,
the risk difference is the difference between these.
U
0.22
-0.15
R c E
IVe
D
10 minutes
ITTe
May-16
H.S.
95
Mendelian randomization
•
U
Observational study
–
•
Suffers from unmeasured confounding
Randomized trial: 3 conditions
1. R affects E:
2. No direct R-D effect:
3. R and D no common causes:
•
E
D
U
3
balanced, strong effect
R independent of D | E
R
1
E
R independent of U
2
Medelian randomization: 3 conditions
1. G must affect E:
unbalanced, weak  large N
2. No direct G-D effect:
depends on gene function
3. G and D no common causes: Mendel’s 2. law
D
U
3
G
1
E
D
2
Sheehan et al, 2008
May-16
May-16
H.S.
H.S
96
96
Ex: Alcohol and blood pressure
•
U
Observational study
–
–
Alcohol use increases blood pressure
Many ”lifestyle” confounders
A
BP
•
Gene: ALDH2, 2 alleles
–
–
•
2,2 type suffer nausea, headache after alcohol
 low alcohol regardless of lifestyle (U)
40
30
20
10
0
1,1
Medelian randomization
1. Gene ALDH2 is highly associated with alcohol
2. OK, gene function is known
3. Mendel’s 2. law, no ass. to obs. confounders
•
alcohol ml/day
Alcohol use
Result:
–
–
1,2
Genotype
U
3
G
1
2,2
A
BP
2
1,1 type BP +7.4 mmHg
Alcohol increases blood pressure
Chen et al 2008
May-16
May-16
H.S.
H.S
97
97
LIMITATIONS, PROBLEMS AND
EXTENSIONS OF DAGS
May-16
H.S.
98
Limitations and problems of DAGs
• New tool
relevance debated, focus on causality
• Focus on bias
precision also important
• Bias or not
direction and magnitude
• Interaction
scale dependent
• Static
may include time varying variables
• Simplified
infinite causal chain
• Simplified
do not capture reality
May-16
H.S.
99
DAG focus: bias, not precision
C
Should we adjust for C?
DAG: no bias from C, need not adjust
E
D
May include C to improve precision, depends on model!
Linear regression
Logistic regression
crude
crude
adjusted
adjusted
.9
1
1.1
Effect of E on D with 95% CI
1.2
1.4
1.6
Effect of E on D with 95% CI
Including C: better precision
Including C: worse precision
OR not collapsible
Robinson and Jewell 1991; Xing and Xing 2010
May-16
H.S.
100
Signed DAGs and direction of bias
M
+
+
E
D
X Y
Positive or negative bias from confounding by U?
Neg
True
Pos
E→D
on average
Average monotonic effect
+-
for all Y=y
Distributional monotonic effect


U
To find direction of bias, multiply signs:
Need distributional monotonic effects except at each end
Positive bias from this confounding
May-16
H.S.
VanderWeele, Hernan & Robins, 2008
101
Size of bias
from unmeasured U
C
A
Y
U
Assume: Difference in the distribution
of U for two levels for A: a1 ,a0 ,
does not vary with C
Assume: Difference in expected
value of Y for two levels of U : u1 ,u0 ,
does not vary with A and C
γ = 𝐸 𝑌 𝑢1 − 𝐸 𝑌 𝑢0 if linear model
𝛼 = 𝑃 𝑢 𝑎1 − 𝑃 𝑢 𝑎0
γ = 𝐸 𝑌 𝑢1 /𝐸 𝑌 𝑢0
Bias = 𝛼 ∗ 𝛾
Bias =
1+ 𝛾−1 𝑃
1+ 𝛾−1 𝑃
if linear model
𝑢 𝑎1
𝑢 𝑎0
Stata: episens
May-16
if RR model
H.S.
if RR model
VanderWeele & Arah 2011
102
Interaction in DAGs
DAG
Causal pie
Extended DAG
Mechanisms
C
C
D
+
C
=
E C
E
E,C
E
E
C
D
E
Red arrow
=
interaction
Specify scale
VanderWeele and Robins 2007
May-16
H.S.
103
DAGs and time processes
DAGs often static,
but may have time varying A1, A2,…
Want total effect of A-s, Time Dependent Confounding
DAG
Process graph
HDL
A1
A2
HDL
CHD
Alcohol
CHD
The process graph is simpler but less specific
The process graph allows feedback loops
and has a clear time component
Aalen et al. 2012
May-16
HS
104
Infinite causal chain
U
E
D
the
Most paths involving variables back in the chain (U)
will be closed
May-16
H.S.
105
DAGs are simplified
DAGs are models of reality
must be large enough to be realistic,
small enough to be useful
May-16
H.S.
106
Summing up
• Data driven analyses do not work. Need causal information
from outside the data.
• DAGs are intuitive and accurate tools to display that
information.
• Paths show the flow of causality and of bias and guide the
analysis.
• DAGs clarify concepts like confounding and selection bias,
and show that we can adjust for both.
Better discussion based on DAGs
Draw your assumptions
before your conclusions
May-16
H.S.
107
Recommended reading
• Books
–
–
–
–
–
Hernan, M. A. and J. Robins. Causal Inference. Web:
Rothman, K. J., S. Greenland, and T. L. Lash. Modern Epidemiology, 2008.
Morgan and Winship, Counterfactuals and Causal Inference, 2009
Pearl J, Causality – Models, Reasoning and Inference, 2009
Veierød, M.B., Lydersen, S. Laake,P. Medical Statistics. 2012
• Papers
– Greenland, S., J. Pearl, and J. M. Robins. Causal diagrams for epidemiologic
research, Epidemiology 1999
– Hernandez-Diaz, S., E. F. Schisterman, and M. A. Hernan. The birth weight
"paradox" uncovered? Am J Epidemiol 2006
– Hernan, M. A., S. Hernandez-Diaz, and J. M. Robins. A structural approach to
selection bias, Epidemiology 2004
– Berk, R.A. An introduction to selection bias in sociological data, Am Soc R 1983
– Greenland, S. and B. Brumback. An overview of relations among causal modeling
methods, Int J Epidemiol 2002
– Weinberg, C. R. Can DAGs clarify effect modification? Epidemiology 2007
May-16
H.S.
108
References 1
•
Aalen OO, Roysland K, Gran JM, Ledergerber B. 2012. Causality, mediation and time: A dynamic viewpoint. Journal of the Royal Statistical
Society Series A 175:831-861.
•
Chen L, Davey SG, Harbord RM, Lewis SJ. 2008. Alcohol intake and blood pressure: A systematic review implementing a mendelian
randomization approach. PLoS Med 5:e52.
•
Daniel RM, Cousens SN, De Stavola BL, Kenward MG, Sterne JAC. 2013. Methods for dealing with time-dependent confounding. Statistics in
Medicine 32:1584-1618.
•
Greenland S, Schlesselman JJ, Criqui MH. 1987. Re: "The fallacy of employing standardized regression coefficients and correlations as measures
of effect". AJE 125:349-350.
•
Greenland S, Robins JM, Pearl J. 1999. Confounding and collapsibility in causal inference. Statistical Science 14:29-46.
•
Greenland S, Brumback B. 2002. An overview of relations among causal modelling methods. Int J Epidemiol 31:1030-1037.
•
Greenland S, Mansournia MA. 2015. Limitations of individual causal models, causal graphs, and ignorability assumptions, as illustrated by random
confounding and design unfaithfulness. Eur J Epidemiol.
•
Greenland SM, Malcolm; Schlesselman, James J.; Poole, Charles; Morgenstern, Hal. 1991. Standardized regression coefficients: A further critique
and review of some alternatives. Epidemiology 2:6.
•
Hafeman DM, Schwartz S. 2009. Opening the black box: A motivation for the assessment of mediation. International Journal of Epidemiology
38:838-845.
•
Hernan MA, Hernandez-Diaz S, Werler MM, Mitchell AA. 2002. Causal knowledge as a prerequisite for confounding evaluation: An application to
birth defects epidemiology. AJE 155:176-184.
•
Hernan MA, Hernandez-Diaz S, Robins JM. 2004. A structural approach to selection bias. Epidemiology 15:615-625.
•
Hernan MA, Cole SR. 2009. Causal diagrams and measurement bias. AJE 170:959-962.
•
Hernan MA, Clayton D, Keiding N. 2011. The simpson's paradox unraveled. Int J Epidemiol.
•
Hintikka J, Tolmunen T, Honkalampi K, Haatainen K, Koivumaa-Honkanen H, Tanskanen A, et al. 2005. Daily tea drinking is associated with a low
level of depressive symptoms in the finnish general population. European Journal of Epidemiology 20:359-363.
•
Lange T, Hansen JV. 2011. Direct and indirect effects in a survival context. Epidemiology 22:575-581.
•
Mansournia MA, Hernan MA, Greenland S. 2013. Matched designs and causal diagrams. International Journal of Epidemiology 42:860-869.
•
McCaffrey DF, Ridgeway G, Morral AR. 2004. Propensity score estimation with boosted regression for evaluating causal effects in observational
studies. Psychological Methods 9:403-425.
•
Myrstad M, Lochen ML, Graff-Iversen S, Gulsvik AK, Thelle DS, Stigum H, et al. 2014a. Increased risk of atrial fibrillation among elderly norwegian
men with a history of long- term endurance sport practice. Scand J Med Sci Spor 24:E238-E244.
May-16
H.S.
109
References 2
•
Pearl J. 2000. Causality: Models, reasoning, and inference. Cambridge:Cambridge Univeristy Press.
•
Pearl J. 2012. The causal mediation formula-a guide to the assessment of pathways and mechanisms. Prev Sci 13:426-436.
•
Robins JM, Greenland S. 1992. Identifiability and exchangeability for direct and indirect effects. Epidemiology 3:143-155.
•
Robins JM. 2001. Data, design, and background knowledge in etiologic inference. Epidemiology 12:313-320.
•
Robinson LD, Jewell NP. 1991. Some surprising results about covariate adjustment in logistic-regression models. Int Stat Rev
59:227-240.
•
Rothman KJ, Greenland S, Lash TL. 2008. Modern epidemiology. Philadelphia:Lippincott Williams & Wilkins.
•
Shahar E. 2009. Causal diagrams for encoding and evaluation of information bias. Journal of evaluation in clinical practice
15:436-440.
•
Shahar E, Shahar DJ. 2012. Causal diagrams and the logic of matched case-control studies. Clinical epidemiology 4:137-144.
•
Sheehan NA, Didelez V, Burton PR, Tobin MD. 2008. Mendelian randomisation and causal inference in observational
epidemiology. PLoS Med 5:e177.
•
Textor J, Hardt J, Knuppel S. 2011. Dagitty a graphical tool for analyzing causal diagrams. Epidemiology 22:745-745.
•
VanderWeele TJ, Robins JM. 2007. Directed acyclic graphs, sufficient causes, and the properties of conditioning on a common
effect. AJE 166:1096-1104.
•
VanderWeele TJ, Hernan MA, Robins JM. 2008. Causal directed acyclic graphs and the direction of unmeasured confounding
bias. Epidemiology 19:720-728.
•
VanderWeele TJ. 2009. Mediation and mechanism. Eur J Epidemiol 24:217-224.
•
VanderWeele TJ, Arah OA. 2011. Bias formulas for sensitivity analysis of unmeasured confounding for general outcomes,
treatments, and confounders. Epidemiology 22:42-52.
•
VanderWeele TJ, Hernan MA. 2012. Results on differential and dependent measurement error of the exposure and the outcome
using signed directed acyclic graphs. AJE 175:1303-1310.
•
VanderWeele TJ. 2014. A unification of mediation and interaction: A 4-way decomposition. Epidemiology 25:749-761.
•
Veieroed M, Lydersen S, Laake P. 2012. Medical statistics in clinical and epidemiological research. Oslo:Gyldendal Akademisk.
•
Westreich D, Greenland S. 2013. The table 2 fallacy: Presenting and interpreting confounder and modifier coefficients. AJE
177:292-298.
•
Xing C, Xing GA. 2010. Adjusting for covariates in logistic regression models. Genet Epidemiol 34:937-937.
May-16
H.S.
110
Download