# How to calculate Hazard Ratio from Kaplan Meier curve

Is it possible to calculate the Hazard Ratio, Log[HR], and SE for overall survival (OS) using data from a manuscript that presents Kaplan Meier curve for OS? Usually these manuscripts present the survival of the patients in raw numbers but do not provide HR. How can I calculate it? Is there a formula or a computed system I could use? I would appreciate a detail response as I do not have great knowledge into that field.

Thank you.

• Yanhong Zhou has developed a great online tool to help researcher to get hazard ratio from kaplan-curve. Liu, N., Zhou Y., Lee, J. J (2020). IPDfromKM: Reconstruct Individual Patient Data from Published Kaplan-Meier Survival Curves. trialdesign.org/one-page-shell.html#IPDfromKM Commented Aug 4, 2022 at 8:22

When considering the hazard ratio, it is best to obtain this by fitting a Cox proportional hazards model. If you do not adjust for outcome heterogeneity caused by any other variables than the grouping variable, your regression model would contain one binary predictor. The output will be a log hazard ratio and its standard error. You anti-log the regression coefficient to get the point estimate of the hazard ratio.

The Cox model in this situation is essentially two Kaplan-Meier estimates that borrow information from each other by assuming a common shape of the survival curves (curves are parallel on the log-log survival scale).

There is a Mantel-Haenszel-type hazard ratio estimator but I prefer the Cox model.

You need the raw data in either case. You can approximate the statistics by using a digitization program to retrieve the points on the published curves, and re-plotting on the log-log scale and taking an average distance between them. This estimates the Cox regression coefficient. How to weight the distances for optimum estimation is difficult. An approximate standard error comes from the approximate variance estimate of $\frac{4}{e}$ where $e$ is the total number of events in both groups combined.

Besides the already provided answer regarding methods for extracting the information from Kaplan-Meier plots, it is also possible estimate the hazard ratio and standard error/confidence interval using the number of patients with an event in combination with the total time (e.g. years) of follow-up to first event or censoring, if the hazard for an event is approximately constant in all treatment groups. This is because these numbers together constitute the sufficient statistics for an exponential time to event model. This can be fitted in just about any Poisson regression software with the number of patients with an event as the number of events and the logarithm of the follow-up as the offset.