Kaplan–Meier, Log-Rank Test or Cox Regression? A Guide to Survival Analysis
Kaplan–Meier, the log-rank test, and Cox regression all analyze time-to-event data, but they answer different research questions. This Resource explains how to choose among description, unadjusted group comparison, adjusted hazard modeling, and prediction while accounting for censoring, truncation, proportional hazards, and correct hazard-ratio interpretation.
Researchers working with time-to-event outcomes often face a deceptively simple choice: Kaplan–Meier, log-rank test, or Cox regression? These methods are related, but they do not answer the same research question.
The practical distinction is:
- Kaplan–Meier describes survival over time.
- The log-rank test tests whether survival experience differs between groups.
- Cox proportional hazards regression models the hazard in relation to one or more covariates and can provide adjusted associations or form the basis of a prediction model.
The correct choice therefore starts with the research objective, not with the fact that the dataset contains a “survival time” variable. Survival analysis also requires careful attention to censoring, truncation, the definition of time zero and the event, proportional-hazards assumptions, and the interpretation of hazard ratios (Klein & Moeschberger, 2003; Harrell, 2015; Lash et al., 2021).
Quick Decision Table: Kaplan Meier vs Cox Regression
Key decision: Kaplan Meier vs Cox regression is not primarily a contest between two statistical techniques. The method should follow the objective: description, hypothesis testing, adjusted association, or prediction.
| Research objective | Main method | What it answers | Important consideration |
|---|---|---|---|
| Describe survival or event-free probability over time | Kaplan–Meier | What proportion is estimated to remain event-free beyond different times? | Censoring and the changing risk set must be handled correctly. |
| Display survival experience for two or more groups | Kaplan–Meier curves | How do the observed survival patterns differ over follow-up? | Curves are descriptive; uncertainty and numbers remaining at risk matter. |
| Test an unadjusted difference in survival between groups | Log-rank test | Is there statistical evidence of different survival experience between groups? | A hypothesis test is not an adjusted effect estimate. |
| Estimate an association while adjusting for other variables | Cox proportional hazards model | How is the hazard associated with exposure or predictors conditional on included covariates? | Functional form, proportional hazards and other model assumptions require assessment. |
| Estimate a hazard ratio | Cox model | What is the relative hazard associated with a covariate under the fitted model? | A hazard ratio is not a risk ratio or a difference in survival probabilities. |
| Model an effect that changes with follow-up time | Extended Cox specification or other survival model | How does the association vary over time? | A single constant hazard ratio may be inadequate. |
| Predict an individual's future survival or risk | Prediction model for survival outcomes | How accurately can future outcomes be predicted? | Development must be followed by validation and assessment of predictive performance, including calibration. |
| Address competing events, complex truncation, or another survival structure | Other survival-analysis consideration | Depends on the target quantity. | Kaplan–Meier/log-rank/standard Cox methods should not be selected automatically. |
1. Start by Defining the Time-to-Event Outcome
A survival outcome is built around time until a defined event. Before selecting a method, specify at least:
- the event of interest;
- the time origin;
- the time scale;
- when follow-up ends;
- how censoring occurs; and
- whether entry into observation is delayed.
Examples of events can include death, recurrence, treatment failure, hospital admission, recovery, device failure, or another clearly defined transition. The term survival analysis therefore extends well beyond mortality.
The survival function describes the probability of surviving beyond a specified time, while the hazard concerns the event rate among those who have survived to that time. These are related but different descriptions of the event-time distribution (Klein & Moeschberger, 2003; Lash et al., 2021).
This distinction becomes central when interpreting Kaplan–Meier probabilities and Cox hazard ratios.
2. Censoring Is Part of the Outcome Structure
Right censoring
A participant is right censored when the event has not been observed by the end of that participant's available follow-up. The exact event time is therefore unknown, but it is known to exceed the observed censoring time.
A censored observation should not simply be classified as a permanent “non-event.”
Suppose one participant experiences the event after 8 months while another remains event-free when observation stops after 14 months. The second participant does not have an event time of 14 months. Instead, the available information tells us that the event time exceeds 14 months.
Methods for right-censored survival data are constructed to retain this partial information rather than discarding the participant or pretending that the censoring time was the event time (Klein & Moeschberger, 2003).
Censoring requires assumptions
Standard survival analyses cannot recover unobserved event times simply because an observation is labelled censored. The relationship between the censoring mechanism and the event process matters. Consequently, researchers should investigate why follow-up ended and whether censoring may be informative for the outcome process (Klein & Moeschberger, 2003).
Truncation is different from censoring
Truncation concerns whether an individual enters the observed sample at all, whereas censoring concerns incomplete observation of an event time for an individual who has entered the sample.
A common example is left truncation or delayed entry: individuals become observable only after surviving to an entry time. The risk sets used in survival analysis then need to respect when each individual actually becomes observable and at risk within the sampled data. Klein and Moeschberger explicitly distinguish censoring from truncation and develop nonparametric estimation for right-censored and left-truncated observations (Klein & Moeschberger, 2003).
Ignoring truncation can therefore create a different problem from mishandling right censoring.
3. Kaplan–Meier: Describe Survival Over Time
The Kaplan–Meier estimator is a nonparametric estimator of the survival function. It is particularly useful when the primary objective is to describe how estimated survival changes over follow-up while accommodating right-censored observations (Klein & Moeschberger, 2003).
A Kaplan–Meier curve answers questions such as:
- What is estimated survival at a clinically meaningful time?
- What proportion remains event-free beyond that time?
- How does survival appear to differ between groups?
- When does separation between survival curves emerge?
- How much information remains late in follow-up?
The calculation operates through the individuals still at risk at successive event times. Censored observations contribute information while they remain under observation and then leave later risk sets rather than being treated as events.
What to report with Kaplan–Meier curves
A useful Kaplan–Meier presentation should not be reduced to two lines on a graph. Researchers should consider reporting survival estimates and uncertainty at scientifically meaningful times and information about the number remaining at risk.
Late portions of a curve may be based on substantially fewer participants than early portions. Visual separation far into follow-up should therefore not automatically be given the same evidential weight as separation supported by large risk sets.
What Kaplan–Meier does not do
A Kaplan–Meier curve does not by itself provide an adjusted comparison controlling for multiple covariates.
It is principally a method for estimating and displaying survival experience.
That is the first major distinction in Kaplan Meier vs Cox regression: Kaplan–Meier describes survival distributions, whereas Cox regression models covariate associations with the hazard.
4. Log-Rank Test: Test Group Differences in Survival
When the objective moves from describing curves to formally testing a difference between groups, a log-rank procedure may be appropriate.
The log-rank framework compares observed event experience with what would be expected under the null hypothesis across event times, using the evolving risk sets. Klein and Moeschberger treat log-rank procedures within the broader family of tests for comparing survival distributions (Klein & Moeschberger, 2003).
What a log-rank test tells you
A log-rank test addresses a hypothesis about group survival experience.
A statistically significant result provides evidence against equality under the tested survival comparison.
It does not automatically tell you:
- how large the difference is in clinically meaningful terms;
- the absolute difference in survival at a particular time;
- whether the difference is causal;
- what happens after adjustment for confounders or prognostic factors; or
- how accurately an individual patient's outcome can be predicted.
This is why a p-value should normally be accompanied by survival curves, estimates and uncertainty rather than presented as the entire survival analysis.
Log-rank is not adjusted Cox regression
A frequent analytical mistake is to treat the log rank test and Cox regression as interchangeable because both use time-to-event information.
They serve different purposes.
A simple log-rank comparison is fundamentally a group hypothesis test. A multivariable Cox model is a regression model that can estimate conditional associations for several covariates simultaneously.
If adjustment is scientifically required, a log-rank p-value is not a substitute for an appropriately specified regression analysis.
5. Cox Proportional Hazards Regression: Model Covariate Associations
The Cox proportional hazards model relates covariates to the hazard while leaving the baseline hazard unspecified. This semiparametric structure is one reason the model is widely used for time-to-event regression (Harrell, 2015; Lash et al., 2021).
Conceptually, the model separates:
- a baseline hazard that can vary with time; and
- multiplicative covariate effects on that hazard.
The fitted coefficients are commonly exponentiated and reported as hazard ratios.
Cox regression becomes particularly relevant when researchers need to evaluate an exposure while controlling for other measured variables, investigate multiple prognostic factors, or construct a model intended to generate survival predictions.
6. Hazard Ratio Interpretation: What Does a Cox HR Mean?
The hazard concerns the instantaneous event rate among individuals who have remained event-free to a particular time.
A hazard ratio compares hazards between covariate patterns under the fitted model.
For example, an estimated hazard ratio of 0.70 for group A versus group B would represent a lower modeled hazard for A relative to B, conditional on the other variables included in the model and subject to the model specification.
Do not automatically translate HR = 0.70 as:
“Group A has a 30% lower probability of ever experiencing the event.”
Nor does HR = 0.70 mean that survival probability at every follow-up time is 30% higher.
Hazards and cumulative survival probabilities are different quantities. Lash et al. also caution that although the hazard ratio is widely used as a measure of association, its interpretation—particularly causal interpretation—requires care (Lash et al., 2021).
For practical reporting, hazard ratios are often more informative when accompanied by absolute survival or risk estimates at meaningful time points.
7. The Proportional-Hazards Assumption
The standard Cox model is a proportional hazards model.
For a conventional fixed covariate effect, the model assumes that its hazard ratio does not change with follow-up time. The baseline hazard may change freely; proportional hazards concerns the relative covariate effect.
Harrell describes assessing whether the hazard ratio remains reasonably stable over time and illustrates interval-specific estimates and predictor-by-time interactions as ways of investigating nonproportionality (Harrell, 2015).
This assumption should not be treated as a box to tick automatically before reporting the hazard ratio.
The substantive question is:
Does one constant hazard ratio adequately summarize the association over the follow-up period?
8. What If Proportional Hazards Does Not Hold?
A failed proportional-hazards assumption does not imply that the entire survival analysis must be abandoned. It indicates that the standard constant-effect Cox specification may not adequately represent the observed relationship.
Possible model responses include allowing a covariate effect to vary with time or stratifying on a variable when a single hazard-ratio estimate for that variable is not required. Harrell describes predictor-by-time interactions for modeling nonproportional effects, while Lash et al. describe stratified Cox models in which strata may have different baseline hazard functions (Harrell, 2015; Lash et al., 2021).
The resulting interpretation must change accordingly.
If an exposure has a time-varying coefficient, reporting one constant HR as though it applied uniformly throughout follow-up can conceal important temporal structure.
Researchers should therefore ask not merely whether a formal diagnostic rejects proportional hazards, but whether the estimated time dependence is important enough to alter the scientific conclusion.
9. Time-Dependent Covariates Are Not the Same as Nonproportional Effects
Two related concepts are often confused.
Time-dependent covariate
A time-dependent covariate is a covariate whose value can change during follow-up.
Time-varying coefficient
A time-varying coefficient means that the association between a covariate and the hazard changes with time.
These are not identical statistical problems. Cox-model extensions can accommodate covariate information that changes during follow-up and can also allow effects themselves to vary with time. The scientific meaning of the variable, its measurement timing and its relationship to the event process must determine the model specification rather than treating every time-related complication as the same phenomenon (Klein & Moeschberger, 2003; Harrell, 2015).
10. Regression Diagnostics Matter Beyond Proportional Hazards
Checking proportional hazards is important, but it is not the only diagnostic issue in Cox regression.
A defensible analysis should consider the broader model specification, including the functional form of continuous predictors, unusual or influential observations, residual patterns and whether important associations have been represented adequately. Klein and Moeschberger devote specific treatment to regression diagnostics, while Harrell emphasizes principled regression specification and flexible modeling of continuous predictors rather than assuming that every relationship is linear simply because the software accepts a linear term (Klein & Moeschberger, 2003; Harrell, 2015).
Diagnostics should therefore answer questions such as:
- Is a continuous predictor represented adequately?
- Does an apparent nonproportional effect reflect another model-specification problem?
- Are individual observations unusually influential?
- Does one constant covariate effect adequately describe follow-up?
- Would a different survival model better match the scientific question?
Model checking is part of the analysis, not an optional exercise performed after the desired hazard ratio has already been selected for publication.
11. Why Analyzing Survival Time as an Ordinary Continuous Outcome Can Be Misleading
Survival times may look like ordinary continuous measurements because they are recorded in days, months or years. But censoring changes what those numbers mean.
Observed event time
For an individual who experiences an event at 10 months, 10 months is an observed event time.
Censoring time
For an individual censored at 10 months, 10 months is not an observed event time. It indicates only that the event time exceeds 10 months.
Treating both values as ordinary continuous outcomes ignores this distinction.
A comparison of mean observed times can therefore mix two different mechanisms:
- when the event occurred; and
- when observation stopped without the event.
Deleting censored individuals is also problematic because it discards the valid information that they survived event-free for at least their observed duration.
Reducing the outcome to event versus no event creates another loss of information. It ignores when events occurred and treats a participant observed event-free briefly as equivalent to one observed event-free for a much longer period.
Survival methods are designed around precisely this combination of event occurrence, event timing and incomplete observation (Klein & Moeschberger, 2003).
The question should therefore not be “Is survival time continuous?” but rather:
Do all participants have fully observed event times?
If not, ordinary continuous-outcome methods can answer the wrong statistical question.
12. Description, Testing, Association and Prediction Are Different Goals
This distinction prevents many errors in survival analysis.
Survival description
Question: What proportion remains event-free over time?
Method: Kaplan–Meier estimation is a natural starting point.
Hypothesis testing
Question: Is survival different between these groups?
Method: A log-rank test may provide an appropriate unadjusted comparison when its framework matches the scientific question.
Adjusted association
Question: Is exposure associated with the event hazard after accounting for other measured variables?
Method: A Cox regression model may be appropriate, provided its specification and assumptions are adequate.
Prediction
Question: How accurately can we predict an individual's future survival or event risk?
Methodological implication: A Cox model can form the basis of a prediction model, but prediction requires more than interpreting regression coefficients or finding statistically significant predictors.
For adjusted association, the result is an adjusted model-based association, not automatically a causal effect. Epidemiologic interpretation still depends on study design, confounding, selection, measurement and the causal assumptions needed for the intended conclusion (Lash et al., 2021).
For prediction, predictive performance must be assessed. For survival predictions, Steyerberg describes assessment of calibration at fixed time points and comparison of observed survival with predicted survival. More generally, prediction-model development requires attention to internal validation, external validity/generalizability, discrimination and calibration rather than treating model fit or statistical significance as proof of predictive accuracy (Steyerberg, 2019).
Explanation and prediction should not be collapsed into the same objective.
13. A Practical Survival-Analysis Workflow
For most research projects, the decision sequence should look like this:
-
First, define the question. Decide whether the objective is description, comparison, adjusted association or prediction.
-
Second, define the event and time origin. Ambiguous time zero produces an ambiguous outcome.
-
Third, identify censoring and truncation. Determine why observation ends and whether participants enter the risk set after the nominal origin.
-
Fourth, describe the survival experience. Kaplan–Meier estimates and curves can reveal the overall time structure before a regression coefficient is interpreted.
-
Fifth, choose the inferential method to match the objective. Use a log-rank test for an appropriate unadjusted survival comparison; use survival regression when covariate modeling or adjustment is required.
-
Sixth, check the model rather than merely fitting it. Examine proportional hazards, predictor specification and relevant diagnostics.
-
Seventh, interpret the estimand correctly. A hazard ratio is a hazard ratio—not automatically a risk ratio, probability difference or causal effect.
-
Finally, report absolute context and uncertainty. Survival probabilities at meaningful times can make a relative hazard comparison much easier to interpret scientifically.
Common Mistakes
The most common problems are conceptual rather than computational:
Mishandling censoring
- Treating censored participants as if they never experience the event.
- Deleting censored observations.
- Comparing ordinary mean observed follow-up times.
- Converting the endpoint to event/no-event and discarding event timing.
Misreading comparisons
- Treating Kaplan–Meier curves as adjusted comparisons.
- Interpreting a log-rank p-value as an effect size.
- Interpreting a hazard ratio as a risk ratio.
- Claiming causality merely because a Cox model contains adjustment variables.
Ignoring model specification
- Assuming proportional hazards without examining it.
- Forcing one constant HR when the effect changes over time.
- Categorizing continuous predictors automatically instead of examining their functional form.
Overstating model output
- Treating a statistically significant Cox model as a validated prediction model.
- Focusing on the hazard ratio without providing useful absolute survival context.
Bottom Line: Kaplan Meier vs Cox Regression
The choice is driven by the research objective.
Kaplan–Meier
Use Kaplan–Meier when you need to estimate and describe survival over time.
Log-rank test
Use the log-rank test when you need an appropriate unadjusted hypothesis test comparing survival between groups.
Cox proportional hazards model
Use a Cox proportional hazards model when you need regression modeling of the hazard, including adjusted associations, provided the proportional-hazards structure and broader model specification are defensible.
If effects vary with time, participants enter observation late, competing events alter the probability question, or prediction is the objective, the analysis may need to go beyond the simplest Kaplan–Meier/log-rank/standard Cox workflow.
The most important question is therefore not:
“Should I use Kaplan–Meier or Cox regression?”
It is:
“What survival quantity or research conclusion am I trying to estimate, compare, explain or predict?”
Once that is clear, the statistical method becomes much easier to choose.
FAQs
What is the difference between Kaplan Meier and Cox regression?
Kaplan–Meier nonparametrically estimates the survival function and is primarily descriptive. Cox regression models covariate associations with the hazard and can include multiple predictors. Kaplan–Meier is therefore appropriate for describing survival experience, whereas Cox regression is used when regression modeling or adjustment is required.
Is the log rank test the same as Cox regression?
No. A log-rank test provides a hypothesis test for comparing survival experience between groups. Cox regression is a regression framework that estimates covariate effects through hazard ratios and can incorporate multiple covariates.
What does a hazard ratio of 0.70 mean?
Under an appropriate proportional-hazards model, HR = 0.70 indicates that the modeled hazard for one covariate pattern is 0.70 times that of the reference pattern, conditional on other variables in the model. It should not automatically be interpreted as a 30% reduction in cumulative event probability.
Can I use a t test or linear regression for survival time?
Ordinary continuous-outcome methods can be misleading when event times are censored because an observed censoring time is not the participant's event time. Survival methods are specifically designed to incorporate this incomplete event-time information.
What happens if the proportional hazards assumption is violated?
The standard constant-effect Cox model may no longer adequately describe the association. Depending on the scientific question and pattern of nonproportionality, options include modeling time-varying effects, stratification or considering another survival-model framework (Harrell, 2015; Lash et al., 2021).
Can Cox regression be used for prediction?
Yes, a Cox model can provide survival predictions, but fitting the model is not sufficient to establish predictive performance. Prediction models require appropriate validation and assessment of performance such as discrimination and calibration (Steyerberg, 2019).
Does an adjusted Cox regression establish causality?
No. Covariate adjustment does not by itself convert an association into a causal effect. Causal interpretation depends on the study design and the assumptions required to address confounding, selection and other sources of bias (Lash et al., 2021).
References
Harrell, F. E., Jr. (2015). Regression modeling strategies: With applications to linear models, logistic and ordinal regression, and survival analysis (2nd ed.). Springer.
Klein, J. P., & Moeschberger, M. L. (2003). Survival analysis: Techniques for censored and truncated data (2nd ed.). Springer.
Lash, T. L., VanderWeele, T. J., Haneuse, S., & Rothman, K. J. (2021). Modern epidemiology (4th ed.). Wolters Kluwer.
Steyerberg, E. W. (2019). Clinical prediction models: A practical approach to development, validation, and updating (2nd ed.). Springer. https://doi.org/10.1007/978-3-030-16399-0
Need help with a similar research question?
Share a short, non-confidential summary of your study and the decision you need to make.