-
Notifications
You must be signed in to change notification settings - Fork 2
/
WB_Models_EverTreated.do
48 lines (33 loc) · 1.76 KB
/
WB_Models_EverTreated.do
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
*Clear memory
clear
*Set local macros
global project "/Users/careyglenn/Box Sync/usaidwestbank_roadsgie"
global project "/Users/rbtrichler/Box Sync/usaidwestbank_roadsgie"
*Import file
import delimited "$project/Data/wb_panel_750m_near.csv", clear
destring dist_trt2, force replace
destring dist_trt3, force replace
destring viirs, force replace
* Generate Variables
*Binned treatment 1 distance
egen dist_trt_near_cat = cut(dist_trt_nearest), at (0, 1000, 2000, 3000, 4000, 5000, 6000) icodes
** REGRESSIONS
** Only Ever Treated Cells
* earliest treatment,
reghdfe viirs trt1 i.month, cluster (pcbs_co month) absorb(cell_id)
outreg2 using myregnear.doc, replace drop(i.month) addtext ("Grid cell FEs", Y, "Month FEs", Y)
* add second treatment
reghdfe viirs trt1 trt2 i.month,cluster (pcbs_co month) absorb(cell_id)
outreg2 using myregnear.doc, append drop(i.month) addtext ("Grid cell FEs", Y, "Month FEs", Y)
* add third treatment
reghdfe viirs trt1 trt2 trt3 i.month,cluster (pcbs_co month) absorb(cell_id)
outreg2 using myregnear.doc, append drop(i.month) addtext ("Grid cell FEs", Y, "Month FEs", Y)
* nearest treatment
reghdfe viirs trt_near i.month, cluster (pcbs_co month) absorb(cell_id)
outreg2 using myregnear.doc, append drop(i.month) addtext ("Grid cell FEs", Y, "Month FEs", Y)
* interacts nearest treatment with continuous distance
reghdfe viirs trt_near#c.dist_trt_nearest i.month, cluster (pcbs_co month) absorb(cell_id)
outreg2 using myregnear.doc, append drop(i.month) addtext ("Grid cell FEs", Y, "Month FEs", Y)
* interacts nearest treatment with categorical distance (0-5)
reghdfe viirs trt_near#ibn.dist_trt_near_cat i.month, cluster (pcbs_co month) absorb(cell_id)
outreg2 using myregnear.doc, append drop(i.month) addtext ("Grid cell FEs", Y, "Month FEs", Y)