-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDifference in Difference Regression
50 lines (37 loc) · 1.44 KB
/
Difference in Difference Regression
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
insheet using "/Users/Abishekd/Downloads/samhda.csv"
// appendix: adol = ages 12-17, young = ages 18-25, all = all ages above 12
// dummy variable for marijuana legalization
gen weed = 1 if year >= 2014
replace weed = 0 if weed ==. & year !=.
// states
gen state = 0 if geo=="Washington"
replace state = 1 if geo=="SouthDakota"
// summary tables generation
summarize mjadol mjyoung mjall if (geo=="Washington" & weed ==0)
summarize mjadol mjyoung mjall if (geo=="SouthDakota" & weed ==0)
summarize mjadol mjyoung mjall if (geo=="Washington" & weed ==1)
summarize mjadol mjyoung mjall if (geo=="SouthDakota" & weed ==1)
summarize riskadol riskyoung riskall if (geo=="Washington" & weed ==0)
summarize riskadol riskyoung riskall if (geo=="SouthDakota" & weed ==0)
summarize riskadol riskyoung riskall if (geo=="Washington" & weed ==1)
summarize riskadol riskyoung riskall if (geo=="SouthDakota" & weed ==1)
// T test
ttest mjadol if legal==0, by (state)
ttest mjyoung if legal==0, by (state)
ttest mjall if legal==0, by (state)
ttest mjadol if legal==1, by (state)
ttest mjyoung if legal==1, by (state)
ttest mjall if legal==1, by (state)
// Washington State
gen wa = 1 if geo == "Washington"
replace wa = 0 if co ==.
gen d = 1 if wa == 1 & legal == 1
replace d= 0 if d ==.
drop if state ==.
// Difference in Difference Regression
reg mjadol wa$$weed
reg mjyoung wa$$weed
reg mjall wa$$weed
reg riskadol wa$$weed
reg riskyoung wa$$weed
reg riskall wa$$weed