CHPR290/Stat266-- Course Files, Readings, Examples


Week 1--Course Introduction, Potential Outcomes and Study Design

Lecture Topics             Lecture 1 slide deck
1. Course outline and logistics
2. Potential outcomes framework (DOS 2.2)
3. Study design versus inference
4. Fisher's sharp null; permutation test (DOS 2.3)
5. First model for observational studies (DOS, Sections 3.1-3.3)

Text Readings
Rosenbaum DOS: Chapter 2 (secs 2.1 - 2.3);  Chapter 1 (esp secs 1.1, 1.2, 1.7);  Chapter 3 (secs 3.1- 3.3)
Additional Resources
Observational Studies according to Donald B. Rubin
   For objective causal inference, design trumps analysis Annals of Applied Statistics, Volume 2, Number 3 (2008), 808-840.    Rubin talk .   Another Rubin overview of matching: Matching Methods for Causal Inference Stuart, E.A. and Rubin, D.B. (2007). Best Practices in Quasi-Experimental Designs: Matching methods for causal inference. Chapter 11 (pp. 155-176) in Best Practices in Quantitative Social Science. J. Osborne (Ed.). Thousand Oaks, CA: Sage Publications.

Computing Corner: Extended Data Analysis Examples
Lalonde NSW data (DOS sec 2.1). Subclassification/Stratification and Full matching.
   Week 1 handout       Rogosa R-session (using R 3.3.3)        pdf slides shown in class
     MatchIt vignette

Week 1 Review Questions
From Computing Corner
1.  In Week 1 Computing Corner with the Lalonde data (effect of job training on earnings), we started out (see R-session) by showing the ubiquitous [epidemiology to economics] analysis for observational data of an analysis of covariance, aka tossing the treatment variable and all the confounders into a regression equation predicting outcome and hoping for the best (c.f 2016 Week 1 in the news analyses: mom fish consumption on child cognition). The statement made in class (technical details week 1 stat209) is that regression does not "control" for confounders; instead the coefficient of treament (putative causal effect) is obtained from a straight-line regression of outcome on the residuals from a prediction of treatment by all the other predictors in the regression. Demonstrate that equivalence using the ancova in CC1.       
 Solution for Review Question 1
2. RQ1 uses the Week 1 Computing Corner Lalonde data (effect of job training on earnings) analysis of covariance: tossing the treatment variable and all the confounders into a regression equation predicting outcome and hoping for the best. Compare that ancova with an ancova the uses just the significant predictors of re78. Also compare with an ancova which uses the single available covariate/confounder having the highest correlation with outcome. Are these analyses consistent?       
 Solution for Review Question 2


Week 2-- Randomized Experiments and Models for Observational Studies

In the news     
Breastfeeding May Not Lead to Smarter Preschoolers       Breastfeeding does NOT boost a baby's IQ: Nourishing infants the natural way only makes them less hyper      Breast-feeding study sheds light on benefits for babies
Publication: Breastfeeding, Cognitive and Noncognitive Development in Early Childhood: A Population Study. Lisa-Christine Girard, Orla Doyle, Richard E. Tremblay. PEDIATRICS Volume 1 39, number 4 , April 2017.

Lecture Topics             Lecture 2 slide deck
1. Finish up: First model for observational studies (DOS, Sections 3.1-3.3)
2. Fisher's sharp null; permutation test (DOS 2.3)
3. Why randomized controlled studies produce high-quality data (DOS, Sections 15.1 & 15.4 [skim the sections in between] also Holland paper)
4. Why randomized controlled studies do not produce high-quality data (DOS, Section 2.6)
5. A matched observational study (DOS, Chap 7)

