-
Notifications
You must be signed in to change notification settings - Fork 1
/
PROJECT
154 lines (112 loc) · 4.57 KB
/
PROJECT
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
* ----------- REPLICATION PROJECT ----------
cd "/Users/josephinelaguardia/Desktop/micro_x/paper to replicate"
* ----------- DESCRIPTIVE STATISTICS --------
* Number of citizens and non-citizens immigrants over the years
use "daca_acs.dta"
keep if everimmig == 1
graph bar (count), over(noncitizen) by(year) ///
ylabel(, angle(0))
clear
* Mean number of children for teenage mothers
use "daca_acs.dta"
keep if everimmig == 1
* when we compute the mean of nchild while keeping the childless individuals
gr hbar nchild, over(noncitizen) over(year) ylabel(0(0.5)2)
* we can observe a significant gap between citizen and non-citizen immigrants
*but when we compute the same mean and dropping the childless observations
keep if nchild != 0
gr hbar nchild, over(noncitizen) over(year)
* surprisingly, the gap is now almost non-existant for all years. We can thus
* make an early assumption that DACA might impact individuals on the margin
* of their first birth.
* Replication of Figure 1: share of childless teenagers
use "daca_acs.dta"
* Let's compute the mean of "child0" for each year, differentiating between
* citizens and non citizens, and between Immigrants and Non-Immigrants.
collapse child0 [aweight=perwt], by(everimmig noncitizen year)
* Here [aweight = perwt] is the sampling weight. If wen don't use that weight
* we find completely different results.
gr tw ///
line child0 year if everimmig==1 & noncitizen ==0, lcolor(black) lp(dash) || ///
line child0 year if everimmig==1 & noncitizen ==1, lcolor(black) lp(solid) ///
legend(order(1 "Hispanic Immig. Citizens" 2 "Hispanic Immig. Non-Citizens")) ///
xtitle("Year") ///
ytitle("Share of 15-20 with No Children")
* ------------- REPLICATION : TABLE 1 -------
clear
use "daca_acs.dta"
keep if yrimmig <= 2007
keep if ageimmig <= 10
keep if everimmig == 1
* PANEL A: with past trend controls
* detrending
foreach y of varlist fertyr child0 nchild {
qui xi: reg `y' eligible year_elig year_nonelig if year < 2012 [aweight=perwt]
predict `y'_d, residuals
}
* regression on detrended data
local n = 1
foreach y of varlist fertyr_d child0_d nchild_d {
reg `y' eligible eligiblepost ageyr yrimmig c.year##statefip c.ageimmig##eligible [aweight=perwt]
estimates store d`n'
local n = `n' + 1
}
esttab d1 d2 d3 using "model1.tex", scalars(N) keep(eligiblepost) cells(b(star fmt(3)) (se(par fmt(3)))) ///
title("Table 1 : Effect of DACA on Teenage Fertility")
* PANEL B: without past trend controls
* not detrended
local i = 1
foreach y of varlist fertyr child0 nchild {
qui reg `y' eligible eligiblepost ageyr yrimmig c.year##statefip c.ageimmig##eligible [aweight=perwt]
qui summ `y' if eligible==1 & `y' !=.
estadd scalar Mean = r(mean)
estimates store m`i'
local i = `i' + 1
}
esttab m*, scalars(Mean N) keep(eligiblepost) cells(b(star fmt(3)) (se(par fmt(3))))
* export the table
esttab m* using "models.tex", ///
scalars(Mean N) keep(eligiblepost) cells(b(star fmt(3)) (se(par fmt(3))))
* ----------- REPLICATION : TABLE 2 -------------
clear
use "daca_yrbss.dta"
* detrending
* create necessary variables, from the previous repliaction
gen year_elig = year*highhispelig
gen non_elig = 1
replace non_elig = 0 if highhispelig == 1
gen year_nonelig = year*non_elig
foreach x of varlist noprot pill condom iudshot withd eversex sexact {
qui xi: reg `x' highhispelig year_elig year_nonelig if year<2012 [aweight=weight]
predict `x'_d, residuals
}
* regression
foreach x of varlist noprot_d pill_d condom_d iudshot_d withd_d eversex_d sexact_d {
qui xi: eststo s`x': reg `x' highhispeligpost i.statefip i.year [aweight=weight]
summ `y' if year <= 2012
estadd scalar Mean = r(mean)
}
esttab s* using "table2.tex", scalars(Mean N) keep(highhispeligpost) cells(b(star fmt(3)) (se(par fmt(3)))) ///
title("Table 2: Effect of DACA on pregnancy prevention and sexual behavior")
* ---- ADDITIONAL ANALYSIS -------
* checking for parallel trend assumption : placebo test
clear
use "daca_acs.dta"
keep if yrimmig <= 2007
keep if ageimmig <= 10
keep if everimmig == 1
* placebo year = 2010
gen post2 = 0
replace post2 = 1 if year > 2009
gen eligiblepost2 = eligible*post2
* regressions
local i = 1
foreach y of varlist fertyr child0 nchild {
qui reg `y' eligible eligiblepost2 ageyr yrimmig c.year##statefip c.ageimmig##eligible [aweight=perwt]
qui summ `y' if eligible==1 & `y' !=.
estadd scalar Mean = r(mean)
estimates store t`i'
local i = `i' + 1
}
esttab t*, scalars(Mean N) keep(eligiblepost2) cells(b(star fmt(3)) (se(par fmt(3))))
esttab t* using "placebotest.tex", scalars(Mean N) keep(eligiblepost2) cells(b(star fmt(3)) (se(par fmt(3))))