use movestay_example, clear
local str age age2 edu13 edu4 edu5 reg2 reg3 reg4
movestay (lmo_wage = `str'), select(private= m_s1 job_hold)
mspredict Psel // calculates the probability of being in regime 1. This is the default statistic.
mspredict xb1 // calculates the linear prediction for the regression equation in regime 1. This is the
//unconditional prediction referred to in the Methods section (Equation 2.5).
mspredict xb2 // calculates the linear prediction for the regression equation in regime 2. This is the
// unconditional prediction refereed to in the Methods section (Equation 2.6).
mspredict yc1_1 // calculates the expected value of the dependent variable in the first equation
// conditional on the dependent variable being observed (Equation 2.7).
mspredict yc1_2 // calculates the expected value of the dependent variable in the first equation
// conditional on the dependent variable not being observed (Equation 2.8).
mspredict yc2_2 // calculates the expected value of the dependent variable in the second equation
// conditional on the dependent variable being observed (Equation 2.9).
mspredict mills1 //
mspredict mills2 //calculate corresponding Mill’s ratios for the two regimes.
mspredict EY1, yc1_1, // i.e. expected value of outcome among adopters given the outcome is observed
mspredict EY0, yc2_2, // i.e. expected value of outcome among non adopters given outcome is observed
sum EY1 if private==1, mean
gen m1t = r(mean)
sum EY0 if private==0, mean
gen m0t = r(mean)
gen att = m1t - m0t
*-Example 3: ATT, ATE, ATC ???
* w=1(treated); w=0(Control)
clear
input ///
i w x y
1 0 2 7
2 0 4 8
3 0 5 6
4 0 3 5
5 1 2 8.9
6 1 3 6.5
7 1 1 8.2
end
psmatch2 w x, outcome(y) //???????? ATT
sort _id
format _pscore %4.3f
list w _treated x y _pscore _weight _y _id _n1 _nn _pdif, sep(4)
*-ATT (Average Treatment effect for the Treated)
sum y if _treated==1 & _support==1, mean
local m1t = r(mean)
local N1 = r(N) // Treat ?????
sum _y if _treated==1 & _support==1, mean
local m0t = r(mean)
local att = `m1t' - `m0t'
dis 'ATT = ' `att'
*-????
sum y if _treated==1 //[fw=_weight]
sum _y if _treated==1 //[fw=_weight]
*-ATE ? ATC
psmatch2 w x, outcome(y) ate //?? ate ??????? ATT, ATE ? ATC
sort _id
format _pscore %4.3f
list w _treated x y _pscore _weight _y _id _n1 _nn _pdif, sep(4)
*-ATC (ATU) (Average Treatment effect for the Controls\Untreated)
sum _y if _treated==0 & _support==1, mean
local m1u = r(mean)
sum y if _treated==0 & _support==1, mean
local m0u = r(mean)
local N0 = r(N) // Control ?????
local atu = `m1u' - `m0u'
dis 'ATU = ' `atu'
*-ATE (Average Treatment Effect)
local ate = `att'*`N1'/(`N0'+`N1') + `atu'*`N0'/(`N0'+`N1')
dis 'ATE = ' `ate'
*-Note: ATE ???? ATT ? ATC ?????
*-test [???? treat ??? ATT ???? treat ???? ATC]
gen w2 = (w==0) //???? treat ??
psmatch2 w2 x, outcome(y)
sort _id
list w* x y _pscore _treated _weight _y _id _n1 _nn _pdif, sep(0)
*-Source: psmatch2.ado
//???
mspredict EY1, yc1_1, // i.e. expected value of outcome among adopters given the outcome is observed
mspredict EY0, yc2_2, // i.e. expected value of outcome among non adopters given outcome is observed
//But what I really want to estimate is the difference between the two terms to show the unbiased effects of adoption. Any ideas how I can proceed from here?
movestay lmo_wage age age2 edu13 edu4 edu5 reg2 reg3 reg4,> select(private = m_s1 job_hold)
829

被折叠的 条评论
为什么被折叠?