Computing Corner: Extended Data Analysis Examples
1.     Do the Week 1 material, Lalonde data, links in week 1
2.     Lindner data, Percutaneous Coronary Intervention with 'evidence based medicine'.
Percutaneous coronary intervention (PCI), commonly known as coronary angioplasty or simply angioplasty, is a non-surgical procedure used to treat the stenotic (narrowed) coronary arteries of the heart found in coronary heart disease.
Lindner data in package PSAgraphics
Use of Lindner data in Vignette JSS   PSAgraphics: An R Package to Support Propensity Score Analysis  Journal of Statistical Software February 2009, Volume 29, Issue 6. http://www.jstatsoft.org/
               Week 2 handout       Rogosa R-session        pdf slides shown in class

Week 2 Review Questions
From Computing Corner
1. Exercise in pair matching. In DOS Sec 2.1, Rosenbaum works with the randomized experiment data from NSW. In Week 1,2 Computing Corner we used the constructed observational study version of these data. Use the observational study data to do a version of the 1:1 matching in DOS section 2.1. Compare the balance improvement achieved from nearest neighbor matching with the full matching results in Computing Corner Week 1,2.       
 Solution for Review Question 1
2. For the fullmatch analysis done in the Lalonde class presentation weeks 1 and 2, the outcome comparison was carried out using lmer to average the treatment effects over the 104 subclasses. A hand-wavy analogy to the paired t-test here would be to use the mean difference within each subclass. Show that (because some of the subclasses are large) this simplified analysis doesn't well replicate the lmer results.       
 Solution for Review Question 2
3. The JSS vignette for PSAgraphics (linked week 2 Computing Corner) does subclassification matching for Lindner data. Repeat their subclassification analyses and try out their balance displays and tests. They have some specialized functions. Compare with our basic approach.       
Lindner data  package PSAgraphics Vignette JSS           outcome analysis, Rogosa session
4. The Week 2 presentation showed an alternative propensity score analysis -- analysis of covariance with propensity score as covariate. A rough analogy is to ancova vs blocking (where blocking is our subclassification, say quintiles). Try out the basic (here logistic regression) ancova approach for the lifepres dichotomous outcome       
 Solution for Review Question 4



Week 3-- Matching Methods and Implementations

In the news              An Hour of Running May Add 7 Hours to Your Life
NY Times               Runners World               Publication: Running as a Key Lifestyle Medicine for Longevity  Prog Cardiovasc Dis. 2017 Mar 29.

Lecture Topics                          Lecture 3  slide deck   
1. A matched observational study (DOS, Chap 7)
2. Basic tools of multivariate matching (DOS, Secs 8.1-8.4)
3. Various practical issues in matching (DOS, Chap 9)

Computing Corner: Extended Data Analysis Examples
Alternative propensity score analyses. Propensity score weighting: Inverse Probability of Treatment Weighting (IPTW). Treatment effect estimation without matching.
A thorough R exposition using the Lalonde data   A Practical Guide for Using Propensity Score Weighting in R Practical Assessment, Research & Evaluation, v20 n13 Jun 2015.
    Also    Cox Regression, comparison with full matching (Elizabeth Stuart)

      Rogosa R-session        pdf slides shown in class


Week 3 Review Questions
From Computing Corner
1. Try out the ATE IPTW analysis (done in week3 computing corner) for the dichotomous outcome lifepres in the Lindner data. Compare with full matching results shown in class.       
 Solution for Review Question 1

2. Try an ATT IPTW analysis for log(cardbill) outcome in the Lindner data.       
 Solution for Review Question 2

From Lecture
3. Modify Fisher's Sharp Null to reflect the null hypothesis that the treatment adds five units to the outcome under control. Build a small simulation (e.g., 10 observations) and construct a table that summarizes the potential outcomes. Randomize using a fair coin flip to assign treatment or control for each observational unit. Use the permutation test to assess your data set using (i) Fisher's Sharp Null and (ii) the null hypothesis that the treatment adds five units to the outcome under control.       
 Solution for Review Question 3

