turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- Plotting an adjusted -log(log survival) vs log(tim...

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-15-2018 11:36 AM

Hello,

I am trying to see if non-proportionality exists for a cox proportional hazards model that is adjusted for multiple factors and is stratified by gender using a plot of -log(log survival) vs. log (time). I would like to include a plot in my final submission.

I know that I can't use "proc lifetest" because that can't adjust for other factors. I am thinking that I might have to do something like the code below and then use proc gplot to graph log(-log survival) vs. log(time). How can I create the plot that I need?

proc phreg data=final;

model Survival_time*sensor(0)= Age BMI Smoking/ties=exact;

strata Gender;

Title "Cox proportional hazards model stratified by Gender";

baseline out=graph loglogs=llog survival=surv logsurv=lsur; run;

proc gplot data=graph;

plot llog*(I DON'T KNOW HOW TO GET THE LOG TIME)=Gender

I appreciate any help you can give me

Accepted Solutions

Solution

04-17-2018
12:32 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to lousam

04-15-2018 02:18 PM

Calculate it manually in a step in between the procedures.

Also, you should likely use SGPLOT instead of GPLOT.

The documentation has the sample data for VALung here:

http://documentation.sas.com/api/docsets/statug/14.3/content/statug_code_phrex3.htm?locale=en

PHREG documentation here:

```
*Survival model;
proc phreg data=VALung;
strata therapy;
class Prior(ref='no') Cell(ref='large') / param=ref;
model Time*Status(0)=Kps Duration Age Cell Prior;
baseline out=graph_data1 loglogs=llog survival=surv logsurv=lsur;
run;
*Calculate log of time;
data graph_data2;
set graph_data1;
if time=0 then
log_time=0;
*cannot take the log of 0;
else
log_time=log(time);
run;
*Graph results;
proc sgplot data=graph_data2;
series x=log_time y=lsur / group=therapy markers;
run;
```

@lousam wrote:

Hello,

I am trying to see if non-proportionality exists for a cox proportional hazards model that is adjusted for multiple factors and is stratified by gender using a plot of -log(log survival) vs. log (time). I would like to include a plot in my final submission.

I know that I can't use "proc lifetest" because that can't adjust for other factors. I am thinking that I might have to do something like the code below and then use proc gplot to graph log(-log survival) vs. log(time). How can I create the plot that I need?

proc phreg data=final;

model Survival_time*sensor(0)= Age BMI Smoking/ties=exact;

strata Gender;

Title "Cox proportional hazards model stratified by Gender";

baseline out=graph loglogs=llog survival=surv logsurv=lsur; run;

proc gplot data=graph;

plot llog*(I DON'T KNOW HOW TO GET THE LOG TIME)=Gender

I appreciate any help you can give me

All Replies

Solution

04-17-2018
12:32 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to lousam

04-15-2018 02:18 PM

Calculate it manually in a step in between the procedures.

Also, you should likely use SGPLOT instead of GPLOT.

The documentation has the sample data for VALung here:

http://documentation.sas.com/api/docsets/statug/14.3/content/statug_code_phrex3.htm?locale=en

PHREG documentation here:

```
*Survival model;
proc phreg data=VALung;
strata therapy;
class Prior(ref='no') Cell(ref='large') / param=ref;
model Time*Status(0)=Kps Duration Age Cell Prior;
baseline out=graph_data1 loglogs=llog survival=surv logsurv=lsur;
run;
*Calculate log of time;
data graph_data2;
set graph_data1;
if time=0 then
log_time=0;
*cannot take the log of 0;
else
log_time=log(time);
run;
*Graph results;
proc sgplot data=graph_data2;
series x=log_time y=lsur / group=therapy markers;
run;
```

@lousam wrote:

Hello,

I am trying to see if non-proportionality exists for a cox proportional hazards model that is adjusted for multiple factors and is stratified by gender using a plot of -log(log survival) vs. log (time). I would like to include a plot in my final submission.

I know that I can't use "proc lifetest" because that can't adjust for other factors. I am thinking that I might have to do something like the code below and then use proc gplot to graph log(-log survival) vs. log(time). How can I create the plot that I need?

proc phreg data=final;

model Survival_time*sensor(0)= Age BMI Smoking/ties=exact;

strata Gender;

Title "Cox proportional hazards model stratified by Gender";

baseline out=graph loglogs=llog survival=surv logsurv=lsur; run;

proc gplot data=graph;

plot llog*(I DON'T KNOW HOW TO GET THE LOG TIME)=Gender

I appreciate any help you can give me