Hi all,
We are using Kaplan Meier method to model bridge deterioration. What I exactly want is to get smoothed curve output for survival and deterioration as an output in order to prepare graphs in graphing software. I could not generate nice survival plots using SAS. I know smoothed curves for other methods in proc LIFETEST are available, but not available for Kaplan Meier.
Could anyone give me a link to a macro or write me a macro to output the Kernel smoothed curve for Kaplan Meier data points?
Thanks,
Please provide the code you are using. If you can provide sample data, that's even better.
Thank you @Reeza and @Rick_SAS for your time and interest to help.
The following is the code i am using.
title;
proc LIFETEST method=km data=xx.WI_nbi_psc_super_ticr plots=s(cb=ep)OUTSURV=xx.PSC_Survival;* (atrisk);
TIME count*CENSOR(0);
strata SUPERSTRUCTURE_COND_059;
label count="Time in Condition Rating (Year)";
run;
The data file I used in the above code is attached. The code output and graphs are attached too. I want to smooth the step curves using Kernel smoothing method and have it as an output similar to the code output and possibly overlay it on the graph.
Thanks,
Although it is possible to apply a smoother to the points in the K-M graph, I don't recommend it. Smoothers are based on nonparametric regression methods that assume a relationship between the X and Y variables. The predicted values and confidence intervals for a smoother are based on assumptions that probably do not hold for the K-M points.
If you decide to proceed anyway, you can use the LOESS or PBSPLINE statements in PROC SGPLOT to overlay a smoother on the data. For example, here is a PBSPLINE smoother:
proc lifetest method=km data=sashelp.BMT plots=s(cb=ep) OUTSURV=PSC_Survival;
time T * Status(0);
strata Group;
run;
proc sort data=PSC_Survival;
by Group T;
run;
proc sgplot data=PSC_Survival;
band x=T lower=SDF_LCL upper=SDF_UCL / group=Group transparency=0.6;
pbspline x=T y=Survival / group=Group; /* or use LOESS */
run;
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.