4. Building off of RQ#3 above, sort your observations so they are in ascending order based on the outcome under control. Randomize two at a time: one fair coin flip now assigns either the first or second observation to treatment (and the other to control). A second fair coin flip assigns either the third or the fourth observation to treatment (and the other to control). This continues so on and so forth. Use the appropriate permutation test to assess your data set using (i) Fisher's Sharp Null and (ii) the null hypothesis that the treatment adds five units to the outcome under control. Contrast the results here with the results from RQ#3.       
 Solution for Review Question 4




Week 4-- Design Sensitivity

In the news              Drink water coffee beer instead?
Study links diet soda to higher risk of stroke, dementia  Wash Post;       Just ONE Diet Coke or Pepsi Max a day can "TRIPLE the risk of a deadly stroke" and dementia, researchers claim  Sun;       A diet soda a day might affect dementia risk, study suggests  AHA news
Publication: Sugar and Artificially Sweetened Beverages and the Risks of Incident Stroke and Dementia: A Prospective Cohort Study   Stroke,   STROKEAHA.116.016027   Originally published April 20, 2017.   Framingham Heart Study.
Coverage continues and widens. PepsiCo focuses on 'guilt-free' beverages, yet more research casts a pall over diet soda  MarketWatch.   Drinking Too Much Soda May Be Linked to Alzheimer's   Bloomberg.

Lecture Topics                          Lecture 4  slide deck   
Finish up: Various practical issues in matching (DOS Chap 9)
Sensitivity analysis (DOS Sections 3.4-3.7 and 3.9)
Designs to strengthen your analysis: multiple control groups, "known" effects (DOS Chap 6)

Computing Corner: Extended Data Analysis Examples
Alternative computation of propensity scores (trees, boosting). Teamed with IPTW in twang package.
           Toolkit for Weighting and Analysis of Nonequivalent Groups: A tutorial for the twang package   Lalonde data, yet again.
                Rogosa twang and ATT session with Lalonde data         Week 4 slides
Additional Resources:
Package rpart .     An Introduction to Recursive Partitioning Using the RPART Routines
Package gbm .     Generalized Boosted Models: A guide to the gbm package
To come, sensitivity analysis computations: package rbounds, Rosenbaum packages sensivitymv and sensitivitymw   vignette:   Two R Packages for Sensitivity Analysis in Observational Studies

Week 4 Review Questions
From Computing Corner
1. Try out, using the Lalonde data (Week 1), the boosted regression approach to computing propensity scores using Ridgeway's (via Friedman) gbm package. Are the balance and overlap results improved compared to the logistic regression estimation shown in Week 1?       
 Solution for Review Question 1

2. Try out using the Lindner data shown in the PSAgraphics vignette (JSS linked week 2), the regression tree classification (use rpart) approach for propensity score estimation. Examine resulting propensity scores, balance for matching in six suclassifications, and outcome analysis for cardbill measure.       
 Solution for Review Question 2



Week 5-- Planning Analysis

In the news              Salt not bad after all?
Low-sodium diet might not lower blood pressure         Higher sodium intake associated with lower blood pressure. You read that right.     Abstract   Low Sodium Intakes are Not Associated with Lower Blood Pressure Levels among Framingham Offspring Study Adults

Lecture Topics                          Lecture 5  slide deck   
Summarize Gamma sensitivity analysis (DoS 3.4-3.8)
What to do with missing data, and a word of warning (DoS 9)
Using multiple outcomes - coherence and known null effects (DoS 5.2.3 and 5.2.4)
Using a second control group - mitigating bias (DoS 5.2.2)

Computing Corner: Extended Data Analysis Examples
Sensitivity analysis computations:
package rbounds,
Rosenbaum pacakges sensivitymv and sensitivitymw   vignette:   Two R Packages for Sensitivity Analysis (examples from sections 2 and 3)in Observational Studies
                Rogosa sensitivity session                   CC_5 slides

