class: center, middle, inverse, title-slide # Causal Inference in R: Introduction ### 2020-07-29 (updated: 2020-07-28) --- <style type="text/css"> img { height: 250px; width: 250px; border-radius: 50%; object-fit: cover; } </style> ## `> who_are_we(c("lucy", "malcolm"))` .pull-left[ <br /> <br /> <img src="img/ldm.jpg" width="132" style="display: block; margin: auto;" /> <br /> <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 496 512"><path d="M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"/></svg> [https://www.lucymcgowan.com/](https://www.lucymcgowan.com/) ] .pull-right[ <br /> <br /> <img src="img/mb.jpg" width="412" style="display: block; margin: auto;" /> <br /> <svg style="height:0.8em;top:.04em;position:relative;" viewBox="0 0 496 512"><path d="M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"/></svg> [https://www.malco.io/](https://www.malco.io/) ] --- class: center, inverse, middle # The three practices of analysis 1. Describe 2. Predict 3. Explain --- class: middle, center, inverse # Normal regression estimates associations. But we want *counterfactual, causal* estimates: # What would happen if *everyone* in the study were exposed to x vs if *no one* was exposed. --- class: middle, center, inverse # For causal inference, we need to make sometimes unverifiable assumptions. # Today, we'll focus on the assumption of *no confounding*. --- class: inverse, middle # Tools for causal inference 1. Causal diagrams 1. Propensity score weighting 1. Propensity score matching --- class: inverse, middle # Other tools for causal inference 1. Randomized trials 1. G-methods & friends 1. Instrumental variables & friends --- class: inverse, middle, center # Let's head to RStudio Cloud: https://bit.ly/causalcloud --- class: inverse # Resources ## [Causal Inference](https://www.hsph.harvard.edu/miguel-hernan/causal-inference-book/): Comprehensive text on causal inference. Free online. ## [The Book of Why](http://bayes.cs.ucla.edu/WHY/): Detailed, friendly intro to DAGs and causal inference. Free online. ## [Mastering 'Metrics](http://www.masteringmetrics.com/): Friendly introduction to IV-based methods