DID的经典案例与应用

  • 印度NREGS公共工程项目对农村低收入群体的影响
  • NREGS项目的实施时间
    • 第一批:2006年2月,200个地区参与
    • 第二批:2007年4月,130个地区参与
    • 第三批:2008年4月,270个地区参与
  • 模型构造
    • 因变量stdy:
      • 2000-2013季度夜间灯光指数(标准化)、
      • 2004-2013季度银行存款
    • 关键自变量NREGS:地区i在第t期是否实施公共政策
    • 地区控制变量D
    • 时间和州虚拟变量相乘 Y × S
    • 控制变量:
      • 政策前趋势,夜间灯光2000-2005年增长率/银行存款2004-2005年增长率
      • 其他政策项目的实施:RGGVY是否在地区i实施(从2005年开始,比NREGS早一年)
      • 地区贫穷程度:包括1991年人口普查中该地区劣势种姓的比例、1996-1997年村民收入、1990-1993年农民平均产出
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

cd "D:\Data Storages\Dataset for Learning"
use "district light panel.dta", clear
local control "i.year#c.wage i.year#c.outputwage i.year#c.state_frac"
eststo m1:reghdfe std_lt nregs, absorb(sno year#st) cluster(sno)
eststo m2:reghdfe std_lt nregs i.year#c.dlt00_05 i.year#i.rggvy, absorb(sno year#st) cluster(sno)
eststo m3:reghdfe std_lt nregs if wage!=., absorb(sno year#st) cluster(sno)
eststo m4:reghdfe std_lt nregs i.year#c.dlt00_05 i.year#i.rggvy if  wage!=., absorb(sno year#st) cluster(sno)
eststo m5:reghdfe std_lt nregs i.year#c.dlt00_05 i.year#i.rggvy `control', absorb(sno year#st) cluster(sno)
esttab m1 m2 m3 m4 m5,nogap keep(nregs)

--------------------------------------------------------------------------------------------
                      (1)             (2)             (3)             (4)             (5)   
                   std_lt          std_lt          std_lt          std_lt          std_lt   
--------------------------------------------------------------------------------------------
nregs              0.0558***       0.0559***       0.0503***       0.0531***       0.0330***
                   (6.43)          (6.72)          (5.31)          (6.04)          (3.35)   
--------------------------------------------------------------------------------------------
N                    8666            8666            6230            6230            6230   
--------------------------------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74

local pre "i.year#c.wage i.year#c.outputwage i.year#c.state_frac"


gen wave1=nr06
gen wave2=nr07
gen wave3=nr08
tab year, gen(yr)


*store wave 1 results
forvalues i=1/14{
    gen w`i'=0 if wave1~=.
    replace w`i'=1 if wave1==1 & yr`i'==1
    gen x`i'=0 if wave2~=.
    replace x`i'=1 if wave2==1 & yr`i'==1
}


*omit 2006
replace w6=0 if wave1~=.
replace x6=0 if wave2~=.


*estimation
reghdfe std_lt w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14, absorb(sno year#st) cluster(sno)


*store
estadd ysumm
eststo lights_w1


drop w1-w14 x1-x14


*store wave 2 results
forvalues i=1/14{
    gen w`i'=0 if wave2~=.
    replace w`i'=1 if wave2==1 & yr`i'==1
    gen x`i'=0 if wave1~=.
    replace x`i'=1 if wave1==1 & yr`i'==1
}


*omit 2006
replace w6=0 if wave2~=.
replace x6=0 if wave1~=.


*estimation
reghdfe std_lt  w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14, absorb(sno year#st) cluster(sno)


*store
estadd ysumm
eststo lights_w2


*label years
forvalue i=1/14{
    local j = 1999+`i'
    label var w`i' "`j'"
}


set scheme s1mono
coefplot (lights_w1, label("Wave 1")) (lights_w2, label("Wave 2")), ///
    keep(w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14) vertical   ///
    ytitle(Coefficient on Wave*Year) ylabel(-.5(.1).5) xlabel(,labsize(small)) ///
    yline(0) levels(95) ciopts(lpattern(dash)) omitted baselevels      ///
    groups(w1 w2 w3 w4 w5 w6 = `""{bf:Pre-Rollout}" "(No Districts)""' ///
    w7 w8 w9 = `""{bf:Rollout}" "(Early Districts)""' w10 w11 w12 w13  ///
    w14 = `""{bf:Post-Rollout}" "(All Districts)""')