FESK.COMYour global study desk
Email us
Statistics & Data

Survival Analysis for Beginners: Censoring, Kaplan–Meier and the Cox Model

When your question is “how long until it happens”, such as time to PhD completion or to dropout, the average time is the wrong number. Censoring, Kaplan–Meier curves, the log-rank test and hazard ratios.

Survival Analysis for Beginners: Censoring, Kaplan–Meier and the Cox Model

A department wanted to know how long doctoral students take to complete. It took everyone who had graduated in the past ten years and got an average of 4.2 years. That figure ignores two groups: students still enrolled and those who left. A student in their sixth year who has not finished does not appear in the average, so 4.2 is noticeably more optimistic than reality.

When the outcome is time until an event occurs, you need a dedicated family of methods called survival analysis, or time-to-event analysis. The name comes from medicine, but the event can be anything: thesis completion, dropout, finding a job, a customer leaving, a machine failing.

Censoring: why the mean is wrong

An observation is right-censored when you know the event had not happened by the end of follow-up, but not what happened afterwards. A sixth-year student is censored at six years: their time is at least six years.

Two common wrong fixes:

  • Dropping censored people: results skew towards shorter times, as in the opening example.
  • Treating the censoring time as the event time: wrong in the other direction, because the event has not happened.

Survival analysis uses exactly the information a censored observation carries: “at least this long”.

A key assumption: censoring is unrelated to risk

Basic methods assume censoring tells you nothing about the chance of the event. If people who leave the study are precisely those about to experience the event, or certain never to, results are biased. Think carefully about why each person is censored. In the thesis example, leaving the programme is not ordinary censoring; it is a competing risk, which needs dedicated methods if you want an accurate probability of completion.

Reading a Kaplan–Meier curve

The Kaplan–Meier curve estimates the probability of not yet having had the event over time. It is a descending staircase, each step marking an event; small tick marks usually show censored observations.

  • Median time: where the curve crosses 0.5. If it never falls below 0.5, the median cannot be estimated; say so rather than inventing one.
  • Proportion at a landmark: for example, the share not yet completed after four years, with a confidence interval.
  • Number at risk beneath the time axis: essential. The tail of the curve often rests on very few people, so do not over-interpret big drops at the end.

Two or more curves are usually compared with the log-rank test. It has most power when the difference between groups is stable over time and little when curves cross.

The Cox model and hazard ratios

When you need to adjust for several variables, Cox proportional hazards regression is the standard choice. Its output is the hazard ratio (HR).

ResultMeaningHow to write it
HR = 1Same rate of eventsNo difference
HR = 1.5At any moment, the event rate is 50% higher“The event occurs faster”, not “time is 50% shorter”
HR = 0.7Rate 30% lower“The event occurs more slowly”

Watch the direction of the event. If the event is completion, an HR above 1 is good news. If it is dropout, an HR above 1 is bad news. State the event clearly next to the table.

The proportional hazards assumption

The Cox model assumes the hazard ratio is constant over time. Check it with Schoenfeld residuals (a test and a plot) or by seeing whether Kaplan–Meier curves cross. If the assumption fails, you can let effects vary with time, stratify on the offending variable, or report the difference in restricted mean survival time, which many readers find easier to interpret.

Common mistakes

  • A vague start point: whether time starts at enrolment or supervisor assignment must be clear and consistent.
  • Immortal time bias: grouping people by something that happens after the start, such as “published an international paper”. People must survive long enough to join that group, which makes it look artificially good.
  • Turning time into a yes/no variable (“dropped out within two years”) and running logistic regression: wasteful, and it mishandles people censored before two years.
  • Too many predictors for the number of events: as with logistic regression, information depends on events, not sample size.

In practice: preparing data and reporting

  1. Define the event, the start point and the end of follow-up in one sentence each.
  2. Create two columns: time (from start to event or censoring) and status (1 = event, 0 = censored).
  3. Plot Kaplan–Meier curves by group with a number-at-risk table.
  4. Report median time (if estimable) and proportions at meaningful landmarks, with confidence intervals.
  5. Fit a Cox model with theory-based predictors; report HRs with 95% confidence intervals; check and report the proportional hazards assumption.

Sample sentence: “After adjusting for field and study mode, doctoral students with full-time scholarships completed faster (HR = 1.6; 95% CI 1.2–2.1). Median time to completion was 4.1 years versus 5.3 years.”

Next step: if your data include a “time until…” variable that you are currently averaging or turning into yes/no, rebuild it as time and status columns and draw the Kaplan–Meier curve. That single picture often changes the story.

Câu hỏi thường gặp

Where is survival analysis used outside medicine?

Wherever the outcome is time to an event: dropout, thesis completion, finding a job, customer churn, equipment failure. The name is medical but the methods are general.

What does censored data mean?

It means you know someone had not experienced the event by the end of follow-up, but not what happened after. Dropping them or treating them as events both bias results.

How do I interpret a hazard ratio?

An HR compares the rate of events between groups at any given time. HR = 1.5 means the event happens faster, not that the time is 50% shorter.

What is the log-rank test used for?

Comparing Kaplan–Meier curves between two or more groups. It is most powerful when the difference is stable over time and weak when curves cross.

What if the proportional hazards assumption is violated?

You can allow time-varying effects, stratify on that variable, or report restricted mean survival time instead of a hazard ratio.

Need specific advice for your case?

We will contact you within 24 hours.

Request consultation now

Related articles

🧭
Bạn đang ở chặng nào của đường học vị?
Nhập chỗ bạn đang đứng và đích bạn nhắm — công cụ trả về số năm, chi phí và việc phải làm từng chặng.
Show my pathway →
Miễn phí, không cần tài khoản. Xem tất cả công cụ

Need advice? Talk to us

Leave your details and our team will contact you within 24 hours. The first consultation is completely free.

or
info@fesk.com