Signature
Gini = 2 * AUC - 1
| Inputs | Definition | Unit |
|---|---|---|
AUC | Area under the ROC curve, or C-statistic for a binary outcome, of the same model | probability from 0 to 1 |
Gini | Gini index of discrimination: twice the area between the ROC curve and the diagonal | none; from minus 1 to 1, with 0 for no discrimination |
|---|
Function
Discrimination AUC as the probability of correct ranking
Maps the scores that a diagnostic test or risk prediction model gives to people with and without an outcome to a single probability: the chance that a randomly chosen person with the outcome scores higher than a randomly chosen person without it, with tied scores counted as half. S_1 and S_0 are the scores of the two people and P denotes probability. The result has no units, equals 0.5 for a score unrelated to the outcome and 1 for perfect separation, and is the area under the receiver operating characteristic (ROC) curve and the C-statistic for a binary outcome. It measures discrimination only; calibration and the costs and health effects of acting on the score are separate questions.
Try this function
Implementations
Excel
Gini index from an AUC cell
With the AUC in a cell named AUC, the formula returns the Gini index.
=2*AUC-1
Assumptions
Gini index computed from the same ROC curve as the AUC
The relation holds for the Gini index defined as twice the area between the ROC curve and the diagonal, calculated from the same curve and data as the AUC. Indices with the same name defined in other ways do not convert by this formula.
Worked examples
Gini index for the ten-patient risk score
The ten-patient AUC of about 0.896 corresponds to a Gini index of about 0.792.
AUC = 0.89583; Gini = 0.79166
Gini index for QRISK2-2011 in men aged 35 to 74
Collins and Altman report an AUC of 0.771 for QRISK2-2011 and 0.750 for the NICE Framingham equation in men aged 35 to 74. The Gini indices are about 0.542 and 0.500: the rescaling doubles the difference between the models but leaves their ranking unchanged.
AUC = 0.771; Gini = 0.542
Common errors
Confusing the discrimination Gini index with the inequality Gini coefficient
The Gini index of an ROC curve measures how well a score ranks cases above non-cases. The Gini coefficient used in studies of income or health inequality measures the spread of a distribution across a population, so values of the two cannot be compared or substituted for each other.
Sources
Fawcett on the Gini index and the AUC
Fawcett T. An introduction to ROC analysis. Pattern Recognition Letters. 2006;27(8):861-874. Section 7: the AUC is closely related to the Gini coefficient, twice the area between the diagonal and the ROC curve, with Gini plus 1 equal to 2 times the AUC (citing Hand and Till 2001).
Collins and Altman QRISK2-2011 validation AUCs
Collins GS, Altman DG. Predicting the 10 year risk of cardiovascular disease in the United Kingdom: independent and external validation of an updated version of QRISK2. BMJ. 2012;344:e4181. Table 4: AUROC in men aged 35 to 74 of 0.771 for QRISK2-2011 and 0.750 for the NICE Framingham equation.
Canonical Identity
Stable URI · Machine-readable · Resolvable · CC BY 4.0