/* --------------------------------------------------------- program: PBC4-v92.SAS input: pbc.sas7bdat does: Time dependent covariates in Cox regression and test for proportionality ------------------------------------------------------------ */; libname out 'H:\bios180\coursepack\SAS-unc-workshop-2008\'; *********************************************; DATA A; SET out.PBC; run; ***************************************************; * Now look at whether there is strong evidence that; * the relative risk comparing presence and absence ; * of hepatomegaly varies over time. *; ***************************************************; proc phreg data=A; model time*delta(0)=age hepa hepat; hepat=hepa*time; run; ********************************************************; * Questions: ; * ; * 1) Is it OK to fit time in an interaction term when * there is no main effect for it included? * Why or why not? ; * ; * 2) What is the RR for dying from PBC comparing presence * and absennce of hepatomegaly according to this * model? At 1000 days? At 2000 days? ; ********************************************************; * Now look to see if there is evidence of the non- * proportionality of the hazards for the presence and * absence of hepatomegaly in plots of the baseline ; * hazards for those two 'strata'. ; ********************************************************; title2 'Stratified Cox Regression for PBC data'; proc phreg data=A; model time*delta(0)=age; strata hepa; baseline out=B survival=s logsurv=ls loglogs=lls; run; proc sgplot data=B; step y=lls x=time /group=hepa ; run;