相關演講2 - 國立政治大學

advertisement
傾向分數分析方法的實際步驟
關秉寅
國立政治大學社會學系/亞太研究英語
博士學位學程
科技部人社中心人文
社會科學理論與實踐講座
2014.09.10
演講大綱
• 理論基礎
– 反事實架構(counterfactual framework)觀
點的因果推論
– 為何用傾向分數配對分析方法(propensity
score matching, PSM)
– PSM之假定
• PSM 分析之步驟
• PSM:實例演練
• PSM分析的前瞻與限制
基本問題
• Q:除了使用隨機對照實驗(randomized
controlled trial, RCT)的設計外,我們可以用
觀察性研究(observational studies)做因果推
論嗎?
• A:當然可以,只是我們可能犯錯。即使因果
推論不是在找deterministic的模型的前提下,
仍會犯錯,因為(以國中生補習與否與其學
習成就為例):
– 會補習者與不補習者可能補習前的家庭及社區資
源、學習動機、學習表現就不同
– 補習的效果會因人而異
理論基礎
• 反事實架構觀點的因果推論想像
Potential Outcomes
Group
Treatment
group
(D = 1)
Control group
(D = 0)
Y1
Y0
Observable
Counterfactual
Counterfactual
Observable
理論基礎
S
Confounding
variables
D
W
Y
δ
(causal effect of interest)
理論基礎:反事實架構觀點
• 反事實分析架構的想像可看成是一種
thought experiment。
• 要想像的是同一個個體或群體在不同的狀態
下,會有什麼可能的結果(potential
outcomes)。也就是 What if?
• 這些可能結果間的差異,即為不同狀態(因)
的效果。
• Counterfactuals should be reasonable !
理論基礎:反事實架構觀點
• 個人層次的真正因果效應:
δi = Yi1 ─ Yi0
• The Fundamental Problem of Causal Inference:
無法觀察同一個人同時在實驗組及控制組。
• 加上一些假定,如 The Stable Unit Treatment
Value Assumption(SUTVA),則可推估群層
次的因果效應。
理論基礎:反事實架構觀點
• 實驗設計是假設我們能夠將觀察到的替代無
法觀察到的。
• 如隨機分派到實驗組與控制組的個體的特性
相同,則我們可以假定:
– 如果實驗組的個人沒有接受treatment的話,其結
果與控制組觀察到的相同;
– 如果控制組的個人接受treatment的話,其結果與
實驗組觀察到的相同。
理論基礎:反事實架構觀點
• 當使用調查方法得到資料時,即
observational data,個人為何會接受或不接
受treatment,往往不是一個隨機的現象。
• Observational data通常有兩個問題:
– 接受treatment者與不接受者有baseline
differences,以及heterogeneity of treatment
effect.
– 可能有些影響接受treatment與否的變項,並未
觀察到,亦即omitted variables的問題。
理論基礎:反事實架構觀點
Potential Outcomes
Group
Treatment
group
(D = 1)
Control group
(D = 0)
Y1
Y0
Observable
E[Y1 | D = 1]
Counterfactual
Counterfactual
Observable
E[Y1 | D = 0]
E[Y0 | D = 0]
E[Y0 | D = 1]
理論基礎:反事實架構觀點
A
Y1
15
Y0
?
B
13
?
C
?
8
D
?
4
Naïve estimate = 8
δ
理論基礎:反事實架構觀點
A
Y1
15
Y0
10
δ
5
B
13
8
5
C
13
8
5
D
9
4
5
ATT = ATU; ATE = 5
理論基礎:反事實架構觀點
A
Y1
15
Y0
10
δ
5
B
13
8
5
C
11
8
3
D
7
4
3
ATT ≠ ATU; ATE = 4
理論基礎:反事實架構觀點
• 以反事實架構的觀點來看,母群體層次的真正
因果效應(ATE;Average Treatment Effect)
為:
E[δ] = E[Y1 – Y0]
= E[Y1] – E[Y0]
= {πE[Y1 | D = 1] + (1 – π) E[Y1 | D = 0]} –
{πE[Y0 | D = 1] + (1 – π) E[Y0 | D = 0]}
= π{E[Y1 | D = 1] – E[Y0 | D = 1] } +
(1 – π) {E[Y1 | D = 0] – E[Y0 | D = 0] }
= πE[δ| D = 1] + (1 – π) E[δ | D = 0]
理論基礎:反事實架構觀點
• π:母群體中接受 treatment 的比例
• 不同組的因果效應:
– ATT(Average Treatment Effect on the Treated):
E[Y1 |D = 1] – E[Y0|D = 1] ,即 E[δ| D = 1]
– ATU(Average Treatment Effect on the Untreated):
E[Y1 |D = 0] – E[Y0|D = 0] ,即 E[δ | D = 0]
Q:我們可以假定不同組的人有同樣的因果效應嗎?
如果我們能夠做此假定的話,則 E[Y1 |D = 0] = E[Y1 |D = 1]
理論基礎:反事實架構觀點
• 基準線的差異:
E[Y0 |D = 1] – E[Y0|D = 0]
Q:我們可以假定不同組的人在未接受
treatment 前是一樣的嗎?
如果我們能夠做此假定的話,則 E[Y0 |D = 1] =
E[Y0|D = 0]
理論基礎:反事實架構觀點
• 如果我們只以觀察到接受 treatment 的組
與觀察到未接受 treatment 的組之間的差
異做為 Causal Effect 的估計時,此估計
是一種 Naïve Estimate:
理論基礎:反事實架構觀點
Naïve Estimate
= average causal effect
+ baseline bias
+ differential effect bias
E[Y1 |D = 1] – E[Y0|D = 0]
= E(δ)
+ {E(Y0|D=1) − E(Y0|D=0)}
+{E(δ |D=1) − E(δ |D=0)}
(1−π)
理論基礎:Why PSM?
• 從反事實分析觀點的角度來看,使用觀察
性資料進行因果推論時,首先要能設法控
制影響估計D Y 的共變項。過往用OLS
的分析也是企圖達此目的。那為何還需要
用PSM呢?
理論基礎:Why PSM?
• Guo, Shenyang & Mark W. Fraser (2010),
Propensity Score Analysis. Thousand Oaks, CA:
Sage.
• Monte Carlo simulation study of Chapter 8; mean
of 10,000 samples
• Selection on observable simulation (p. 288-296)
– Model: y = 100 + .5x1 + .2 x2 - .5x3 + .5W + u
W* = .5Z + .1x3 + v
– Estimation
• OLS regerssion: 0.5375; Bias= 0.375 (7.5% over)
• PSM: 0.4875; Bias= -0.0125 (2.5% under)
理論基礎:Why PSM?
A model of selection on observables
PSM
Models relationship between
confounders and treatment
OLS
Models relationship between
confounders and outcome
No routine assumptions about
linearity and interactions
Generally assumes linearity and
absence of interaction, but this
can be relaxed
Easy assessment of overlap –
Overlap is assessed in multilittle potential for extrapolation dimensional space – often
extrapolated
Causal effect for treated,
untreated, local comparison
Sample size can be diminished
through matching, loss of
power
Causal effect extrapolated to
population
Sample size stays constant,
power can increase due to
covariates
理論基礎:PSM之假定
• 假設控制影響treatment(D)之共變項後,就
能達成ignorability,這也稱為selection on
observables)
• (Y1 ,Y0) ⊥ D|S, conditional independence
• 如果接受及不接受 treatment 兩種人的差異
能夠被一組共變項(S)完美解釋,那麼我們
就可以用這些共變項進行分層配對,使得每層
內有兩種人:接受者及不接受者,且這些人在
各層中唯一的不同是他們是否接受 treatment。
然後,我們觀察這兩種人在 outcome 的差異
為何。我們再進一步將各分層的差異,以及分
層所佔的比例做適當加權,則可得到好的ATE,
ATT,ATU 的估計
理論基礎:PSM之假定
• 實際上如果有許多共變項時,配對過程很
麻煩,且在樣本有限的情況下,有些分層
會沒有個案。Paul Rosenbaum及Donald
Rubin在一系列的論文中,證明用所謂的
「傾向分數」(propensity score)將是
否會接受視為一種機率,然後以此分數來
從事分層配對是可行的。
• 如果以logistic regression來估計ps且D=
1或0的話,則
exp( S  )
Pr( D  1 | S ) 
1  exp( S  )
PSM 分析之步驟
Selection
• Selection of covariates that may affect the assignment of the
treatment (D=1 or 0)
Estimation
• Estimate propensity scores using either logistic regression or other
means
Matching
Model
Checks
Effect
Estimation
Sensitivity
Analysis
• Choose matching algorithm
• Check covariates balance
• Check the region of common support
• Mean difference
• Standard error
• Check if the estimated result is robust against hidden bias
Selection
• 選擇可能影響treatment assignment共變項
是PSM得到不偏causal effect最重要的一環。
對如何選擇有不少討論及爭議,基本上應
選擇:
– 有理論依據
– 不受treatment variable影響者;亦即是影響D,
而不是受D影響者
– 不是工具變項者;亦即排除對Y的影響是只透過
D者
– 不是collider variables;亦即不是同時受S及Y影
響者。如控制collider variables會使原本沒關係
的S及Y產生相關。
Selection:
Which covariates should be controlled
A
B
C
F
G
D
Y
Selection
(控制 B & F 即可,Why?)
V (unobserved)
A
F
G
U (unobserved)
B
C
D
Y
Selection
• 要是控制了 colliders 反而會有問題,因為本
來X與Y沒有相關或因果關係的,控制這類
變項後,反而會產生相關。
S
Y
C (collider)
Estimation
• 通常可用logistic regression或probit
regression來估計ps。
• 也有用data mining 或 optimization 的方法,
及尋找最大解釋力的模型,如generalized
boosted regression (如Stata之boost程式)。
Matching
• 從事PSM的運算方法可歸成以下大類:
– Nearest Neighbor Matching: 1:1 或 1:k
– Optimal Matching: 1:1 或 1:k
– Full Matching: k : k
– Interval Matching
– Kernel Matching
– 不同運算方法的差異:
• With or without replacement
• How many units to match
Matching
• 選擇不同運算法的兩難
– 要能 maximize 精準的配對(如用 strictly
“nearest” or common-support region),
可能會有比較多的樣本個案會被排除於分析之外。
– 要能包括比較多的配對樣本個案 (如擴大配對
的範圍),就會有比較多不精準的配對。
Matching
• Caliper及trimming之考量
– Caliper:界定可配對之ps間的合理距離,
Rosenbaum & Rubin(1985)建議是
|Pi – Pj| < ε, 而 ε ≦ .25 σp , σp 為 estimated ps的標
準差。
– Trimming: 界定common support之範圍,排除
treatment cases所配對之non-treated cases的ps
density 是低於某個比例(如2%、5%或10%)
時,因 ps 分配的兩端可能是極端的個案。
Model Checks
• Check covariates balance
– 觀察性研究中接受treatment(如補習)和不接受
者在共變項上通常有顯著差異。經過適當的配對後,
此差異應該消失。因此,需要在配對後檢視是否
treated 及 untreated 在 用 來 配 對 的 共 變 項 達 到
balance。
– Balance的檢視一方面可用Standardized bias或t- test
是要看兩組人在個別變項是否無顯著差異,也要看
兩組在全部共變項分配上,配對後是否為無差異。
Sianesi (2004)建議以pseudo R2來檢視配對後是否整
體配對變項預測兩組是否接受treatment已無解釋
力,以及用likelihood ratio test來檢視用來估算 ps阿
logit或probit model是否在配對後全部共變項的joint
significance已經不顯著。
Model Checks
• Check the region of common support:通常
可以圖形如histogram,來檢視兩組之ps分
配重疊的情況。
Effect Estimation
• PSM可估計ATT(average treatment effect on
the treated),ATU(average treatment effect
on the untreated )及ATE(average treatment
effect,如果所有的人都接受treatmet的話)。通
常感興趣的是ATT,因為我們期待如果接受
treatment者會有效果。可以進一步分成推論到配
對樣本(如SATT)及母群體的treatment effects
(PATT)。
• 如何估計psm所得到之estimates的standard
errors有不同的看法。不同的matching會有不同估
計se的方法,其中一種是用bootstrapping方式求
得PSM估計值的se(但有爭議)。
Sensitivity Analysis
• Sensitivity Analysis 的目的是瞭解違反PSM之
selection on observables假定時,PSM得到的估
計有多robust。
• 以是否補習為例:
– 如果是否補習的機率是π i,且此機率不僅是為觀察
到的配對變項xi所決定,也受到未觀察到之變項ui
的影響,則
π i = Pr(Di = 1 | xi) = F(βxi + γui) 。
Di = 1即參與補習,ui是可設定介於0與1間,而γ是ui
對參與補習的影響效果。
Sensitivity Analysis
– 如果補習參與只受到觀察到的配對變項xi決定的話,
γ即為0;但如果γ不是0,則是否補習機率估計會
有潛在偏誤(hidden bias),亦即兩個案即使在xi
的數值相同,但是否參與補習的機率卻不同。
– 隨著所設定之γ大小的變化,可評估treatment
effect 受到潛在偏誤之影響的敏感度。Rosenbaum
(2002)將兩人有同樣配對變項數值,但因未觀
察變項影響而有不同的接受treatment之機率的潛
在偏誤上下限訂為介於1/Г及Г之間:
1


 s ,1 (1   s , 2 )
 s , 2 (1   s ,1 )

