1 / 44

DAGs intro with exercises 3h D irected A cyclic G raph

DAGs intro with exercises 3h D irected A cyclic G raph. Hein Stigum http://folk.uio.no/heins/ courses. Nov-15. Nov-15. Nov-15. Nov-15. Nov-15. H.S. H.S. H.S. H.S. 1. 1. 1. 1. 1. Agenda. Background DAG concepts Association, Cause Confounder, Collider, Mediator

poppy
Download Presentation

DAGs intro with exercises 3h D irected A cyclic G raph

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. DAGs intro with exercises 3hDirectedAcyclicGraph Hein Stigum http://folk.uio.no/heins/ courses Nov-15 Nov-15 Nov-15 Nov-15 Nov-15 H.S. H.S. H.S. H.S. H.S. 1 1 1 1 1

  2. Agenda • Background • DAG concepts • Association, Cause • Confounder, Collider, Mediator • Causal thinking • Paths • Analyzing DAGs • Examples • More on DAGs Exercises Nov-15 Nov-15 Nov-15 Nov-15 Nov-15 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 H.S.

  4. Causal versus casual CONCEPTS H.S.

  5. Precision and validity • Measures of populations • precision - random error • validity - systematic error Precision Bias True value Estimate DAGs only consider bias H.S.

  6. 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 E[C]UD Condition (adjust) to close Time  Nov-15 Nov-15 Nov-15 H.S. H.S. H.S. 6 6 6

  7. Association and Cause 3 possible causal structure Association (Reversed cause) E D + more complicated structures Nov-15 Nov-15 H.S. H.S. H.S. 7 7

  8. 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 Confounder idea + A common cause Adjust for smoking Smoking Smoking + + + + Yellow fingers Lung cancer Yellow fingers Lung cancer Nov-15 Nov-15 Nov-15 Nov-15 H.S. H.S. H.S. H.S. 8 8 8 8

  9. Conditioning on a collider induces an association between its causes “And” and “or” selection leads to different bias Paths Simplest form Collider idea • or • + and Two causes for selection to study Selected subjects Selected Selected + + + + Yellow fingers Lung cancer Yellow fingers Lung cancer Nov-15 Nov-15 Nov-15 Nov-15 H.S. H.S. H.S. H.S. 9 9 9 9

  10. Mediator • Have found a cause (E) M effect indirect • How does it work? • Mediator (M) • Paths direct effect D E Use ordinary regression methods if: linear model and no E-M interaction. Otherwise,need new methods H.S.

  11. Causal thinking in analyses H.S.

  12. Regression before DAGs Use statistical criteria for variable selection Risk factors for D: Report all variables in the model as equals Association Both can be misleading! C E D 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 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 H.S.

  14. Association versus causation Use statistical criteria for variable selection Risk factors for D: Report all variables in the model as equals Association Causation Base adjustments on a DAG C C 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 H.S.

  15. Paths The Path of the Righteous Nov-15 Nov-15 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 Four paths: Goal: Keep causal paths of interest open Close all non-causal paths Nov-15 H.S. H.S. 16

  17. 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) H.S.

  18. ANALYZING DAGs H.S.

  19. Confounding examples Nov-15 Nov-15 Nov-15 Nov-15 Nov-15 H.S. H.S. H.S. H.S. H.S. 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? Bias This is an example of confounding Question: Is U a confounder? No bias Nov-15 Nov-15 Nov-15 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? 5 minutes Nov-15 Nov-15 H.S. H.S. 21 21

  22. Intermediate variables Nov-15 Nov-15 Nov-15 Nov-15 Nov-15 H.S. H.S. H.S. H.S. H.S. 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? 10 minutes H.S.

  24. Exercise: Statin and CHD D U C E lifestyle CHD statin cholesterol 10 minutes Nov-15 • 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? H.S. H.S. 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 andno E-M interaction Hafemanand Schwartz 2009; Lange and Hansen 2011; Pearl 2012; Robins and Greenland 1992; VanderWeele2009, 2014 H.S.

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

  27. Diabetes and Fractures We want the total effect of Diabetes (type 2) on fractures Questions: More paths? B a collider? V and P ind? Mediators Confounders H.S.

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

  29. Convenience sample, homogenous sample • Convenience sample: • Conduct the study among • hospital patients? D E H 2. Homogeneous sample: Population data, exclude hospital patients? fractures diabetes hospital Collider, selection bias Collider stratification bias: at least on stratum is biased This type of selection bias can be adjusted for! H.S.

  30. Adjusting for Selection bias S sex age smoke CHD Adjusting for sex or age or both removes the selection 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 H.S.

  31. Drawing DAGs with DAGitty Nov-15 Nov-15 Nov-15 Nov-15 Nov-15 H.S. H.S. H.S. H.S. H.S. 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 H.S.

  33. DAGitty drawing tool • DAGitty • Draw DAGs • Find adjustment sets • Test DAGs • Web page • http://www.dagitty.net/ • Run or download HS

  34. Interface HS

  35. Draw model • Draw new model • 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) • rrename • d delete • Status (toggle on/off) • u unobserved • a adjusted 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 HS

  37. Randomized experiments Nov-15 Nov-15 Nov-15 Nov-15 Nov-15 H.S. H.S. H.S. H.S. H.S. 37 37 37 37 37

  38. Strength of arrow C1 Not deterministic C1, C2, C3 exogenous D E C2 Adjust for C1, C2, C3? C3 C full compliance Full compliance  no E-D confounding D R E deterministic U • Not full compliance • weak E-D confounding • but R-D is unconfounded not full compliance D R E Sub analysis conditioning on E may lead to bias 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 If linear model: ITTe=c*IVe, c<1 ITTe IntentionToTreateffect: effect of R on D (unconfounded) population PerProtocol:crude effect of E on D (confounded by U) InstrumentalVariableeffect: adjusted effect of E on D (if c is known, 2SLS) individual 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 H.S.

  41. MORE ON DAGs 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 C A B A B E D E D E A B D Causal Confounding: Non-causal path without colliders Selection bias: Non-causal path open due to conditioning on a collider Note: interaction based selection bias not included Hernan et al, A structural approach to selection bias, Epidemiology 2004 H.S.

  43. Summing up Better discussion based on DAGs Draw your assumptions before your conclusions Nov-15 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. Nov-15 H.S. H.S. H.S. 43 43

  44. 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 Nov-15 Nov-15 Nov-15 H.S. H.S. H.S. 44 44 44

More Related