Date: Mon, 9 Jul 2001 07:46:08 -0700 "Smith, Curtis, Mr, DCAA" "SAS(r) Discussion" "Smith, Curtis, Mr, DCAA" Re: Cox, curves To: Anna Hagman text/plain; charset="iso-8859-1"

You might check Tyler Smith's work on Cox analysis. He has papers at SUGI 26 and I think at SUGI 25. Check the SAS web site for the on-line SUGI papers.

-----Original Message----- From: Anna Hagman [mailto:Anna.Hagman@MEDHS.KI.SE] Sent: Sunday, July 08, 2001 11:42 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Cox, curves

Dear all,

I can't find the error in my program (below), can anyone help me?

I want to plot the curves I can get in Cox proportional hazards function (proc phreg), the estimated survival curves.

The problem is that I get a line from the last observation in each group that goes to "the beginning of the graph" (left top corner), and I also recieve the values of a "fifth group/average of the groups" in the plot. I can't get rid of them.

With best regards

Anna

data var1; set allo2; sexage=sex*age;

keep sex age sexage;

run; /* Makes a dataset with the covariates of the Cox analyse. */

/* sex=males and females, age=I or II. */

proc phreg data=allo2; sexage=sex*age;

model survm*censored(1)=sex age sexage/risklimits;

baseline covariates=var1 survival=survival out=allo2a;

run;

/* Making the Cox analyse and putting the covariates and survival estimates in out=allo2a. Or at least trying to do that, it looks strange because it's 521 observations in allo2 and 24384 "observations" in allo2a and there is a average or something like that for the covariates in the bottom of the out=allo2a. And these "average values" are printed in the plot. */

data pred1; set allo2a;

if age=1 and sex=1 then Pattern=1;

else if age=1 and sex=0 then Pattern=2;

else if age=0 and sex=1 then Pattern=3;

else if age=0 and sex=0 then Pattern=4;

legend1 label=none shape=symbol(3, 0.8)

value=(f=swiss h=0.8 'age1 and sex1' 'age1 sex0' 'age0 sex1' 'age0 sex0');

axis1 label=(h=1 f=swiss a=90) minor=(n=1);

axis2 label=(h=1 f=swiss 'Survival times in months') minor=(n=4);

run;

proc gplot data=pred1;

plot survival*survm=Pattern / legend=legend1 vaxis=axis1 haxis=axis2 cframe=ligr;

symbol1 interpol=stepLJ h=1 v=square c=blue;

symbol2 interpol=stepLJ h=1 v=diamond c=yellow;

symbol3 interpol=stepLJ h=1 v=square c=red;

symbol4 interpol=stepLJ h=1 v=diamond c=black;

run;

Back to: Top of message | Previous page | Main SAS-L page