S是指配對的個案,S = 1,…,S,Г = exp(γ)。
PSM:實例演練
• 以Stata 13介紹新指令teffects(treatment
effect)的資料cattaneo2
( http://www.stata.com/manuals13/te.pdf
)。
• Treatment: mbsmoke; Outcome: bweight
• Covariates: mmarried, mage, prenatal1, fbaby
• 程式:
– psmatch2: user written, Stata 13及以下均可
用
– teffects psmatch: Stata 13
PSM:實例演練
Naïve Estimate
. reg bweight mbsmoke
Source
SS
df
MS
Model
Residual
53275939.9
1 53275939.9
1.5016e+09 4640 323622.478
Total
1.5549e+09 4641 335032.156
bweight
Coef.
mbsmoke
_cons
-275.2519
3412.912
Std. Err.
21.4528
9.255254
t
-12.83
368.75
Number of obs
F( 1, 4640)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|
0.000
0.000
=
=
=
=
=
=
4642
164.62
0.0000
0.0343
0.0341
568.88
[95% Conf. Interval]
-317.3096
3394.767
-233.1942
3431.056
PSM:實例演練
OLS regression with covariates
. reg bweight mbsmoke mmarried mage prenatal1 fbaby
Source
SS
df
MS
Model
Residual
89487999.5
5 17897599.9
1.4654e+09 4636 316090.646
Total
1.5549e+09 4641 335032.156
bweight
Coef.
mbsmoke
mmarried
mage
prenatal1
fbaby
_cons
-226.9851
154.4452
1.018963
57.59001
-52.07058
3245.509
Std. Err.
21.95345
21.14817
1.736228
22.24885
17.6856
46.50306
t
-10.34
7.30
0.59
2.59
-2.94
69.79
Number of obs
F( 5, 4636)
Prob > F
R-squared
Adj R-squared
Root MSE
P>|t|
0.000
0.000
0.557
0.010
0.003
0.000
=
=
=
=
=
=
4642
56.62
0.0000
0.0576
0.0565
562.22
[95% Conf. Interval]
-270.0243
112.9848
-2.38487
13.97169
-86.74277
3154.341
-183.9459
195.9057
4.422796
101.2083
-17.39839
3336.677
PSM:實例演練
PSM: 1 to 1 nearest neighbor (ATT, ATU, ATE)
. generate u=runiform()
. sort u
. set seed 09102014
. psmatch2 mbsmoke mmarried mage prenatal1 fbaby, out(bweight) norepl desc ///
>
common logit ate
Logistic regression
Number of obs
LR chi2(4)
Prob > chi2
Pseudo R2
Log likelihood = -2082.3879
mbsmoke
Coef.
mmarried
mage
prenatal1
fbaby
_cons
-1.10666
-.0187894
-.2721103
-.5428134
.1297324
Std. Err.
.091279
.0082217
.0943067
.0864561
.2095812
z
-12.12
-2.29
-2.89
-6.28
0.62
P>|z|
0.000
0.022
0.004
0.000
0.536
=
=
=
=
4642
296.72
0.0000
0.0665
[95% Conf. Interval]
-1.285564
-.0349036
-.4569481
-.7122642
-.2810391
-.9277569
-.0026751
-.0872725
-.3733625
.540504
PSM:實例演練
PSM: 1 to 1 nearest neighbor (ATT, ATU, ATE)
There are observations with identical propensity score values.
The sort order of the data could affect your results.
Make sure that the sort order is random before calling psmatch2.
Variable
Sample
Treated
bweight Unmatched
ATT
ATU
ATE
3137.65972
3137.65972
3258.11111
Controls
Difference
S.E.
T-stat
3412.91159 -275.251871
3374.37384 -236.71412
3137.65972 -120.451389
-178.582755
21.4528037
24.2515628
.
.
-12.83
-9.76
.
.
Note: S.E. does not take into account that the propensity score is estimated.
psmatch2:
Treatment
assignment
psmatch2: Common
support
Off suppo On suppor
Total
Untreated
Treated
2,914
0
864
864
3,778
864
Total
2,914
1,728
4,642
PSM:實例演練
PSM: 1 to 1 nearest neighbor (ATT only)
. set seed 09102014
. psmatch2 mbsmoke mmarried mage prenatal1 fbaby, out(bweight) norepl desc ///
>
common logit
Variable
Sample
Treated
Controls
Difference
S.E.
T-stat
bweight
Unmatched
ATT
3137.65972
3137.65972
3412.91159
3374.37384
-275.251871
-236.71412
21.4528037
27.4641702
-12.83
-8.62
Note: S.E. does not take into account that the propensity score is estimated.
psmatch2:
Treatment
assignment
psmatch2:
Common
support
On suppor
Total
Untreated
Treated
3,778
864
3,778
864
Total
4,642
4,642
PSM:實例演練
PSM: balance check
. pstest mmarried mage prenatal1 fbaby,sum
Variable
Mean
Treated Control
mmarried
mage
prenatal1
fbaby
.47338
25.167
.68981
.37153
.47569
24.939
.69907
.37153
%bias
-0.5
4.2
-2.2
0.0
t-test
t
p>|t|
-0.10
0.90
-0.42
-0.00
0.923
0.370
0.676
1.000
Summary of the distribution of |bias|
1%
5%
10%
25%
Percentiles
0
0
0
.2477759
50%
1.342956
75%
90%
95%
99%
Smallest
0
.4955518
2.19036
4.163704
Largest
0
.4955518
2.19036
4.163704
3.177032
4.163704
4.163704
4.163704
Obs
Sum of Wgt.
4
4
Mean
Std. Dev.
1.712404
1.884177
Variance
Skewness
Kurtosis
3.550123
.4612301
1.655635
Pseudo R2
LR chi2
p>chi2
MeanB
MedB
0.001
1.40
0.844
1.7
1.3
PSM:實例演練
Using boosted regression to estimate ps
. program boost_plugin, plugin using("C:\Users\USER\Documents/boost64.dll")
. sort u
. boost mbsmoke mmarried mage prenatal1 fbaby, distribution(logistic) ///
>
maxiter(1000) trainfraction(0.8) predict(pred) influence
influence
Distribution=logistic
predict=pred
Trainfraction=.8 Shrink=.01 Bag=.5 maxiter=1000 Interaction=5
Fitting ...
Assessing Influence ...
Predicting ...
bestiter= 364
Test R2= .07841669
trainn= 3713
Train R2= .10148136
Influence of each variable (Percent):
43.207508 mmarried
39.878625 mage
6.1220354 prenatal1
10.791831 fbaby
PSM:實例演練
PSM: 1 to 1 nearest neighbor with ps estimated by boosted regresion (ATT only)
. set seed 09102014
. psmatch2 mbsmoke, out(bweight) ps(pred) norepl desc common logit
There are observations with identical propensity score values.
The sort order of the data could affect your results.
Make sure that the sort order is random before calling psmatch2.
Variable
Sample
Treated
Controls
Difference
S.E.
T-stat
bweight
Unmatched
ATT
3137.65972
3137.65972
3412.91159
3365.44329
-275.251871
-227.783565
21.4528037
27.611249
-12.83
-8.25
Note: S.E. does not take into account that the propensity score is estimated.
psmatch2:
Treatment
assignment
psmatch2:
Common
support
On suppor
Total
Untreated
Treated
3,778
864
3,778
864
Total
4,642
4,642
PSM:實例演練
PSM: balance check (once again)
. pstest mmarried mage prenatal1 fbaby,sum
Variable
Mean
Treated Control
mmarried
mage
prenatal1
fbaby
.47338
25.167
.68981
.37153
.47338
25.132
.70139
.37269
%bias
0.0
0.6
-2.7
-0.2
t-test
t
p>|t|
-0.00
0.14
-0.52
-0.05
1.000
0.891
0.601
0.960
Summary of the distribution of |bias|
1%
5%
10%
25%
Percentiles
0
0
0
.1179266
50%
.4349599
75%
90%
95%
99%
Smallest
0
.2358532
.6340666
2.73795
Largest
0
.2358532
.6340666
2.73795
1.686008
2.73795
2.73795
2.73795
Obs
Sum of Wgt.
4
4
Mean
Std. Dev.
.9019675
1.251646
Variance
Skewness
Kurtosis
1.566619
1.008983
2.214059
Pseudo R2
LR chi2
p>chi2
MeanB
MedB
0.000
0.34
0.987
0.9
0.4
0
.2
.4
.6
.8
1
PSM:實例演練
0
.2
.6
.4
Actual Values
Logistic Regression
Fitted Values=Actual Values
.8
1
Boosting
Fitted versus actual values for logistic regression and boosting
on the test data set
PSM:實例演練
PSM: check common support using “psgraph”
. psgraph,bin(50)
.1
.2
.3
Propensity Score
Untreated
.4
Treated
.5
PSM:實例演練
PSM: using bootstrapping to estimate the standard error of
ATT
. set seed 09102014
. bs r(att): psmatch2 mbsmoke, out(bweight) ps(pred) norepl desc common logit
(running psmatch2 on estimation sample)
Note: S.E. does not take into account that the propensity score is estimated.
Bootstrap replications (50)
1
2
3
4
5
..................................................
Bootstrap results
command:
_bs_1:
_bs_1
50
Number of obs
Replications
=
=
4642
50
psmatch2 mbsmoke, out(bweight) ps(pred) norepl desc common logit
r(att)
Observed
Coef.
Bootstrap
Std. Err.
-227.7836
23.43063
z
-9.72
P>|z|
0.000
Normal-based
[95% Conf. Interval]
-273.7068
-181.8604
PSM:實例演練
PSM: sensitivity analysis
. gen delta = bweight - _bweight if _treated==1 & _support==1
(3778 missing values generated)
. rbounds delta, gamma(1 (.1) 2)
Rosenbaum bounds for delta (N = 864 matched pairs)
CICI+
t-hatt-hat+
sigsig+
Gamma
----------------------------------------------------------------------184.5
-283.5
-236.5
-236.5
0
0
1
-155.5
-315
-203.5
-269
1.5e-14
0
1.1
-127
-343.5
-174
-296
3.7e-11
0
1.2
-99
-369
-149
-321
1.6e-08
0
1.3
-71
-396.5
-127.5
-342.5
1.9e-06
0
1.4
-50
-417
-100
-368.5
.000077
0
1.5
-28.5
-439.5
-84
-386
.001321
0
1.6
-456.5 -9.99999
-60
-408
.011365
0
1.7
12.9999
-478
-42.5
-425
.055599
0
1.8
28.5
-496
-439.5 -27.9999
.172078
0
1.9
44
-510.5
-456 -10.4999
.369576
0
2
* gamma
sig+
sigt-hat+
t-hatCI+
CI-
-
log odds of
upper bound
lower bound
upper bound
lower bound
upper bound
lower bound
differential assignment due to unobserved factors
significance level
significance level
Hodges-Lehmann point estimate
Hodges-Lehmann point estimate
confidence interval (a= .95)
confidence interval (a= .95)
. disp log(1.8)
.58778666
PSM:實例演練
• PSM: 1 to 5 within caliper (.25*σps)
. set seed 09102014
. psmatch2 mbsmoke, ps(pred) out(bweight) n(5) ai(5) caliper(.02648032) ///
>
common logit
There are observations with identical propensity score values.
The sort order of the data could affect your results.
Make sure that the sort order is random before calling psmatch2.
Variable
Sample
Treated
Controls
Difference
S.E.
T-stat
bweight
Unmatched
ATT
3137.65972
3137.65972
3412.91159
3362.2662
-275.251871
-224.606481
21.4528037
32.3712871
-12.83
-6.94
Note: Sample S.E.
psmatch2:
Treatment
assignment
psmatch2:
Common
support
On suppor
Total
Untreated
Treated
3,778
864
3,778
864
Total
4,642
4,642
PSM:實例演練
• PSM: 1 to 5 within caliper (.25*σps) using “teffects (psmatch)”
. teffects psmatch (bweight)(mbsmoke mmarried mage prenatal1 fbaby), atet nn(5) ///
>
caliper(.02551812) vce(robust) gen(po)
Treatment-effects estimation
Estimator
: propensity-score matching
Outcome model : matching
Treatment model: logit
bweight
Coef.
mbsmoke
(smoker vs nonsmoker)
-234.305
AI Robust
Std. Err.
Number of obs
Matches: requested
min
max
z
P>|z|
=
=
=
=
4642
5
5
139
[95% Conf. Interval]
ATET
23.58632
-9.93
0.000
-280.5334
-188.0767
PSM:實例演練
• PSM: 1 to 5 within caliper (.25*σps) using “teffects (psmatch)”
0
5
density
10
15
. teffects overlap
.5
.6
.7
.8
.9
Propensity score, mbsmoke=nonsmoker
mbsmoke=nonsmoker
mbsmoke=smoker
1
PSM:實例演練
• 可從事PSM的軟體及程式:
– Stata: psmatch2、nnmatch、teffects (v. 13) 等
– SPSS: SPSS Macro for Propensity Score Matching
(http://ssw.unc.edu/VRC/Lectures/index.htm)
– SAS: “GREEDY” Macro
(http://www2.sas.com/proceedings/sugi26/proceed.pdf)
– R: “MatchIt”, “Matching”等
• 另見 Software for implementing matching methods and
propensity scores
• “http://www.biostat.jhsph.edu/~estuart/propensityscore
software.html”
PSM分析的前瞻與限制
• PSM可用來分析
– 或兩個以上treatments:應用multinomial logistic
或 ordered logistic regression來估計ps
– Binary outcome:估計odds ratio,relative risks,
risk differences等
• PS與其他分析方法的結合:
– Stratification:將estimated ps分層檢視不同分層
的treatment effects
– Weighting:利用ps來建構權數,以平衡不同的
群體
– Regression adjustment:將ps視為共變項
PSM分析的前瞻與限制
• PSM與其他分析方法的結合
– 與迴歸分析結合
– 應用在multilevel analysis
– 應用在complex sampling
– Mediation analysis:從counterfactual
framework的角度來看,mediation(也就是
瞭解causal mechanisms)的分析是頗複雜的,
因為中介變項本身就是一種outcome,也就需
要瞭解 counterfactual 的狀態。
– Sequential matching
– 其他:如 fixed effects 或 random effects models
PSM分析的前瞻與限制
• PSM的限制
– 樣本要夠大:樣本小的話,有些共變項配對後
不容易達到balance
– Common support範圍太窄的話,成功配對的會
是兩組屬於比較極端的個案,容易造成錯誤的
偏誤
– SUTVA假定可能不合理
– PSM無法有效處理selection on unobservables的
情況
PSM分析的前瞻與限制
• selection on unobservables
Z
D
Y
U (unobservable)
• Selection on unobservables 情況需要用其他適
當的資料(如長期追蹤)及分析方法(如
fixed effects)
PSM入門參考文獻
• Morgan, Stephen L., and Christopher Winship.
2007. Counterfactuals and Causal Analysis:
Methods and Principles for Social Research.
Cambridge, MA: Harvard University Press.
• Caliendo, Marco, and Sabine Kopeinig. 2008.
“Some Practical Guidance for the
Implementation of Propensity Score Matching.”
Journal of Economic Surveys 22 (1): 31–72.
• Guo, Shenyang, and Mark. W. Fraser. 2010.
Propensity Score Analysis: Statistical Methods
and Applications. Los Angeles: Sage.
謝謝聆聽!
Q&A
Download