# How to use a Kaplan Meier graph for prediction?

I'm dabbling in survival analysis, applied to cars. I created a survival graph based on age using Kaplan-Meier, in lifelines (python library). However, guidance on how to apply that graph to inference seems a bit thin (or I'm dense ;-) ) so I would like to ask you to validate my current calculation of how many cars will still be on the road next year, given my data, collected about cars for the last few years. The Kaplan-Meier graph describes the survival of a car related to its age. I interpret that as describing the average 'walk of life' of a car.

My calculation for the amount of cars surviving until next year is : I have a population of cars on the road now. so for their current age, they have survived with probability 1. Now, their chance to reach next year, using the survival graph based on age, is (I think) : value[next year]/value[this year]. then I sum up this ratio for all cars currently still on the road, and that gives me the amount of cars expected to be on the road next year.

Please let me know if this is a valid way to estimate the amount of cars still on the road next year, given their age. Or what calculation you would apply.

For bonus points : I'm adding up survival probabilities of individual cars (or age-groups if you want) with different confidence intervals. is there any way to calculate the overall confidence interval for the total of surviving cars ? I now take the maximum interval encountered, as a sort of worst-case guess.

Initially I just looked up the numbers in the graph for [age+1] and summed them over all cars, but (fortunately) that gave me far too low survival estimates, which got me thinking. I'm doing the calculation as a review of a report that included historical numbers. that gave me some indication, so I'm thinking I'm on the right track, but I felt the same way the previous time.

If you're interested in using the Kaplan Meier (KM) estimator to predict survival, you need to know what you're predicting.

First, the KM estimator can be used to estimate the survival curve, $$S(t)$$, in a non-parametric fashion. The survival curve tells us the probability of surviving past time $$t$$ assuming the event has not happened prior to time $$t$$. So immediately we know we can't predict how long a car will last (at least, not easily from the KM), we can only predict the proportion of cars which will survive past some time (assuming none of the cars break down by that time).

Let's see a concrete example. I'm going to simulate data with a known failure time distribution. The failure times are distributed according to an exponential distirbution, with rate parameter $$\beta=1/2$$. The data will be censored after $$t=8$$ (meaning, I don't know when the car breaks down).

In R, I can do that as follows:

library(tidyverse)
library(survival)

# assume my data is in a data frame called "d"

sfit <- survfit(Surv(time=time, event=event) ~ 1, data=d)
plot(sfit)



Now, suppose I want to predict the proportion of cars in a new sample which will survive past time $$t=2$$.

I just need to get the value of the KM estimator at 2.

km_time <- sfit$time t_2_index <- min(which(km_time>=2)) S <- sfit$surv[t_2_index]
S
[1] 0.339


So from this sample, approximately 34% of cars will survive past $$t=2$$. That's fairly close to the real probability of $$36.7\%$$

• Thank you very much for the clear answer! There is one small complication in that I need to work with the cars still "on the road", not a new batch. I guess this is like life insurance : given you are this age, how likely is it that you will still be alive in a year's time ? It might be a very basic question, it is just my lack of experience in this sort of statistics. any pointers welcome ! Commented Jan 17 at 9:35
• You can use ratios of K-M estimates to get the conditional probabilities you need. Note that this whole approach assumes that the distribution is homogeneous, e.g., there are no predictor variables that need to be included in a time-to-event model that generalizes K-M. Commented Apr 9 at 12:47