Skip to content
induwara.lk
Premium
induwara.lkStatistics · Survival analysis

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.

By Induwara AshinsanaUpdated Jul 13, 2026
Concordance Index (C-index)
Mode

One subject per row: predicted risk score, then outcome (1 = event, 0 = non-event). Commas, tabs, or spaces. A header row is ignored.

Higher score means
Examples
Concordance index
0.7500
Range 0–1 · 0.5 = chance
Comparable pairs
4
of 6 total
Concordant / discordant
3 / 1
0 tied (½ credit)
Interpretation
Acceptable discrimination

Pair breakdown

n (subjects)
4
Total pairs
6
n(n−1)/2
Comparable
4
usable pairs
Concordant
3
Discordant
1
Tied score
0
½ credit each
Excluded (same class)
2
Formula

C = (concordant + ½·tied) / comparable = (3 + 0.5·0) / 4 = 0.7500

Cross-check. In binary mode the C-index equals the ROC-AUC. Integrating the ROC curve by an independent trapezoidal sweep gives 0.7500, versus 0.7500 from pair counting. The two routes reconcile, matching sklearn.metrics.roc_auc_score.

Parsed data

#OutcomeRisk score
110.9000
210.6000
300.7000
400.3000

Method: Harrell's C = (concordant + ½·tied) / comparable pairs — Harrell (1982); survival censoring per lifelines.utils.concordance_index and sksurv…concordance_index_censored. Nothing leaves this page.

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:

  1. 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_index and sksurv.metrics.concordance_index_censored.
  2. 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.
  3. 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

Binary — equals ROC-AUC. rows risk,outcome: (0.9,1) (0.6,1) (0.7,0) (0.3,0)

  1. Comparable pairs = every event × non-event pair = 4
  2. (0.9,event) vs (0.7,non) → concordant; (0.9,event) vs (0.3,non) → concordant
  3. (0.6,event) vs (0.7,non) → discordant; (0.6,event) vs (0.3,non) → concordant
  4. concordant = 3, discordant = 1, tied = 0
  5. C = (3 + 0.5·0) / 4 = 0.7500 → equals the ROC-AUC of these scores

Survival with censoring. rows time,event,risk: (5,1,0.8) (8,0,0.5) (12,1,0.3)

  1. (S1,S2): t=5 < 8, earlier S1 had the event → comparable; 0.8 > 0.5 → concordant
  2. (S1,S3): t=5 < 12, earlier S1 had the event → comparable; 0.8 > 0.3 → concordant
  3. (S2,S3): t=8 < 12, earlier S2 was censored → cannot order → dropped
  4. comparable = 2, concordant = 2, excluded = 1
  5. C = (2 + 0.5·0) / 2 = 1.0000 → matches lifelines.concordance_index([5,8,12],[-0.8,-0.5,-0.3],[1,0,1])

Tied scores + negatives + large values. rows risk,outcome: (0.5,1) (0.5,0) (-2.5,1) (1e9,0)

  1. Events score {0.5, -2.5}; non-events score {0.5, 1e9}. Comparable = 4
  2. (0.5,event) vs (0.5,non) → tied (half credit)
  3. (0.5,event) vs (1e9,non), (-2.5,event) vs (0.5,non), (-2.5,event) vs (1e9,non) → all discordant
  4. concordant = 0, discordant = 3, tied = 1
  5. C = (0 + 0.5·1) / 4 = 0.1250 → below 0.5 means the ranking is worse than chance here

Frequently asked questions

Sources & references

Related tools

Rate this tool
Be the first to rate

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.