BookmarkSubscribeRSS Feed
lousam
Obsidian | Level 7

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
Norman21
Lapis Lazuli | Level 10

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

haoduonge
Quartz | Level 8

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;

 

SAS-questioner
Obsidian | Level 7
Hi, I have the similar problem as yours, I am wondering that did you find a way to solve this problems? Thank you!
OsoGris
SAS Employee
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.

SAS-questioner
Obsidian | Level 7
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.
Tom
Super User Tom
Super User

@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.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 6 replies
  • 3594 views
  • 5 likes
  • 6 in conversation