Presentation is loading. Please wait.

Presentation is loading. Please wait.

DAGs intro with exercises 3h DirectedAcyclicGraph

Similar presentations


Presentation on theme: "DAGs intro with exercises 3h DirectedAcyclicGraph"— Presentation transcript:

1 DAGs intro with exercises 3h DirectedAcyclicGraph
Åpne «DAGs intro…, Answers» samtidig I KES: 09:00 09:45 1 DAGs 10:00 10:45 1 DAGs 11:00 11:45 1 DAGs 11:45 12:30 1 Lunch 12:30 13:15 1 Measures 13:30 14:15 1 Design 14:30 15:15 1 Design 15:30 16: Design Hein Stigum courses Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. H.S. H.S. 1 1 1 1 1

2 Agenda Background DAG concepts Analyzing DAGs More on DAGs Exercises
Association, Cause Confounder, Collider, Mediator Causal thinking Paths Analyzing DAGs Examples More on DAGs Exercises DAG concepts Define a few main concepts Paths: Surprisingly few rules needed Analyzing DAGs Examples: conf, intermediate, collider Selection bias, Information bias Rand, Mend Rand The two former: manual for use More on DAGs Deeper thoughts and problems With exercises, difficult to guess time Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. H.S. H.S. 2 2 2 2 2

3 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 Weight and blood pressure Smoking and cancer Tox and birth weight Nov-18 H.S.

4 Causal versus casual CONCEPTS Nov-18 H.S.

5 Precision and validity
Measures of populations precision - random error validity - systematic error True value Estimate Precision Bias Ignore errors at individual level measure pop, measure sample aim: measure as precisely and as correctly as possible DAGs only consider bias 11/17/2018 H.S.

6 DAG=Directed Acyclic Graph
god-DAG Causal Graph: Node = variable Arrow = cause E=exposure, D=disease DAG=Directed Acyclic Graph Read of the DAG: Causality = arrows Associations = paths Independencies = no paths Estimations: E-D association has two parts: ED causal effect keep open ECUD bias try to close Arrows=lead to or causes Time E- exposure D- disease C, V - cofactor, variable U- unmeasured Directed= arrows Acyclic = nothing can cause itself E[C]UD Condition (adjust) to close Time  Nov-18 Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. 6 6 6

7 Association and Cause Association 3 possible causal structure E D
(Reversed cause) E D Assume E precedes D in time Association: observe Cause: infer (extra knowledge) Causal structure force on the data Basic structures, may generalize with many more variables: use paths + more complicated structures Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. 7 7 7

8 Confounder idea + A common cause Adjust for smoking Smoking
Yellow fingers Smoking 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, may have non-causal confounding “+” (assume monotonic effects) Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. H.S. 8 8 8 8 8

9 Two causes for selection to study
Collider idea Two causes for selection to study Selected subjects Selected Yellow fingers 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 “+” (assume monotonic effects) Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. H.S. 9 9 9 9 9

10 Mediator Have found a cause (E) How does it work? Mediator (M) M E D
indirect effect How does it work? Mediator (M) Paths E direct effect D 𝑇𝑜𝑡𝑎𝑙 𝑒𝑓𝑓𝑒𝑐𝑡=𝑖𝑛𝑑𝑖𝑟𝑒𝑐𝑡+𝑑𝑖𝑟𝑒𝑐𝑡 𝑀𝑒𝑑𝑖𝑎𝑡𝑒𝑑 𝑝𝑟𝑜𝑝𝑜𝑟𝑡𝑖𝑜𝑛= 𝑖𝑛𝑑𝑖𝑟𝑒𝑐𝑡 𝑡𝑜𝑡𝑎𝑙 Could be Statin->Cholesterol->CHD Or exercise->BMI->CVD Use ordinary regression methods if: linear model and no E-M interaction. Otherwise, need new methods Nov-18 H.S.

11 Causal thinking in analyses
Nov-18 H.S.

12 Regression before DAGs
Risk factors for D: Use statistical criteria for variable selection Variable OR Comments E 2.0 C 1.2 Surprisingly low association Report all variables in the model as equals Association Both can be misleading! C E D Nov-18 H.S.

13 Statistical criteria for variable selection
- 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) C E D The undirected graph above is compatible with three DAGs: C C C E D E D E D Confounder 1. Adjust Mediator 2. Direct: adjust 3. Total: not adjust Collider 4. Not adjust Hirotugu Akaike 赤池 弘次 Conclusion: 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 Nov-18 H.S.

