implementing propensity score methods: a review of the … › ... › files ›...
Post on 07-Jul-2020
2 Views
Preview:
TRANSCRIPT
Implementing Propensity Score Methods: AReview of the Statistical Software
Megan SchulerHarvard Medical School
Departments of Health Care Policy
schuler@hcp.med.harvard.edu
Aug 13, 2015
Overview
R
I Matching with MatchIt
I Weighting with twang
STATA
I Matching with psmatch2, cem
I Matching and weighting with teffects
SAS
I Matching with %GMATCH, %VMATCH
Additional resources
Matching in R: MatchIt package
I MatchIt is one of the most comprehensive matching packages(Ho, Imai, King, Stuart)
I Implements many matching types (nearest neighbor w caliper,Mahalanobis, exact, coarsened exact, full, optimal, genetic)
I Additionally, PS subclassification
I Both parametric and non-parametric methods for PSestimation (e.g, GAM, classification trees, neural networks)
I Extensive balance diagnostics (balance tables, ASMD graphs,PS histographs, QQ-plots, etc.)
MatchIt syntax
Default = 1:1 nearest neighbor matching without replacement
I m.out=matchit(treat ∼ Xl + · · · + Xn, data=mydata,method=“nearest”)
Exact match on several variables
I m.out=matchit(treat ∼ Xl + · · · + Xn, data=mydata,exact=c(“X1,X2”) )
Optimal matching
I m.out=matchit(treat ∼ Xl + · · · + Xn, data=mydata,method=“optimal”)
Balance table
I summary(m.out, standardize=T, interactions=T)
MatchIt: Estimating treatment effects
Save matched dataset from MatchIt output
I matched.mydata = match.data(m.out)
1:1 Matching
I lm(Y ∼ treat, data=matched.mydata)
Matching w replacement, k:1 matching, or variable ratio matching:use weights, with survey package
I design.ps = svydesign(ids=˜1, weights=˜weights,data=matched.mydata)
I svyglm(Y ∼ treat, design = design.ps)
MatchIt balance diagnostics
Weighting in R: twang package
I twang implements a machine learning algorithm (generalizedboosted modeling) for PS estimation (Ridgeway, McCaffrey,Morral, Griffin, Burgette)
I Implements both ATE and ATT weighting
I Missing data: includes both variable and missingness indicatorin PS model
I Allows both binary and categorical treatment (3+ groups)
twang syntax
ATT weighting for binary treatment
I ps.out=ps(treat ∼ Xl + · · · + Xn, data=mydata,n.trees=5000, interaction.depth=2, estimand=“ATT”)
ATE weighting for binary treatment
I ps.out=ps(treat ∼ Xl + · · · + Xn, data=mydata,n.trees=5000, interaction.depth=2, estimand=“ATE”)
ATE weighting for categorical treatment
I ps.out= mnps(treat ∼ Xl + · · · + Xn, data=mydata,n.trees=5000, interaction.depth=2, estimand=“ATE”)
Balance table
I bal.table(ps.out)
twang : Estimating treatment effects
Extract weights
I mydata$w = get.weights(ps.out)
Treat as survey weights, using survey package
I design.ps = svydesign(ids=˜1, weights=˜w, data=mydata)
I svyglm(Y ∼ treat, design = design.ps)
twang balance diagnostics
Matching in STATA: psmatch2
I User-written command -psmatch2- offers many matchingoptions (nearest neighbor w caliper, Mahalanobis, kernel,spline, local linear regression . . . ) (Leuven & Sianesi)
I Includes built-in procedures for estimating both ATE and ATT
I Matching default is “with replacement:” without replacementonly available for 1:1
psmatch2 syntax
Default = 1:1 nearest neighbor matching with replacement
I psmatch2 treat X1 . . .Xn, logit
1:1 nearest neighbor matching without replacement
I psmatch2 treat X1 . . .Xn, logit noreplace
Kernel matching
I psmatch2 treat X1 . . .Xn, logit kernel bwidth(0.10)
Balance table, graph
I pstest X1 . . .Xn, treated(treat) both graph
Generate ATT estimate
I psmatch2 treat X1 . . .Xn, logit outcome(Y)
Matching in STATA: cem
User-written command -cem- implements coarsened exactmatching using cem package in R (Blackwell, Iacus, King, Porro)
I Missing data: treats missing as a covariate level
Implement CEM (with automatic binning)
I cem X1 . . .Xn, treatment(treat)
Use weights since variable-ratio matching method
I regress Y treat X1 . . .Xn [iweight=cem weights]
Matching & weighting in STATA 13: teffects
I Implements both matching (nearest neighbor w caliper,Mahalanobis) and weighting (inverse prob weighting,augmented inverse prob weighting)
I Based on -psmatch2- but fewer matching options (e.g., nokernel matching, no 1:1 matching without replacement)
I Built-in procedures for estimating both ATE and ATT, withrobust SE (Abadie & Imbens, 2006)
I Estimates PS and treatment effect in a single step: need toassess balance
I STATA 14 increases graphical balance diagnostic options
teffects syntax
1:1 nearest neighbor matching with replacement, ATT
I teffects psmatch (Y) (treat X1 . . .Xn)
2:1 nearest neighbor matching with replacement, ATE
I teffects psmatch (Y) (treat X1 . . .Xn), ate nn(2)
Inverse probability weighting, ATT
I teffects ipw (Y) (treat X1 . . .Xn), atet
Augmented inverse probability weighting, ATE
I teffects aipw (Y X1 . . .Xn) (treat X1 . . .Xn)
Balance diagnostics in STATA
Matching in SAS: %GMATCH macro
I User-written macro %GMATCH performs nearest neighbormatching with caliper option
I Estimate PS yourself prior to running macro to creatematched dataset
I Random sorting of data is recommended
I Only does matching without replacement
%GMATCH syntax
1:1 nearest neighbor matching
I %gmatch(data=mydata, group=treat, id=id, mvars=pscore,out=matched.data)
2:1 nearest neighbor matching with caliper
I %gmatch(data=mydata, group=treat, id=id, mvars=pscore,dmaxk=0.10, ncontrls=2, out=matched.data)
Matching in SAS: %VMATCH and %DIST macro
User-written macros %VMATCH and %DIST perform optimalmatching with caliper option
1:1 optimal matching
I %dist(data=mydata, group=treat, mvars=pscore,vmatch=Y, a=1, b=1);
Variable ratio optimal matching (1-3 controls)
I %dist(data=mydata, group=treat, mvars=pscore, vmatch=Y,a=1, b=3);
Summary
non-param Weighting w replace w/o replace global ATE & ATT 3+ groups
MatchIt x x x xtwang x x x x
psmatch2 x 1:1 only xteffects x x x
%GMATCH x%VMATCH x
Recommended resources
R
I MatchIt documentation
I twang documentation and vignettes
STATA
I Garrido et al. (2014) Methods for constructing and assessingpropensity scores, Health Services Research
SAS
I Faries et al. (2010) Analysis of observational health care datausing SAS
Thanks!
I My website: http://scholar.harvard.edu/schuler/
I Health Policy Data Science Lab website:http://www.healthpolicydatascience.org
top related