BookmarkSubscribeRSS Feed
chinna0369
Pyrite | Level 9

The survival times (weeks since exposure to death) are: 18, 23, 25, 26, 29*, 30, 30, 31, 31*, 32* 

*starred quantities denote censored observations.

Question. Calculate Kaplan-Meier (K-M) Estimator by creating a table including the following columns: Time, Event, Censored, At Risk, and Cumulative Survival. 

 
Thanks in advance!
 
4 REPLIES 4
Rick_SAS
SAS Super FREQ

Your teacher gave you this question to make sure that you understand the principles of the K-M curve. Use your class notes or textbook to construct the table. The data are already sorted, so the first column (Time) is given to you. Use 0/1 in the Event and Censored columns to indicate whether each Time was an observed event (death) or was the result of censoring. Good luck!

 

 

FreelanceReinh
Jade | Level 19

Hello @chinna0369,

 

I fully agree with @Rick_SAS. Only if you really get stuck, you may peek under the spoiler to find a few hints.

Spoiler

Start with column "Time": These are the eight distinct values you've already listed (i.e., without the duplicates).

 

For each of the eight time values enter the number of events (=deaths) in column "Event". Remember that each number without a star in your list corresponds to one death. Apparently, for your data this column will only contain values in {0, 1, 2}.

 

Similarly, populate column "Censored" with the number of times a time value occurs with a star in your list. Apparently, for your data this column will only contain values in {0, 1}.

 

Column "At Risk" contains the number of subjects who have neither died nor been censored just prior to the respective point in time. That is, at the first time value (18) it's the full number of subjects under study (10). At the second time value (23) the subject who died at time 18 is no longer at risk, hence only 9 are left, and so on. The numbers in this column will be strictly decreasing. The decrement is always the sum of the values in columns "Event" and "Censored" of the previous row.

 

Finally, compute the Kaplan-Meier estimates. Even if you're not allowed to use SAS, you can still use the SAS documentation. So, for your exercise: open the documentation of PROC LIFETEST, click on "Details", then "Computational Formulas" and finally "Breslow, Fleming-Harrington, and Kaplan-Meier Methods". The third formula in this subsection tells you how to calculate the Kaplan-Meier estimator Ŝ(ti), i.e., column "Cumulative Survival" of your table. The ti in the formula are the time values (actually only the event times, but it's no problem that your table contains the censored survival times as well), the di are the numbers of events and the Yi are the subjects at risk. So, you have all these in your table already (plus the number of censored subjects, say, ci, but these aren't used in the formula). The index i goes from 1 to 8 (or 0 to 8 if you like to insert a row with t0=0 and Ŝ(ti)=1). For example, Ŝ(t1)=1−d1/Y1=1−1/10=0.9. The subsequent values Ŝ(ti), i=2, 3, ..., are obtained by multiplying the previous value Ŝ(ti-1) by (1−di/Yi). So, the results are decreasing (but not strictly decreasing in cases where di=0).

chinna0369
Pyrite | Level 9
Hi,

Thank you for your response. I was little confused at events column. Could you please check my below answer and let me know if anything!
Time
(years) # events (dj ) # censored # at risk (nj ) Survival (Sˆ(t)
18 1 1 10 1-1/10 = 0.9
23 1 1 9 9/10 * 8/9 = 0.8
25 1 1 8 9/10 * 8/9*7/8 = 0.7
26 1 1 7 9/10 * 8/9*7/8*6/7 = 0.6
29 0 0 5 9/10 * 8/9*7/8*6/7*5/5= 0.6
30 2 1 4 9/10 * 8/9*7/8*6/7*5/5*2/4 =0.3
31 1 0 2 9/10 * 8/9*7/8*6/7*5/5*2/4*1/2=0.15
32 1 0 1 9/10 * 8/9*7/8*6/7*5/5*2/4*1/2*0 = 0

Thanks in advance!
Adithya
FreelanceReinh
Jade | Level 19
  • The unit of the time column is weeks, not years, but the numbers are correct.
  • The event counts are correct, except for the last one.
  • The numbers of censored cases are inverted (1 <--> 0).
  • You should double-check the numbers of subjects at risk starting from t=29.
  • The last three K-M estimates will change once the corrections are implemented.

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 790 views
  • 3 likes
  • 3 in conversation