Survival Curve Comparison Calculator

Upload times, events, and groups for fast survival analysis. See medians, p-values, and hazard metrics. Compare cohorts clearly with plots, exports, and practical summaries.

Kaplan-Meier estimation Log-rank comparison Median survival RMST CSV export PDF export

Analysis Results

Results appear here after calculation. The summary compares both survival curves and shows the statistical test outcome.

Plotly Survival Curve

Group A Step Table

Time At Risk Events Censored Survival Lower CI Upper CI

Group B Step Table

Time At Risk Events Censored Survival Lower CI Upper CI

Calculator Inputs

Enter time and event pairs as two columns. Use 1 for event and 0 for censored. One record per line.

Group 1 Dataset

Accepted separators: comma, space, tab, or semicolon.

Group 2 Dataset

Use the same time units across both groups.

Analysis Options

Expected input format
Each line should contain:
time,event
Examples: 8,1 or 8 1
Event = 1 means event occurred.
Event = 0 means right-censored.

Example Data Table

This sample illustrates a simple two-group survival dataset. Time units can represent days, weeks, or months.

Record Group Time Event Meaning
1Group A51Event observed at time 5
2Group A61Event observed at time 6
3Group A60Censored at time 6
4Group A100Censored at time 10
5Group B41Event observed at time 4
6Group B51Event observed at time 5
7Group B50Censored at time 5
8Group B90Censored at time 9

Formula Used

  • Kaplan-Meier survival estimate: S(t) = ∏(1 − di / ni) for each event time up to t.
  • Greenwood variance: Var[S(t)] = S(t)2 × Σ[di / (ni(ni − di))].
  • Log-rank expected events: E1i = di × n1i / ni.
  • Log-rank variance contribution: Vi = n1in2idi(ni − di) / [ni2(ni − 1)].
  • Log-rank chi-square: χ² = (O1 − E1)² / V.
  • Approximate hazard ratio: HR ≈ exp[(O1 − E1) / V].
  • Restricted mean survival time: RMST(τ) = ∫0τ S(t) dt.
  • Median survival: the earliest time where estimated survival becomes 0.50 or lower.

This implementation uses right-censored data and a one-degree-of-freedom log-rank comparison between two groups.

How to Use This Calculator

  1. Enter a name for each group.
  2. Paste one observation per line using time and event status.
  3. Use 1 for observed events and 0 for censored observations.
  4. Select the confidence level for interval estimates.
  5. Enter a horizon time if you need survival at a specific point.
  6. Set τ for restricted mean survival time comparison.
  7. Click Compare Survival Curves to calculate the results.
  8. Review medians, RMST, p-value, hazard ratio, and step tables.
  9. Use the CSV or PDF buttons to export the summary.

Frequently Asked Questions

1) What does this calculator compare?

It compares two time-to-event datasets. The tool estimates Kaplan-Meier survival curves, calculates median survival, computes restricted mean survival time, and performs a log-rank test to assess whether the groups differ statistically.

2) What does event = 0 mean?

An event value of 0 means the observation is censored. The subject remained event-free until that time, but the final outcome was not observed afterward.

3) Can I use months, weeks, or days?

Yes. Any time unit works if both groups use the same unit consistently. Mixing units inside one analysis will distort the survival curve and the comparison.

4) What does the log-rank p-value show?

The p-value tests whether the two survival experiences differ over the full follow-up period. A small p-value suggests the groups likely do not share the same underlying survival pattern.

5) Why might median survival be not reached?

Median survival is not reached when the estimated survival curve never falls to 50% or below during observed follow-up. In that case, longer follow-up may be needed.

6) What is RMST useful for?

RMST summarizes average event-free time up to a chosen limit τ. It is useful when hazards are not proportional or when median survival is unavailable or unstable.

7) Is the hazard ratio exact?

The displayed hazard ratio is an approximation derived from the log-rank framework. It is useful for quick comparison, but it is not a replacement for a full Cox model.

8) What should I check before interpreting results?

Check data entry, time units, censoring codes, follow-up length, and sample size. Also consider whether group differences might depend on study design, missing data, or confounding factors.

Related Calculators

kaplan meier calculatorevent probability calculatorlog normal survivalsubdistribution hazardtime dependent covariatescause specific hazardhazard function plotproportional hazards test

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.