Week 5 Review Questions
From Week 5 Computing Corner
1. Mercury example (2 controls) from section 3 and 6 of Rosenbaum vignette (linked in CC_5)
Fish often contains mercury. Does eating large quantities of fish increase levels of mercury in the blood? Data set mercury in the sensitivitymw package is from the 2009-2010 National Health and Nutrition Examination Survey (NHANES) and is the example in Rosenbaum (2014). There are 397 rows or matched triples and three columns, one treated with two controls. The values are methylmercury levels in blood. Column 1, Treated, describes an individual who had at least 15 servings of fish or shellfish in the previous month. Column 2, Zero, describes an individual who had 0 servings of fish or shellfish in the previous month. Column 3, One, describes an individual who had 1 serving of fish or shellfish in the previous month. In the comparison here, Zero and One are not distinguished; both are controls. Sets were matched for gender, age, education, household income, black race, Hispanic, and cigarette consumption.
a. describe the apparent effect of fish consumption and try out sensitivity analyses (for both tests and CI) for the apparent effect of fish. c.f Rosenbaum vignette sec 3.2
b. look at the effects of weighting (method w in the sensitivitymw manual) as theory and simulations suggest that a sensitivity analysis will be more powerful if matched sets with little variability are given little weight. c.f Rosenbaum vignette sec 6.3.       
 Solution for Review Question 1

2. Demonstration--see solution. Mechanics of setting up a matched data set for the sensitivity functions. Easiest to create the data set for the most common 1:1 matching situation (merge works without needing thought); steps for 1:1 matching setting below       
 Review Question 2 with 1:1 matching



Week 6-- Alternative Designs

In the news              Rogosa on a roll, I do both
1. Note: RCT (cross-over design). Damn right! The secret of success is swearing: How shouting four letter words can help make you stronger    Swearing can help you boost your physical performance    The full power of swearing is starting to be discovered
2. Another RCT.   Talking to yourself out loud helps boost brainpower and could indicate higher intelligence    Is talking to yourself a sign of mental illness? An expert delivers her verdict
Bonus item: not just observational studies have problems.                  Medical studies are almost always bogus

Lecture Topics                          Lecture 6  slide deck   
(i) Using multiple outcomes - coherence and known null effects (DoS 5.2.3 and 5.2.4)
(ii) Using a second control group - mitigating bias (DoS 5.2.2)
(iii) inverse probability weighting (link)

Computing Corner: Primer on optmatch (link to package)        optmatch vignette (using nuclear plants data)
                Baiocchi R-session



Week 7-- Further Issues

In the news              Pre-test, post-test designs for the microbiome
TOO much exercise causes a leaky gut and increases health risks     Publication: American Journal of Physiology - Gastrointestinal and Liver Physiology. Changes in intestinal microbiota composition and metabolism coincide with increased intestinal permeability in young adults under prolonged physiologic stress American Journal of Physiology - Gastrointestinal and Liver Physiology Published 23 March 2017

Lecture Topics                          Lecture 7  slide deck   
(1) Inference (DoS 2.3-2.4)
(2) Arguments for observational studies (DoS 2.6)
(3) Crossover designs (link)

Computing Corner:                       Dose response functions (and multiple groups): Beyond Binary Treatments
package causaldrf     vignette:   Estimating Average Dose Response Functions Using the R Package causaldrf      Rnw file for vignette      dot-R file for vignette
                                          Rogosa session, causaldrf examples
also covariate balancing propensity score, package CBPS
Background publications:
The Propensity Score with Continuous Treatments
Causal Inference With General Treatment Regimes: Generalizing the Propensity Score, Journal of the American Statistical Association, Vol. 99, No. 467 (September), pp. 854-866.       
 Slides for Dose-Response, CC_7           also,   summary ADRF slide

    
