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;
You might find section 5.5 on this webpage useful:
https://stats.idre.ucla.edu/sas/seminars/sas-survival/
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 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!
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.