BookmarkSubscribeRSS Feed
Sujithpeta
Quartz | Level 8

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!

9 REPLIES 9
Reeza
Super User

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.

 

http://documentation.sas.com/?docsetId=statug&docsetTarget=statug_lifetest_syntax07.htm&docsetVersio...

Sujithpeta
Quartz | Level 8

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

Reeza
Super User

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. 

 

Sujithpeta
Quartz | Level 8

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?

Capture.PNG

 

 

Thanks 

 

 

Reeza
Super User

 

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;
Sujithpeta
Quartz | Level 8

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

Reeza
Super User

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. 

Sujithpeta
Quartz | Level 8

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

Reeza
Super User

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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 9 replies
  • 1716 views
  • 0 likes
  • 2 in conversation