BookmarkSubscribeRSS Feed
Sairampulipati
Fluorite | Level 6

Hi everyone,

 

I want to know which cumulative hazard we will get when run the code for Cox-Snell Residual Plots.

Is it Kaplan-Meier(Green wood) method cumulative hazard or Nelson Aalen method cumulative hazard.

I am giving the code can anyone please help me which method cumulative hazard it has taken.

If it is taken for Kaplan Meier Method then how will get for Nelson Aalen method and vice versa.

 

SAS Code

/*Exponential Distribution*/

proc lifereg data=bc.data;
model survivaltimenew*DEATH(0)=recu mets clinstage par agegr/dist=exponential;
output out=csr1expo xbeta=xb cres=cr;
run;
proc lifetest data=csr1expo outsurv=surv1expo;
time cr*DEATH(0);
run;
data surv1expo1;
set surv1expo;
hkm=-log(survival);
run;
goptions reset=all;
title "Exponential Distribution";
symbol1 v=none i=join line=1 c=black ci=black;
symbol2 v=none i=join line=2 c=black ci=black;
axis1 label=(a=90 'Cumulative Hazard') minor=none;
axis2 label=('Cox-Snell Residuals') minor=none;
proc gplot data=surv1expo1;
plot (cr hkm)*cr/ overlay vaxis=axis1 haxis=axis2 noframe;
run;
quit;

 

/*Cox PH or Cox Regression*/
proc phreg data=bc.data;
model survivaltimenew*DEATH(0)=recu mets clinstage par agegr;
output out=coxph logsurv=h /method=ch;
run;
data coxph1;
set coxph;
h=-h;
cons=1;
run;
proc phreg data=coxph1;
model h*DEATH(0)=cons;
output out=ph logsurv=ls /method=ch;
run;
data ph1;
set ph;
haz=-ls;
run;
proc sort data=ph1;
by h;
run;
title "Cox PH Model";
axis1 minor=none;
axis2  minor=none label=(a=90);
symbol1 i=join c=black line=2;
symbol2 i=join c=black line=1;
proc gplot data=ph1;
plot haz*h =1 h*h=2 /overlay haxis=axis1 vaxis=axis2 noframe;
label haz="Cumulative Hazard";
label h="Cox-Snell Residuals";
run;

 

 

Hope to see get early reply and get this query solved by as soon as possible from SAS community

 

Regards

Sairam Pulipati

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 3214 views
  • 0 likes
  • 1 in conversation