Week 7 Review Questions
From Week 7 Computing Corner
1. Dose-Response functions. IPW (aka importance sampling) can't hit the curve? Can't hit anything??
In week 7 Computing Corner we showed results for ADRF (average dose-response function) estimates using Imbens very clever artificial data example from the linked causaldrf vignette (see also CC_7 slides).
IPW results (see Weeks 3 and 4 Computing Corner for examples for binary treatements) were notable in apparant bad bad performance (all other estimates did pretty well). Keep in mind this artificial data test is not even a "phase 2" hurdle, as we are given the selection variables (X_1, X_2) that are responsible for individuals selecting dose (here denoted by T) other than randomness.
As IPW is dominant in applications like long-term occupation exposures (to bad stuff), the dose-reponse setting is quite relevant. The artificial data ADRF has an important feature of a non-monotonic dip, reminiscent of alcohol or even salt (a bit above 0 is better than zero) for health outcomes. So for another look at IPW, I tried to make a much easier example, with basically a straight-line ADRF (just with a little wiggle) by limiting dose (T) to > .5.
So try out the comparison of the hi_estimate (shown in class) and the iptw_estimate both from the causaldrf package with the true ADRF from the artificial data construction using values T > .5 (about half the data).
Are we any happier with the value of IPW (importance sampling)? Solution indicates to me: "no", YMMV.       
 Solution for Review Question 1



Week 8 - Instrumental Variable Methods for Randomized Controlled Trials

In the news               more salt, good for Russian cosmonauts
Eating salt could help you to LOSE weight, study reveals     Vanderbilt     Publication: High salt intake reprioritizes osmolyte and energy metabolism for body fluid conservation. J Clin Invest. 2017;127(5):1944-1959.

Lecture Topics                          Lecture 8  slide deck   
Encouragement design (Holland 1988 )
Instrumental variable methods for causal inference ( Baiocchi, Cheng and Small 2004)
Regression discontinuity - Lee and Lemieux 2011


Computing Corner:                   Regression Discontinuity Designs     
    Example from rdd manual (Stat209 handout)     ascii version
Angrist-Lavy Maimondes (class size) data     sections 1.3, 3.2, 5.2.3, 5.3 DOS text
              read data ang = read.dta("http://www.ats.ucla.edu/stat/stata/examples/methods_matter/chapter9/angrist.dta")
R-package--rdd;   Regression Discontinuity Estimation Author Drew Dimmery
Also Package rdrobust Title Robust data-driven statistical inference in Regression-Discontinuity designs       
 Slides for Regression Discontinuity CC
Regression Discontinuity Resources
       Stat209, Regression Discontinuity handout
Trochim W.M. & Cappelleri J.C. (1992). "Cutoff assignment strategies for enhancing randomized clinical trials." Controlled Clinical Trials, 13, 190-212.  pubmed link
Journal of Econometrics (special issue) Volume 142, Issue 2, February 2008, The regression discontinuity design: Theory and applications      Regression discontinuity designs: A guide to practice, Guido W. Imbens, Thomas Lemieux
    Another Econometric treatment
    Also from Journal of Econometrics (special issue) Volume 142, Issue 2, February 2008, The regression discontinuity design: Theory and applications  Waiting for Life to Arrive: A history of the regression-discontinuity design in Psychology, Statistics and Economics, Thomas D Cook
the original paper: Thistlewaite, D., and D. Campbell (1960): "Regression-Discontinuity Analysis: An Alternative to the Ex Post Facto Experiment," Journal of Educational Psychology, 51, 309-317.
Capitalizing on Nonrandom Assignment to Treatments: A Regression-Discontinuity Evaluation of a Crime-Control Program Richard A. Berk; David Rauma Journal of the American Statistical Association, Vol. 78, No. 381. (Mar., 1983), pp. 21-27. Jstor
Berk, R.A. & de Leeuw, J. (1999). "An evaluation of California's inmate classification system using a generalized regression discontinuity design." Journal of the American Statistical Association, 94(448), 1045-1052.  Jstor

To come: Instrumental Variable Methods: packages   AER(ivreg), ivpack, ivmodel

