The task is to estimate propensity score | the conditional probability of treatment assignment for further use in causal analysis (matching, weighting, etc.).
Usually the propensity score model is misspecified | it might lead to severely biased estimates of treatment effects.
Given the successful estimation distributions of covariates in the treated and non-treated cells should be statistically equal. Any significant discrepancy might indicate either the mis-specication of probability model or a failure of CIA assumption (Caliendo and Kopeinig, 2008).
Therefore one of the most frequently done checks of the quality of propensity score estimates is a covariate balance check (Dehejia and Wahba, 2002).
Top Rated Pune Call Girls Aundh ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Covariate balancing propensity score STATA user written code by Filip Premik
1. Motivation Estimator CBPS Function Do-It-Yourself References
Covariate Balancing Propensity Score
Stata User-Written Function
Filip Premik
University of Minnesota, FAME|GRAPE
April 4, 2018
F. Premik 1/20
2. Motivation Estimator CBPS Function Do-It-Yourself References
Contents:
1 Motivation
2 Estimator
3 CBPS Function
4 Do-It-Yourself
Author gratefully acknowledges the support of the National Science Centr.e
(grant #2016/23/N/HS4/03637)
F. Premik 2/20
4. Motivation Estimator CBPS Function Do-It-Yourself References
Motivation
The task is to estimate propensity score — the conditional probability of treatment
assignment for further use in causal analysis (matching, weighting, etc.).
Usually the propensity score model is misspecified — it might lead to severely biased
estimates of treatment effects.
Given the successful estimation distributions of covariates in the treated and non-treated
cells should be statistically equal. Any significant discrepancy might indicate either the mis-
specification of probability model or a failure of CIA assumption (Caliendo and Kopeinig,
2008).
Therefore one of the most frequently done checks of the quality of propensity score
estimates is a covariate balance check (Dehejia and Wahba, 2002).
F. Premik 4/20
5. Motivation Estimator CBPS Function Do-It-Yourself References
Motivation
The dual nature of propensity score:
covariate balancing score,
conditional probability of treatment assignment.
Imai and Ratkovic (2014) exploit the dual nature of propensity score and propose an estimator
that automatically produces covariate balancing — Covariate Balancing Propensity Score
(CBPS) estimator.
Here: Stata implementation.
F. Premik 5/20
7. Motivation Estimator CBPS Function Do-It-Yourself References
Framework
Standard causal analysis framework. Let:
Ti be a binary treatment indicator for a unit i,
πβ(xi ) = P[Ti = 1|xi ; β] be a conditional probability of treatment assignement,
xi is a vector of covariates,
yi ≡ Ti y1i + (1 − Ti )y0i is the outcome of interest,
CIA in the spirit of Rosenbaum and Rubin (1983) holds, i.e.:
(y0i , y1i ) ⊥⊥ Ti |πβ(xi )
.
F. Premik 7/20
8. Motivation Estimator CBPS Function Do-It-Yourself References
ML score conditions...
Let start with classical ML estimation of propensity score. One might write the log-likelihood
function as:
ˆβMLE
= arg max
β
N
i=1
Ti log{πβ(xi )} + (1 − Ti ) log{1 − πβ(xi )} (1)
The first order conditions (so called score conditions) are as follows:
1
N
N
i=1
Ti πβ(xi )
πβ(xi )
−
(1 − Ti )πβ(xi )
1 − πβ(xi )
= 0 (2)
Rewrite it a little bit...
1
N
N
i=1
Ti πβ(xi )
πβ(xi )
=
1
N
N
i=1
(1 − Ti )πβ(xi )
1 − πβ(xi )
(3)
F. Premik 8/20
9. Motivation Estimator CBPS Function Do-It-Yourself References
...are balancing conditions...
... and switch the focus for population values which are estimated by sample means:
1
N
N
i=1
Ti πβ(xi )
πβ(xi )
=
1
N
N
i=1
(1 − Ti )πβ(xi )
1 − πβ(xi )
E
Ti πβ(xi )
πβ(xi )
= E
(1 − Ti )πβ(xi )
1 − πβ(xi )
The equation above tells us nothing more but the fact that likelihood methods balance the
distribution of derivative of assumed probability function. The more weight in PS is given to
covariates that are predictive of treatent assignment.
F. Premik 9/20
10. Motivation Estimator CBPS Function Do-It-Yourself References
... which may be used to impose CIA
Observe that the last equation should be satisfied not only for the score vector but for all
measurable functions f (·) (provided expectations exist).
E
Ti f (xi )
πβ(xi )
= E
(1 − Ti )f (xi )
1 − πβ(xi )
In particular, we might consider f (xi ) = xi and obtain:
E
Ti xi
πβ(xi )
= E
(1 − Ti )xi
1 − πβ(xi )
Which says that (weighted) means across covariates given the PS are equal. This is nothing
else but the balancing property we wanted to obtain!
F. Premik 10/20
11. Motivation Estimator CBPS Function Do-It-Yourself References
GMM Estimation
Rewrite the problem in GMM context. Define:
Sample analog of ML score conditions:
sβ(Ti , xi ) ≡
Ti πβ(xi )
πβ(xi )
−
(1 − Ti )πβ(xi )
1 − πβ(xi )
=
Ti − πβ(xi )
πβ(xi )(1 − πβ(xi ))
· πβ(xi ) = 0 (4)
Sample analog for covariate balancing conditions (first moments):
wβ(Ti , Xi ) ≡
Ti − πβ(Xi )
πβ(Xi )(1 − πβ(Xi ))
· xi = 0 (5)
F. Premik 11/20
12. Motivation Estimator CBPS Function Do-It-Yourself References
GMM Estimation
Imai and Ratkovic (2014) propose the following GMM estimator:
ˆβGMM
= arg min
β∈Θ
gβ(T, X) Σβ(T, X)−1
g(T, X) (6)
where g(T, X) = N
i=1 gβ(Ti , Xi ) is the sample mean of moment conditions. Depending on
what we want to achieve we might use:
gβ(Ti , Xi ) Balances Estimator Specification test
1) sβ(Ti , Xi ) ML score — more weight on
variables with predictive power
binomial MLE –
2) wβ(Ti , Xi ) first moments of covariates just-identified GMM –
3)
sβ(Ti , Xi )
wβ(Ti , Xi )
both over-identified GMM
F. Premik 12/20
13. Motivation Estimator CBPS Function Do-It-Yourself References
Comments
Misspecification of MLE leads to inconsistent estimates. CBPS is robust by exploiting the
dual nature of propensity score (Imai and Ratkovic, 2014).
All formulas up to now were presented for ATE estimation. For the effect on the treated
substitute:
wβ(Ti , Xi ) =
N
N1
Ti − πβ(Xi )
1 − πβ(Xi )
(7)
Two-step efficient GMM with analytically derived Σβ(T, X) ≡ E[gβ(Ti , Xi )gβ(Ti , Xi ) ].
The probability model is logistic, however no obstacle appears if one wants to replace it
with probit or others.
Starting values comes from the first step logit estimation.
Gradient methods usually work well (BFGS algorithm, Imai and Ratkovic (2014)).
F. Premik 13/20
15. Motivation Estimator CBPS Function Do-It-Yourself References
Stata Implementation
Syntax
CBPS depvar indepvars [if exp] [in range] [, over ate att logit probit evaluator_type(string)
optimization_technique(string) ]
Options
ate calculates the propensity score using ATE formulas.
att calculates the propensity score using ATT formulas, this is the default option.
over imposes overidentifying restrictions coming from the ML first order conditions.
logit uses logistic probability distribution as a functional form for πβ(·), this is the default
option.
probit uses normal probability distribution as a functional form for πβ(·).
optimization_technique(string) sets the optimization technique. See optimize() for
more details. The default value is bfgs.
evaluator_type(string) sets the evaluator type for optimization process. See opti-
mize() for more details. The default value is gf1.
F. Premik 15/20
16. Motivation Estimator CBPS Function Do-It-Yourself References
Stata Implementation
Saved results
Scalars
e(N) e(N1) e(N0)
e(J) J-Stat in χ2
overidentification test
e(Jdf) number of degrees of freedom in χ2
overidentification test
e(Jpval) p-value in χ2
overidentification test
Macros
e(predict)
e(cmdline)
e(cmd) e(type)
e(properties)
e(depvar)
Matrices
e(b)
e(V)
F. Premik 16/20
17. Motivation Estimator CBPS Function Do-It-Yourself References
Stata Implementation
Postestimation
predict newvar [, replace bscore pscore] — saves the predicted propensity scores
or balancing weights
CBPS_imbalance — calculates the overall and treated-specific covariate imbalance (Rosen-
baum and Rubin, 1985). They should equal zero for ATE and ATT just-identified esti-
mation respectively – a simple check if the optimization algorithm has found the proper
minimum.
F. Premik 17/20
19. Motivation Estimator CBPS Function Do-It-Yourself References
Do-It-Yourself
set more off
use http://www.ats.ucla.edu/stat/stata/dae/binary.dta,
clear
logit admit gre gpa ib4.rank
CBPS_imbalance
estimates store mle
CBPS admit gre gpa ib4.rank, ate
CBPS_imbalance
estimates store jate
CBPS admit gre gpa ib4.rank, over ate
CBPS_imbalance
estimates store oate
CBPS admit gre gpa ib4.rank
CBPS_imbalance
estimates store jatt
CBPS admit gre gpa ib4.rank, over
CBPS_imbalance
estimates store oatt
esttab mle jate oate jatt oatt , mti-
tles("logit" "exact ate" "over ate"
"exact att" "over att") /// sfmt(3)
scalars(imbalance_ate imbalance_att J
Jpval)
F. Premik 19/20
20. Motivation Estimator CBPS Function Do-It-Yourself References
References
Caliendo, M., and S. Kopeinig (2008): “Some practical guidance for the implementation of propensity score
matching,” Journal of economic surveys, 22(1), 31–72.
Dehejia, R. H., and S. Wahba (2002): “Propensity score-matching methods for nonexperimental causal studies,”
Review of Economics and statistics, 84(1), 151–161.
Imai, K., and M. Ratkovic (2014): “Covariate balancing propensity score,” Journal of the Royal Statistical Society:
Series B (Statistical Methodology), 76(1), 243–263.
Rosenbaum, P. R., and D. B. Rubin (1983): “The central role of the propensity score in observational studies for
causal effects,” Biometrika, 70(1), 41–55.
(1985): “Constructing a control group using multivariate matched sampling methods that incorporate the
propensity score,” The American Statistician, 39(1), 33–38.
F. Premik 20/20