14 Association versus causation
Risk factors for D: Use statistical criteria for variable selection Variable OR Comments E 2.0 C 1.2 Surprisingly low association Report all variables in the model as equals Association Causation Base adjustments on a DAG C C Could be Diabetes->Fractures with Exercise as confounder Report only the E-effect E D E D Symmetrical Directional C is a confounder for E-D E is a confounder for C-D C is a confounder for ED E is a mediator for CD Nov-18 H.S.

15 Paths The Path of the Righteous Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. 15
Ezekiel 25:17. "The Path of the Righteous Man Is Beset on All Sides by The inequities of the Selfish and the Tyranny of Evil Men." (Pulp Fiction version) Paths Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. 15 15

16 Path definitions Path: any trail from E to D (without repeating itself) Type: causal, non-causal State: open, closed Path 1 E®D 2 E®M®D 3 E¬C®D 4 E®K¬D Four paths: Notice: path with or against the arrows Paths show potential association Goal: Keep causal paths of interest open Close all non-causal paths Nov-18 Nov-18 H.S. H.S. 16

17 Four rules 1. Causal path: ED 2. Closed path: K
(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) Nov-18 H.S.

18 ANALYZING DAGs Nov-18 H.S.

19 Confounding examples Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 H.S.
Informal, no strict notation/def Casual about the causal! Confounding examples Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. H.S. H.S. 19 19 19 19 19 19

20 Vitamin and birth defects
Is there a bias in the crude E-D effect? Should we adjust for C? What happens if age also has a direct effect on D? Unconditional Path Type Status 1 E®D Causal Open 2 E¬C®U®D Non-causal Bias This is an example of confounding Noncausal open=biasing path Both C and U are confounders Problem that we have ”forgotten” arrow C->D? Conditioning on C Path Type Status 1 E®D Causal Open 2 E¬[C]®U®D Non-causal Closed Question: Is U a confounder? No bias 3 E¬[C] ®D Non-causal Closed Nov-18 Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. 20 20 20

21 Exercise: Physical activity and Coronary Heart Disease (CHD)
We want the total effect of Physical Activity on CHD. Write down the paths. Are they causal/non-causal, open/closed? What should we adjust for? Noncausal open=biasing path 5 minutes Nov-18 Nov-18 Nov-18 H.S. H.S. 21 21

22 Intermediate variables
Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. H.S. H.S. 22 22 22 22 22 22

23 Exercise: Tea and depression
Write down the paths. Show type and status. You want the total effect of tea on depression. What would you adjust for? You want the direct effect of tea on depression. What would you adjust for? Is caffeine an intermediate variable or a confounder? Tea and depression: Finnish study Caffeine reduces depression: Nurses Health Study 10 minutes Nov-18 H.S.

24 Exercise: Statin and CHD
Write down the paths. Show type and status. You want the total effect of statin on CHD. What would you adjust for? If lifestyle is unmeasured, can we estimate the direct effect of statin on CHD (not mediated through cholesterol)? Is cholesterol an intermediate variable or a collider? C cholesterol U lifestyle E statin D CHD Statin: lipid (cholesterol) lowering drug 10 minutes Nov-18 H.S. H.S. 24 24

25 Direct and indirect effects
So far: Controlled (in)direct effect Causal interpretation: linear model and no E-M interaction New concept: Natural (in)direct effect Causal interpretation also for: non-linear model , E-M interaction Controlled effect = Natural effect if linear model and no E-M interaction Hafeman and Schwartz 2009; Lange and Hansen 2011; Pearl 2012; Robins and Greenland 1992; VanderWeele 2009, 2014 Nov-18 H.S.

26 Mixed Confounder, collider and mediator Nov-18 Nov-18 Nov-18 Nov-18
H.S. H.S. H.S. H.S. H.S. 26 26 26 26 26 26

27 Diabetes and Fractures
We want the total effect of Diabetes (type 2) on fractures Conditional Path Type Status 1 E→D Causal Open 2 E→F→D 3 E→B→D 4 E←[V]→B→D Non-causal Closed 5 E←[P]→B→D Unconditional Path Type Status 1 E→D Causal Open 2 E→F→D 3 E→B→D 4 E←V→B→D Non-causal 5 E←P→B→D Questions: More paths? B a collider? V and P ind? Diabetes->eye disease->fall, could have ->eye disease->physical activity-> Diabetes II reduces bone density, BMI increases bone density Questions: more paths (E-B-P-E-D)? Two (or three) arrows are colliding in B, is B a collider? Mediators Confounders Nov-18 H.S.

