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

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Re: Creating an adjusted Kaplan Meier plot for a model containing time...

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 07-25-2019 02:02 PM
(3560 views)

Hello,

I need to create an adjusted KM plot for a model containing a time varying covariate. I know I need to use proc phreg to get the survival estimates. However, the "baseline" option in proc phreg does not allow me to output survival estimates if there is a time varying covariate. Is there a way to obtain an adjusted KM curve when there is a time varying covariate in the model? I appreciate any help you can offer

example of my code:

proc phreg data = final;

class region (ref='North') insurance (ref='commercial') gender (ref='female') previous_treatment(ref='no');

model time*cens(0) = plant age region insurance gender previous_treatment/ties=RL;

if wait>time or wait=. then plant=0;

else plant= 1;

run;

6 REPLIES 6

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

You might find section 5.5 on this webpage useful:

https://stats.idre.ucla.edu/sas/seminars/sas-survival/

Norman.

SAS 9.4 (TS1M6) X64_10PRO WIN 10.0.17763 Workstation

SAS 9.4 (TS1M6) X64_10PRO WIN 10.0.17763 Workstation

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi all,

I have the same question. I run similar model but use the counting process approach - restructure data.

My questions are:

Can I use the option [baseline] to get the estimates?

If that works (I run and no error appears), how can I get the curves by treatment group in this case (counting process approach).

Thank you!

Hao

**proc** **phreg** data=table1;

class treatment(ref='0') Age_cat3(ref='0') sex (ref='0') Ethnicity (ref='0');

model (start_final,stop_final)*outcome(**0**)= treatment Age_cat3 sex Ethnicity

Crea HB BILI_c ALB_c/RL;

**run**;

***GET SURVIVAL ESTIMATES;

**proc** **phreg** data=table1;

class treatment(ref='0') Age_cat3(ref='0') sex (ref='0') Ethnicity (ref='0');

model (start_final,stop_final)*outcome(**0**)= Age_cat3 sex Ethnicity Crea HB BILI_c ALB_c/RL;

strata treatment;

baseline out=dataest survival=survival/nomean;

**run**;

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hi, I have the similar problem as yours, I am wondering that did you find a way to solve this problems? Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

My latest discussion on this matter with the PHREG developer revealed the following sentiments:

"Currently PROC PHREG does not estimate the survival function when there are time-dependent covariates. It is a bit controversial whether it is doable (for example, Fisher and Lin (1999)). My feeling is that it is doable in some situations (for example when all td-covariates are external). Such an implementation will require new syntax to input a profile (trajectory over time) for each time-dependent covariate. In the meantime, I will discuss ideas with my colleagues and our research into this topic is ongoing. If you have any references to share with us, by all means, please do so."

I'm sorry to have to give you such bad news but there isn't really a way to plot survival curves for time-dependent covariates.

"Currently PROC PHREG does not estimate the survival function when there are time-dependent covariates. It is a bit controversial whether it is doable (for example, Fisher and Lin (1999)). My feeling is that it is doable in some situations (for example when all td-covariates are external). Such an implementation will require new syntax to input a profile (trajectory over time) for each time-dependent covariate. In the meantime, I will discuss ideas with my colleagues and our research into this topic is ongoing. If you have any references to share with us, by all means, please do so."

I'm sorry to have to give you such bad news but there isn't really a way to plot survival curves for time-dependent covariates.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thank you so much, at least I don't need to waste time on this anymore, guess I will have to use other software either SPSS or R to create survival curve with time-dependent variables.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

@SAS-questioner wrote:

Thank you so much, at least I don't need to waste time on this anymore, guess I will have to use other software either SPSS or R to create survival curve with time-dependent variables.

Re-read the previous post more closely. It is saying not only does PHREG not support it, but the statistics behind even attempting to produce it is not settled. So if some other package claims to produce such an analysis be very careful to understand exactly what that software is doing and make sure your data actually is compatible with the assumptions.

Are you ready for the spotlight? We're accepting content ideas for **SAS Innovate 2025** to be held May 6-9 in Orlando, FL. The call is **open **until September 25. Read more here about **why** you should contribute and **what is in it** for you!

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.