View on GitHub

An introduction to propensity score matching in STATA

Thomas G. Stewart
Assistant Professor

This lecture is part 9 of the Propensity Scores and Related Methods Series presented and organized by Robert Greevy within Vanderbilt University's Center for Health Services Research.

NOTE 1

I reserve the right for these notes to be wrong, mistaken, or incomplete.

NOTE 2

These notes will continue to be updated as I

Please feel free to provide content and comments.

SOFTWARE

ssc install psmatch2
ssc install table1

REFERENCES

DATA FOR EXAMPLES AND DISCUSSION

To motivate the propensity score matching, I'll use the cattaneo2 dataset, a STATA example dataset. It can be loaded with the following command:

webuse cattaneo2

The data in cattaneo2 is a subset of data that was analysed in the following journal articles:

The dataset included information about infant/mother/father characteristics from singleton births in Pennsylvania between 1989 and 1991. The original dataset included nearly 500,000 births. The STATA example dataset includes 4642 births.

RESEARCH QUESTION: What is the effect of maternal smoking during pregnancy on the infant's birthweight?

The dataset includes the following set of variables:

Infant Mother Father
birth weight (grams) married/not married
birth month hispanic (yes/no) hispanic (yes/no)
race (white/not white) race (white/not white)
age age
education education
foreign born (yes/no)
birth number
months since last birth
infant of previous births died (yes/no)
number of prenatal care visits
trimester of first prenatal care visit
alcohol during pregnancy (yes/no)
smoking during pregnancy (0, 1-5, 6-10, 11+ daily)
smoking during pregnancy (yes/no)

You can access the complete codebook with the command codebook after loading the data.

BIG PICTURE: BACKGROUND

Randomized Clinical Trial Observational Study
Treatment Assignment: Investigators generate a treatment schedule prior to patient enrollment. The schedule is constructed based on the design of the study, which includes randomization in some fashion. Physicians (who may be blind to treatment as well) assign treatments/exposures to study participants following the sequence in the schedule.
  • Phyicians assign treatment/exposure based on
    • characteristics of the patient
    • personal preference
    • regional preference
    • insurance restrictions
  • Study participants choose for themselves treatments or behaviors
  • Exposures are based on geographic location or cultural identity
CONSEQUENTLY
Probability of Treatment: Known Unknown, may be 0 or 1
Covariate Balance: Relationship between covariates and treatment assignment are known from study design. Usually the study is designed so that there is no relationship between treatment assignment and covariates. Relationship between covariates and treatment assignment is unknown. There may be covariate imbalance.

BIG PICTURE: CHALLENGES

Differences in outcomes between the treated and untreated (or exposed and unexposed) may be the consequence of confounding variables and not the treatment (or exposure).

Dataset may include sub-groups for which a treatment effect should not be calculated because

BIG PICTURE: SOLUTIONS

There are several methods for estimating a treatment effect with observational data. In this lecture series, you have been exposed (not randomly) to a family of methods which use the propensity score. The primary focus has been on propensity score matching.

STEPS (A SUMMARY OF STUART 2010)

  1. Defining “closeness”: the distance measure used to determine whether an individual is a good match for another.
    1. Variables to include
      • Researchers should thus be liberal in terms of including variables that may be associated with treatment assignment and/or the outcomes.
      • One type of variable that should not be included in the matching process is any variable that may have been affected by the treatment of interest (Rosenbaum, 1984; Frangakis and Rubin, 2002; Greenland, 2003).
    2. Distance Measures
      • Exact
      • Mahalanobis
      • Propensity score / linear propensity score
        • With propensity score estimation, concern is not with the parameter estimates of the model, but rather with the resulting balance of the covariates (Augurzky and Schmidt, 2001).
  2. Implementing a matching method, given that measure of closeness.
    • Methods:
      1. k:1 Nearest Neighbor
        • Estimates Average Treatment Effect in the Treated (ATT or ATET)
        • May need a caliper
      2. Subclassification
      3. Full matching
      4. Weighting (IPTW)
    • Assess Common Support
      • Examining the common support may indicate that it is not possible to reliably estimate the ATE.
  3. Assessing the quality of the resulting matched samples, and perhaps iterating with steps 1 and 2 until well-matched samples result.
    • Perhaps the most important step in using matching methods is to diagnose the quality of the resulting matched samples
    • Tools:
      1. Histograms / Density Plots / ECDF
      2. Standardized Bias / Standardized difference in means
  4. Analysis of the outcome and estimation of the treatment effect, given the matching done in step 3.
    1. After k:1 mathcing
      • May not need to account for matched pair
      • Must use weights if matching was with replacement
      • Use regression adjustment
    2. After subclassification
      • Aggregation weights determine estimation of ATT or ATE
      • Use regression adjustment

DEMONSTRATION