Presentation is loading. Please wait.

Presentation is loading. Please wait.

01/20151 EPI 5344: Survival Analysis in Epidemiology SAS Code for Cox models March 17, 2015 Dr. N. Birkett, School of Epidemiology, Public Health & Preventive.

Similar presentations


Presentation on theme: "01/20151 EPI 5344: Survival Analysis in Epidemiology SAS Code for Cox models March 17, 2015 Dr. N. Birkett, School of Epidemiology, Public Health & Preventive."— Presentation transcript:

1 01/20151 EPI 5344: Survival Analysis in Epidemiology SAS Code for Cox models March 17, 2015 Dr. N. Birkett, School of Epidemiology, Public Health & Preventive Medicine, University of Ottawa

2 01/20152 SAS code (1) Cox models use Proc PHREG –I assume that you all have at least Version 9.2 of SAS Prior to this version, ‘phreg’ was more limited An experimental version (tphreg) could be used instead. BUT, I strongly encourage you to upgrade to at least SAS 9.2 –Current version is 9.4

3 01/20153 libname allison 'C:/allison_2010/data_sets'; PROC PHREG DATA=allison.recid; MODEL week*arrest(0)=fin age race wexp mar paro prio; RUN;

4 01/20154

5 5

6 6

7 7 title 'Ties Handling: BRESLOW'; PROC PHREG DATA=allison.recid; MODEL week*arrest(0)=fin age race wexp mar paro prio / TIES=BRESLOW; RUN; title 'Ties Handling: EFRON'; PROC PHREG DATA=allison.recid; MODEL week*arrest(0)=fin age race wexp mar paro prio / TIES=EFRON; RUN; title 'Ties Handling: EXACT’; PROC PHREG DATA=allison.recid; MODEL week*arrest(0)=fin age race wexp mar paro prio / TIES=EXACT; RUN;

8 01/20158 Breslow Efron Exact

9 01/20159 Breslow Efron Exact

10 01/201510 Breslow Efron & Exact

11 01/201511 PROC PHREG DATA=allison.recid; class fin /param=ref ref=last ; MODEL week*arrest(0)=fin age race wexp mar paro prio / TIES=EFRON; RUN; PROC PHREG DATA=allison.recid; class fin /param=effect ; MODEL week*arrest(0)=fin age race wexp mar paro prio / TIES=EFRON; RUN;

12 01/201512 Reference coding

13 An issue with ref coding (1) By default, SAS orders the levels of a categorical variable by the ‘format’ labels if they have been assigned. Consider: 01/201513 CategoryFormatOrder 1low2 2in-between1 3most3

14 An issue with ref coding (2) You want to use ‘level=1’ as the reference. This SAS code won’t do that: class x/param=ref ref=first; Instead, the reference will be level 2. You must use this code: class x/param=ref ref=first order=internal; 01/201514

15 01/201515 Effect coding

16 Three-level class variable Just for test purposes, define a 3 level variable –combines race and financial aid: 01/201516 RaceFinancial aidRacefin 001 011 102 113

17 01/201517 PROC PHREG DATA=njb1; class racefin /param=ref ref=last ; MODEL week*arrest(0)=racefin age / TIES=EFRON; RUN; PROC PHREG DATA=njb1; class racefin /param=effect ; MODEL week*arrest(0)=racefin age / TIES=EFRON; RUN; PROC PHREG DATA=njb1; class racefin /param=orthopoly ; MODEL week*arrest(0)=racefin age / TIES=EFRON; RUN;

18 01/201518 Reference coding

19 01/201519 Effect coding

20 01/201520 Ortho-polynomial coding

21 01/201521


Download ppt "01/20151 EPI 5344: Survival Analysis in Epidemiology SAS Code for Cox models March 17, 2015 Dr. N. Birkett, School of Epidemiology, Public Health & Preventive."

Similar presentations


Ads by Google