1 / 21

EPI 5344: Survival Analysis in Epidemiology SAS Code for Cox models March 18 , 2014

EPI 5344: Survival Analysis in Epidemiology SAS Code for Cox models March 18 , 2014. Dr. N. Birkett, Department of Epidemiology & Community Medicine, University of Ottawa. SAS code (1). Cox models use Proc PHREG I assume that you all have at least Version 9.2 of SAS

kaia
Download Presentation

EPI 5344: Survival Analysis in Epidemiology SAS Code for Cox models March 18 , 2014

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EPI 5344:Survival Analysis in EpidemiologySAS Code for Cox modelsMarch 18, 2014 Dr. N. Birkett, Department of Epidemiology & Community Medicine, University of Ottawa

  2. 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

  3. 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. 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;

  5. Breslow Efron Exact

  6. Breslow Efron Exact

  7. Breslow Efron & Exact

  8. 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;

  9. Reference coding

  10. 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:

  11. 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;

  12. Effect coding

  13. Three-level class variable • Just for test purposes, define a 3 level variable • combines race and financial aid:

  14. 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;

  15. Reference coding

  16. Effect coding

  17. Ortho-polynomial coding

More Related