-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCJM_2020_JASA.do
66 lines (56 loc) · 2.47 KB
/
CJM_2020_JASA.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
********************************************************************************
* Empirical Illustration
* M.D. Cattaneo, M. Jansson, X. Ma
* 21-AUG-2020
********************************************************************************
* net install rddensity, from(https://raw.githubusercontent.com/rdpackages/rddensity/master/stata) replace
* net install lpdensity, from(https://raw.githubusercontent.com/nppackages/lpdensity/master/stata) replace
********************************************************************************
********************************************************************************
* NOTE: If you are using RDDENSITY version 2020 or newer, the option "nomasspoints" may be needed to
* replicate the results in the paper. For example:
*
* rddensity X
*
* should be replaced by:
*
* rddensity X, nomasspoints
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
* Headstart Data
********************************************************************************
********************************************************************************
clear all
set more off
**********************************
* import data
**********************************
use "headstart.dta"
preserve
replace povrate60 = povrate60 - 59.198
**********************************
* manipulation test with different bandwidths on each side
**********************************
rddensity povrate60, p(1) bwselect(each)
rddensity povrate60, p(2) bwselect(each)
rddensity povrate60, p(3) bwselect(each)
**********************************
* manipulation test with common bandwidth for both sides
**********************************
rddensity povrate60, p(1) bwselect(diff)
rddensity povrate60, p(2) bwselect(diff)
rddensity povrate60, p(3) bwselect(diff)
**********************************
* density plot, different bandwidths with local quadratic fit
**********************************
rddensity povrate60, p(2) bwselect(each) ///
plot plot_range(-40 20) plot_n(100 100) ///
graph_options(xtitle("Running Variable") legend(off) yscale(r(0 0.035)))
**********************************
* histogram
**********************************
hist povrate60, xline(0) xtitle("Running Variable") ytitle("") legend(off) ///
yscale(r(0 0.035))
restore