-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreg_2_RD_regressions.do
58 lines (46 loc) · 1.62 KB
/
reg_2_RD_regressions.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
//Neil Davies 09/07/15
//This conducts the UK Biobank RD regressions:
cd "/Volumes/Height_BMI_and_schooling/UK Biobank - ROSLA/"
//Create program for estimating RD regressions
cap prog drop rd_rosla
prog def rd_rosla
preserve
if "`1'"=="male"{
keep if male==1
}
if "`1'"=="female"{
keep if male==0
}
rd out_phys_v_act `2' , bw(12) mbw(100 200 300 400 500 600) kernel(rectangle) cluster(mobi)
regsave using "results/RD_`1'_`2'.dta", replace detail(all) pval ci
ds out_phys_m_act-out_highbloodpressure
foreach i in `r(varlist)'{
rd `i' `2' , bw(12) mbw(100 200 300 400 500 600) kernel(rectangle) cluster(mobi)
regsave using "results/RD_`1'_`2'", append detail(all) pval ci
}
restore
end
use "working data/cleaned_biobank_outcomes_ENGLISH",clear
foreach j in all male female{
foreach k in rosla rosla_neg1 rosla_neg2{
rd_rosla `j' `k'
}
}
use "results/RD_all_rosla",clear
order depvar N coef ci_lower ci_upper pval
use "results/RD_male_rosla",clear
order depvar N coef ci_lower ci_upper pval
use "results/RD_female_rosla",clear
order depvar N coef ci_lower ci_upper pval
use "results/RD_all_rosla_neg1",clear
order depvar N coef ci_lower ci_upper pval
use "results/RD_male_rosla_neg1",clear
order depvar N coef ci_lower ci_upper pval
use "results/RD_female_rosla_neg1",clear
order depvar N coef ci_lower ci_upper pval
use "results/RD_all_rosla_neg2",clear
order depvar N coef ci_lower ci_upper pval
use "results/RD_male_rosla_neg2",clear
order depvar N coef ci_lower ci_upper pval
use "results/RD_female_rosla_neg2",clear
order depvar N coef ci_lower ci_upper pval