matlab newey west,国际经济学硕博核心阅读的参考书目|高级宏观经济理论|Acemoglu合集1993至2012年|内生转......

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)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值