28 Selection bias Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 H.S. H.S.
28 28 28 28 28 28

29 Convenience sample, homogenous sample
hospital Convenience sample: Conduct the study among hospital patients? E diabetes D fractures 2. Homogeneous sample: Population data, exclude hospital patients? Conditional Path Type Status 1 E→D Causal Open 2 E→[H]←D Non-Causal Unconditional Path Type Status 1 E→D Causal Open 2 E→H←D Non-causal Closed Collider, selection bias Collider stratification bias: at least on stratum is biased This type of selection bias can be adjusted for! Nov-18 H.S.

30 Adjusting for Selection bias
Paths Type Status smoke®CHD Causal Open smoke¬sex®[S]¬age®CHD Non-causal sex age smoke CHD Adjusting for sex or age or both removes the selection bias Common table of properties? Both types of selection may operate in the named examples. Ref to Pearl 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 Nov-18 H.S.

31 Drawing DAGs with DAGitty
Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. H.S. H.S. 31 31 31 31 31 31

32 Drawing a causal DAG Start: E and D 1 exposure, 1 disease
add: [S] variables conditioned by design add: C-s all common causes of 2 or more variables in the DAG C C must be included common cause V may be excluded exogenous M may be excluded mediator K may be excluded unless we condition V E D M K Nov-18 H.S.

33 DAGitty drawing tool DAGitty Web page Draw DAGs Find adjustment sets
Test DAGs Web page Run or download DAGitty is developed and maintained by Johannes Textor, Theoretical Biology & Bioinformatics group, University of Utrecht Nov-18 HS

34 Interface Nov-18 HS

35 Draw model Draw new model New variables, connect
Model>New model, Exposure, Outcome New variables, connect n new variable (or double click) c connect (hit c over V1 and over V2 to connect) r rename d delete Status (toggle on/off) u unobserved a adjusted Nov-18 HS

36 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 With zooming Nov-18 HS

37 Randomized experiments
Difficult: present only if time for exercise Randomized experiments Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. H.S. H.S. 37 37 37 37 37 37

38 Strength of arrow C1 E D C2 C3 C R E D U R E D C1, C2, C3 exogenous
Not deterministic E D C2 C1, C2, C3 exogenous Adjust for C1, C2, C3? C3 C full compliance Full compliance  no E-D confounding R E D deterministic U Not full compliance weak E-D confounding but R-D is unconfounded not full compliance R E D Path Type Status 1 R®E®D Causal open 2 R®E¬U®D non-causal closed Sub analysis conditioning on E may lead to bias Nov-18 H.S.

39 Randomized experiments
Observational study Randomized experiment with full compliance R= randomized treatment E= actual treatment. R=E Randomized experiment with less than full compliance (c) c IVe No way of drawing that R=E or that R has strong effect on E (R-E arrow is determinisric) If R has strong effect on E then U must have weak effect, that is little confounding. ITT weaker than IV effect, combination of behavior (compliance) and biology Per Protocol=as treated If linear model: ITTe=c*IVe, c<1 ITTe 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 Nov-18 H.S.

40 Exercise: RandomizedControlledTrial
Calculate the compliance (c) as a risk difference from the table. Calculate the intention to treat effect (ITTe) as a risk difference. Calculate the per-protocol effect (PP) as a risk difference. Calculate the instrumental variable effect (IVe). Explain the results in words. c IVe ITTe 10 minutes Nov-18 H.S.

41 MORE ON DAGs Nov-18 H.S.

42 Confounding versus selection bias
Path: Any trail from E to D (without repeating itself) Open non-causal path = biasing path Confounding and selection bias not always distinct May use DAG to give distinct definitions: C E D B A Confounding: Non-causal path without colliders C E D B A Selection bias: Non-causal path open due to conditioning on a collider E D B A Causal Note: interaction based selection bias not included Hernan et al, A structural approach to selection bias, Epidemiology 2004 Nov-18 H.S.

43 Better discussion based on DAGs before your conclusions
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 Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. 43 43

44 Recommended reading Books Papers
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 Hernan and Robins Causal inference (web) Hernan a struct approach Hernandez- From causal Shahar Rothman Nov-18 Nov-18 Nov-18 Nov-18 H.S. H.S. H.S. 44 44 44


Download ppt "DAGs intro with exercises 3h DirectedAcyclicGraph"

Similar presentations


Ads by Google