Week 8 Review Questions
Computing Exercises
1. Regression Discontinuity, classic "Sharp" design. Replicate the package rdd toy example: cutpoint = 0, sharp design, with treatment effect of 3 units (instead of 10). Try out the analysis of covariance (Rubin 1977) estimate and compare with rdd output and plot. Pick off the observations used in the Half-BW estimate and verify using t-test or wilcoxon.
Extra: try out also the rdrobust package for this sharp design.       
 Solution for Review Question 1

2. Systematic Assignment, "fuzzy design". Probabilistic assignment on the basis of the covariate.
i. Create artificial data with the following specification. 10,000 observations; premeasure (Y_uc in my session) gaussian mean 10 variance 1. Effect of intervention (rho) if in the treatment group is 2 (or close to 2) and uncorrelated with Y_uc. Probability of being in the treatment group depends on Y_uc but is not a deterministic step-function ("sharp design"): Pr(treatment|Y_uc) = pnorm(Y_uc, 10,1) . Plot that function.
ii. Try out analysis of covariance with Y_uc as covariate. Obtain a confidence interval for the effect of the treatment.
iii. Try out the fancy econometric estimators (using finite support) as in the rdd package. See if you find that they work poorly in this very basic fuzzy design example.
Extra: try out also the rdrobust package for this fuzzy design.       
 Solution for Review Question 2




Week 9 - Instrumental Variable Methods for Observational Studies

In the news               last news update
1. Causal direction. Journalists drink too much, are bad at managing emotions, and operate at a lower level than average, according to a new study    the neuroscience, Study into the mental resilience of journalists
2. Eating Chocolate, A Little Each Week, May Lower The Risk Of A Heart Flutter . Publication: Chocolate intake and risk of clinically apparent atrial fibrillation: the Danish Diet, Cancer, and Health Study .   Mostofsky E, Berg Johansen M, Tjønneland A, et al Chocolate intake and risk of clinically apparent atrial fibrillation: the Danish Diet, Cancer, and Health Study Heart Published Online First: 23 May 2017. doi: 10.1136/heartjnl-2016-310357.

Lecture Topics                          Lecture 9  slide deck   
Instrumental variable methods for causal inference ( Baiocchi, Cheng and Small 2004)
Regression discontinuity - Lee and Lemieux 2011

Computing Corner:                  Instrumental Variables: IV basics and implementation.            Music: Wishin' and hopin'
                          IV handout           CC_9 slides         Rogosa IV sessions, examples
Additional resources:
AER package
ivmodel package    vignette

Week 9 Review Questions
Computing Exercises
1. Compliance, measured or binary Compliance as a measured variable (week 6 lecture). In Stat209 week 7 we also examine compliance adjustments; both those based on a dichotomous compliance variable (as in the AIR paper linked week 6) and the much much more common measured compliance (often unwisely dichotomized to match Rubin formulation). The Efron-Feldman study ( handout description) used a continuous compliance measure. An artificial data set a data frame containing Compliance, Group, and Outcome for Stat209 HW7 is constructed so that ITT for cholesterol reduction is about 20 (compliance .6) and effect of cholestyramine for perfect compliance is about 35. Try out some IV estimators for CACE. Obtain ITT estimate of group (treatment) effect with a confidence interval. Try using G as an instrument for the Y ~ comp regression. What does that produce? Alternatively use the Rubin formulation with a dichotomous compliance indicator defined as TRUE for compliance > .8 in these data. What is your CACE estimate. What assumptions did you make? Compare with ITT estimate. In this problem the ivreg function from AER package is used for IV estimation.       
 Solution for Review Question 1
More problem 1   1. Compliance data, IV analysis, imitating Efron-Feldman cholestyramine trial. Solution showed you the widely used ivreg function from package AER package. Redo the ivreg analyses using functions from the ivmodel package.       
 Solution for more Review Question 1

2. Use the Card data, described in the ivmodel vignette, to carry out some basic IV analyses. Compare ivreg with some analyses using the ivmodel package.       
 Solution for Review Question 2