Survival analysis

Analytika TeamLast reviewed 8 min read

Studies that follow people over time rarely see every outcome. Some participants are still alive at the end, or leave the study early. Simply dropping them, or treating them as event-free, gives wrong answers. Survival analysis uses the partial information properly.

Censoring

A case is censored when we know the event hadn’t happened by a certain time, but not when (or whether) it happened afterwards. Survival methods count censored cases as “at risk” up to their last observed time, and then stop counting them. This assumes censoring is unrelated to prognosis.

Worked example: advanced lung cancer

R’s survival::lung data follow 228 patients with advanced lung cancer (Loprinzi et al., 1994). Survival is measured in days, and 165 deaths were observed. The rest were censored.

Kaplan-Meier and the log-rank test

GroupnDeathsMedian survival (days)95% CI
Female9053426[348, 550]
Male138112270[212, 310]

Log-rank test: χ²(1) = 10.33, p = .001. Survival differed by sex. Women survived a median of about five months longer.

Cox regression

A Cox model with sex alone gives a hazard ratio for men of 1.70, 95% CI [1.23, 2.36], p = .001. At any point in time, men had about 70% higher risk of death than women.

Adjusting for age and physical performance status (ECOG score; 227 patients with complete data):

PredictorHazard ratio95% CIp
Male (vs female)1.74[1.25, 2.41]< .001
ECOG score (per point)1.59[1.27, 1.99]< .001
Age (per year)1.01[0.99, 1.03].232

The sex difference persists after adjustment, and worse performance status strongly predicts shorter survival. Every figure matches R’s survival package in Analytika’s test suite.

APA write-up

Median survival was 426 days (95% CI [348, 550]) for women and 270 days (95% CI [212, 310]) for men, log-rank χ²(1) = 10.33, p = .001. In a Cox model adjusting for age and ECOG performance status, men had a higher hazard of death, HR = 1.74, 95% CI [1.25, 2.41], p < .001.

Assumptions and checks

  • Non-informative censoring: people lost to follow-up shouldn’t be systematically sicker or healthier.
  • Proportional hazards (Cox): check with Schoenfeld residuals, or by looking for crossing Kaplan-Meier curves.
  • Observational data: hazard ratios are associations unless treatment was randomised.

A hazard ratio is like a rate ratio over time. Compare odds ratios and relative risk.

References

  • Loprinzi, C. L., Laurie, J. A., Wieand, H. S., et al. (1994). Prospective evaluation of prognostic variables from patient-completed questionnaires. Journal of Clinical Oncology, 12(3), 601–607.

More in Advanced methods

Run this on your own data

Upload a dataset and ask your question in plain English. Analytika checks the assumptions, picks the test, runs it, and writes the results up in APA format.

Try it free