A study of malaria reinfection in 100 people. Each person is treated, which clears the parasites, and joins the study that day. People join steadily from day 0 to day 300. Each is followed until they are reinfected or until the study stops on day 365. Half sleep under a bed net. How long does it take to be reinfected?
The real study stops on day 365. You can also drag the stop line on the plot.
Someone still free of malaria when the study stops is censored: their delay is longer than their follow-up so far, but we don't know by how much.
The study as it is when it stops on day 365. Kaplan-Meier uses everyone, for as long as they were followed.
On any day, the people at risk are those still free and still being followed. On each day with a reinfection, the proportion surviving the day is 1 − reinfected / at risk, and the curve (the cumulative survival, S(t)) is multiplied by it. Survival here means staying free of malaria.
A censored person counts as at risk up to their last day of follow-up, then leaves without making the curve drop.
You can also drag the reading line on the plot.
A Kaplan-Meier curve for each group: the 50 people who don't sleep under a bed net (blue) and the 50 who do (green).
The hazard is the rate of reinfection among people still free: roughly, the chance of being reinfected tomorrow if you haven't been yet.
A Cox model sums up the difference between the groups in one number, the hazard ratio (HR): at every time, the hazard for net users is the hazard for non-users multiplied by the HR.
The dashed green line is the no-net curve with every day's reinfection rate multiplied by the HR. On each day, proportion surviving = 1 − HR × reinfected / at risk, using the people without a net.
You can also drag the reading line on the plot.
time is each person's follow-up in days, and reinfected is 1 if it ended in reinfection and 0 if it was censored. Surv(time, reinfected) pairs the two. net is 1 for people who sleep under a bed net and 0 for people who don't.