Concordance Index (C-index) Calculator
Paste binary or right-censored survival data to get Harrell's concordance index (C-statistic), the full concordant / discordant / tied pair breakdown, and a plain-language band. Binary mode is cross-checked against ROC-AUC; survival mode follows the lifelines and scikit-survival censoring rules — no signup, nothing uploaded.
How it works
The concordance index(C-index or C-statistic), introduced by Frank Harrell and colleagues in 1982, measures how well a model's predicted risk scores rank subjects against their observed outcomes. It is the fraction of usable subject pairs whose risk ordering matches the outcome ordering, giving half credit to pairs the model scores equally:
C = (concordant + 0.5 × tied) / comparable pairs
For n subjects there are n(n−1)/2 unordered pairs. The tool walks all of them in three steps:
- Enumerate comparable pairs. In binary mode, a pair is comparable when the two subjects have different outcomes — one event (1) and one non-event (0) — and the event subject is the one that should carry the higher risk. In survival mode, take the pair's earlier observation: it is comparable only if that earlier subject actually had the event. If the earlier subject was censored we cannot know the true order, so the pair is dropped; pairs with equal times, and pairs where both subjects are censored, are also not comparable. This mirrors the rules in
lifelines.utils.concordance_indexandsksurv.metrics.concordance_index_censored. - Classify each comparable pair. Compare the predicted scores of the should-be-higher-risk subject and its counterpart. The pair is concordant when the higher-risk subject scored higher, discordant when it scored lower, and tiedwhen the two scores are equal (worth half a point). If your score column reads the other way — larger means better prognosis — switch the “higher score means” control and the tool negates the scores before comparison, exactly as lifelines expects a predicted-survival column.
- Aggregate. Sum the concordant pairs plus half the tied pairs and divide by the number of comparable pairs. The result runs from 0 to 1, where 0.5 is chance and 1.0 is a perfect ranking. The tool reads the value against the Hosmer–Lemeshow interpretation bands (0.7–0.8 acceptable, 0.8–0.9 excellent, above 0.9 outstanding).
As a credibility check, binary mode recomputes the score a second, independent way — integrating the ROC curve by a trapezoidal sweep — and confirms it matches the pair-counting result, because in the uncensored binary case the C-index equals the ROC-AUC. To evaluate a plain binary classifier you can use the ROC curve & AUC calculator instead; for the closely-related rank-correlation view of concordant and discordant pairs, see the Kendall's tau calculator. A high C-index shows the model orders subjects well; it says nothing about whether the predicted risks are well-calibrated in absolute terms.
Worked examples
Frequently asked questions
Sources & references
- Harrell FE, Califf RM, Pryor DB, Lee KL, Rosati RA (1982) — “Evaluating the Yield of Medical Tests,” JAMA 247(18):2543–2546 (original C-statistic)
- lifelines.utils.concordance_index — reference implementation the survival mode is reconciled against
- scikit-survival — concordance_index_censored: comparable-pair (censoring) rules
- Hosmer, Lemeshow & Sturdivant (2013) — Applied Logistic Regression (3rd ed.), §5: c-statistic interpretation bands
The definitions and censoring rules on this page were last cross-checked against these sources on 2026-07-13. Harrell's C is a stable mathematical definition, so this tool needs no rate or schedule updates; only the worked examples are periodically re-reconciled against lifelines.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.