-
Notifications
You must be signed in to change notification settings - Fork 7
/
Cox_model.sas
59 lines (54 loc) · 1.32 KB
/
Cox_model.sas
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
* Written by R;
* write.foreign(national_merged2016, datafile = "/nfs/home/X/xwu/shared_space/ci3_nsaph/XiaoWu/National_Causal/data2016/national_merged2016.csv", ;
DATA national2016 ;
LENGTH
zip $ 5
dual $ 1
statecode $ 2
region $ 9
;
INFILE "/nfs/home/X/xwu/shared_space/ci3_nsaph/XiaoWu/National_Causal/data2016_temp/national_merged2016.csv"
DSD
LRECL= 324 ;
INPUT
year
zip
sex
race
age
dual
entry_age_break
statecode
followup_year
followup_year_plus_one
dead
pm25_ensemble
mean_bmi
smoke_rate
hispanic
pct_blk
medhouseholdincome
medianhousevalue
poverty
education
popdensity
pct_owner_occ
summer_tmmx
winter_tmmx
summer_rmax
winter_rmax
region $
;
RUN;
/****************************************************/
/*full analysis*/
ODS HTML FILE='national_main_2016.html' path='/nfs/home/X/xwu/shared_space/ci3_xwu/National_Causal/Code2016_temp/';
PROC phreg data=national2016;
class region entry_age_break year/ ref=first;
model (followup_year,followup_year_plus_one)* dead(0) = pm25_ensemble mean_bmi smoke_rate
hispanic pct_blk medhouseholdincome medianhousevalue poverty
education popdensity pct_owner_occ summer_tmmx winter_tmmx summer_rmax winter_rmax region year/rl ties=efron;
strata entry_age_break sex race dual;
title "with year and temp;main analysis 2000-2016";
run;
ODS HTML CLOSE;