Hello,
I've patients' disease recurrence data, I want to create Kaplan curve for this data, I used the following code.
proc lifetest data= DATA;
time Rec_Index;
run;
30% have a recurrence and the rest don't have a recurrence so their Rec_Index (time to recurrence) = NULL. Using the above code, I'm getting the Kaplan survival curve for the 30% recurred patients, but I'm looking for the entire patients. Can you help me with this?
Thanks!
You can't have them as null and you haven't specified an event. I would highly suggest reviewing the latest examples in PROC LIFETEST and seeing how the data needs to be structured and how your code would look.
You should have code that looks like the following;
time Survival_Time * Indicator_Variable (1);
Where survival time is the time at which point they either are censored or 'failed'.
The Indicator variable is your variable that indicates if that record is censored or now, and the event is defined as 1 means it's censored.
Hello Reeza,
Patients without time, i.e. NULL isn't actually censored, they just didn't get a recurrent disease for the study time period. I could find code that will help me.
Thanks
--Sujith
Patients without time, i.e. NULL isn't actually censored, they just didn't get a recurrent disease for the study time period.
You still need a time otherwise you can't do the analysis you're asking. The time would be from sign up to loss of follow up or when you stopped tracking.
Here is what I'm looking for, below picture I created using excel (manually entering values). Out of say 100 patients only 25 got a recurrent disease, I want to show the % patients didn't get recurrent disease for each time interval. Is there any other alternative way I can get this kind of graph?
Thanks
Here's an example of how to do it. I created sample data. If you need further help please post an example of your data. It does not need to be real, but it does need to be reflective of your actual data.
*Create random data with 30% censored;
data random;
do i=1 to 100;
surv_time = rand('uniform')*36+1;
censor = rand('bernoulli', 0.3);
output;
end;
run;
*run life model with output for specific time intervals;
proc lifetest data=random timelist=(0 to 36 by 12);;
time surv_time * censor(1);
run;
Hello Reeza,
Your answer is right if I'm looking only patients that got a recurrent disease, but I want to plot for all the patients in my data. If you observe my graph, the Kaplan graph doesn't come to zero because I plotted for all the patients, just not the ones that got a recurrent disease.
Thanks for trying to help me, I appreciate!
--Sujith
Post sample data. If you have a second variable which is the 'recurrent' disease rather than your actual 'censor' then you would put that in as a STRATA statement.
Patients come from a 4 years claims data and they have a continuous medical enrollment so their 4 year longitudinal followup isn't censored. The data looks like this, I think you can create a random generated data set like in your previous reply. This is how I created my previous graph: https://www.youtube.com/watch?v=065ihPegqXo
Patients_ID Recurrence Time_to_Recurrence
12345 Yes 128
12346 Yes 320
12347 No
12348 Yes 98
You still a need a time for the people who didn't recur otherwise this analysis doesn't make sense. You're not comparing anything valid. If that's what you're after, just split the time using a format on it and use PROC FREQ to calculate the percentages in each interval.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.