-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreg_3_RD_regressions_cov.do
59 lines (47 loc) · 1.79 KB
/
reg_3_RD_regressions_cov.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
//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) cov(mob cov_male)
regsave using "results/RD_cov_`1'_`2'.dta", replace detail(all) pval ci
//ds out_phys_m_act-out_highbloodpressure
ds cov_mother_alive cov_father_alive cov_num_brothers cov_breastfed cov_comp_bodysize8 cov_comp_height8 cov_matsmoking cov_birthweight
foreach i in `r(varlist)'{
rd `i' `2' , bw(12) mbw(100 200 300 400 500 600) kernel(rectangle) cluster(mobi) cov(mob cov_male)
regsave using "results/RD_cov_`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