Cohen's kappa explained

Cohen's kappa coefficient (κ, lowercase Greek kappa) is a statistic that is used to measure inter-rater reliability (and also intra-rater reliability) for qualitative (categorical) items.[1] It is generally thought to be a more robust measure than simple percent agreement calculation, as κ takes into account the possibility of the agreement occurring by chance. There is controversy surrounding Cohen's kappa due to the difficulty in interpreting indices of agreement. Some researchers have suggested that it is conceptually simpler to evaluate disagreement between items.

History

The first mention of a kappa-like statistic is attributed to Galton in 1892.[2] [3]

The seminal paper introducing kappa as a new technique was published by Jacob Cohen in the journal Educational and Psychological Measurement in 1960.[4]

Definition

Cohen's kappa measures the agreement between two raters who each classify N items into C mutually exclusive categories. The definition of \kappa is

\kappa\equiv

po-pe
1-pe

=1-

1-po
1-pe

,

where is the relative observed agreement among raters, and is the hypothetical probability of chance agreement, using the observed data to calculate the probabilities of each observer randomly seeing each category. If the raters are in complete agreement then \kappa=1. If there is no agreement among the raters other than what would be expected by chance (as given by), \kappa=0. It is possible for the statistic to be negative,[5] which can occur by chance if there is no relationship between the ratings of the two raters, or it may reflect a real tendency of the raters to give differing ratings.

For categories, observations to categorize and

nki

the number of times rater predicted category :

pe=

1
N2

\sumknk1nk2

This is derived from the following construction:

pe=\sumk\widehat{pk12

} \overset \sum_k \widehat\widehat = \sum_k \frac\frac = \frac \sum_k n_n_

Where

\widehat{pk12

} is the estimated probability that both rater 1 and rater 2 will classify the same item as k, while

\widehat{pk1

} is the estimated probability that rater 1 will classify an item as k (and similarly for rater 2).The relation \widehat = \sum_k \widehat\widehat is based on using the assumption that the rating of the two raters are independent. The term

\widehat{pk1

} is estimated by using the number of items classified as k by rater 1 (

nk1

) divided by the total items to classify (

N

):

\widehat{pk1

}= (and similarly for rater 2).

Binary classification confusion matrix

In the traditional 2 × 2 confusion matrix employed in machine learning and statistics to evaluate binary classifications, the Cohen's Kappa formula can be written as:[6]

\kappa=

2 x (TP x TN-FN x FP)
(TP+FP) x (FP+TN)+(TP+FN) x (FN+TN)

where TP are the true positives, FP are the false positives, TN are the true negatives, and FN are the false negatives. In this case, Cohen's Kappa is equivalent to the Heidke skill score known in Meteorology.[7] The measure was first introduced by Myrick Haskell Doolittle in 1888.[8]

Examples

Simple example

Suppose that you were analyzing data related to a group of 50 people applying for a grant. Each grant proposal was read by two readers and each reader either said "Yes" or "No" to the proposal. Suppose the disagreement count data were as follows, where A and B are readers, data on the main diagonal of the matrix (a and d) count the number of agreements and off-diagonal data (b and c) count the number of disagreements:

YesNo
Yesab
Nocd

e.g.

YesNo
Yes205
No1015

The observed proportionate agreement is:

po=

a+d
a+b+c+d

=

20+15
50

=0.7

To calculate (the probability of random agreement) we note that:

So the expected probability that both would say yes at random is:

pYes=

a+b
a+b+c+d

a+c
a+b+c+d

=0.5 x 0.6=0.3

Similarly:

pNo=

c+d
a+b+c+d

b+d
a+b+c+d

=0.5 x 0.4=0.2

Overall random agreement probability is the probability that they agreed on either Yes or No, i.e.:

pe=pYes+pNo=0.3+0.2=0.5

So now applying our formula for Cohen's Kappa we get:

\kappa=

po-pe
1-pe

=

0.7-0.5
1-0.5

=0.4

Same percentages but different numbers

A case sometimes considered to be a problem with Cohen's Kappa occurs when comparing the Kappa calculated for two pairs of raters with the two raters in each pair having the same percentage agreement but one pair give a similar number of ratings in each class while the other pair give a very different number of ratings in each class.[9] (In the cases below, notice B has 70 yeses and 30 nos, in the first case, but those numbers are reversed in the second.) For instance, in the following two cases there is equal agreement between A and B (60 out of 100 in both cases) in terms of agreement in each class, so we would expect the relative values of Cohen's Kappa to reflect this. However, calculating Cohen's Kappa for each:

YesNo
Yes4515
No2515

\kappa=

0.60-0.54
1-0.54

=0.1304

YesNo
Yes2535
No535

\kappa=

0.60-0.46
1-0.46

=0.2593

we find that it shows greater similarity between A and B in the second case, compared to the first. This is because while the percentage agreement is the same, the percentage agreement that would occur 'by chance' is significantly higher in the first case (0.54 compared to 0.46).

Properties

Hypothesis testing and confidence interval

P-value for kappa is rarely reported, probably because even relatively low values of kappa can nonetheless be significantly different from zero but not of sufficient magnitude to satisfy investigators.Still, its standard error has been described[10] and is computed by various computer programs.[11]

Confidence intervals for Kappa may be constructed, for the expected Kappa values if we had infinite number of items checked, using the following formula:

CI:\kappa\pmZ1-\alpha/2SE\kappa

Where

Z1-\alpha/2=1.960

is the standard normal percentile when

\alpha=5\%

, and

SE\kappa=\sqrt{{po(1-po)}\over{N(1-

2
p
e)

}}

This is calculated by ignoring that is estimated from the data, and by treating as an estimated probability of a binomial distribution while using asymptotic normality (i.e.: assuming that the number of items is large and that is not close to either 0 or 1).

SE\kappa

(and the CI in general) may also be estimated using bootstrap methods.

Interpreting magnitude

If statistical significance is not a useful guide, what magnitude of kappa reflects adequate agreement? Guidelines would be helpful, but factors other than agreement can influence its magnitude, which makes interpretation of a given magnitude problematic. As Sim and Wright noted, two important factors are prevalence (are the codes equiprobable or do their probabilities vary) and bias (are the marginal probabilities for the two observers similar or different). Other things being equal, kappas are higher when codes are equiprobable. On the other hand, Kappas are higher when codes are distributed asymmetrically by the two observers. In contrast to probability variations, the effect of bias is greater when Kappa is small than when it is large.[12]

Another factor is the number of codes. As number of codes increases, kappas become higher. Based on a simulation study, Bakeman and colleagues concluded that for fallible observers, values for kappa were lower when codes were fewer. And, in agreement with Sim & Wrights's statement concerning prevalence, kappas were higher when codes were roughly equiprobable. Thus Bakeman et al. concluded that "no one value of kappa can be regarded as universally acceptable."[13] They also provide a computer program that lets users compute values for kappa specifying number of codes, their probability, and observer accuracy. For example, given equiprobable codes and observers who are 85% accurate, value of kappa are 0.49, 0.60, 0.66, and 0.69 when number of codes is 2, 3, 5, and 10, respectively.

Nonetheless, magnitude guidelines have appeared in the literature. Perhaps the first was Landis and Koch,[14] who characterized values < 0 as indicating no agreement and 0–0.20 as slight, 0.21–0.40 as fair, 0.41–0.60 as moderate, 0.61–0.80 as substantial, and 0.81–1 as almost perfect agreement. This set of guidelines is however by no means universally accepted; Landis and Koch supplied no evidence to support it, basing it instead on personal opinion. It has been noted that these guidelines may be more harmful than helpful.[15] Fleiss's[16] equally arbitrary guidelines characterize kappas over 0.75 as excellent, 0.40 to 0.75 as fair to good, and below 0.40 as poor.

Kappa maximum

Kappa assumes its theoretical maximum value of 1 only when both observers distribute codes the same, that is, when corresponding row and column sums are identical. Anything less is less than perfect agreement. Still, the maximum value kappa could achieve given unequal distributions helps interpret the value of kappa actually obtained. The equation for κ maximum is:[17]

\kappamax=

Pmax-P\exp
1-P\exp

where

P\exp=

k
\sum
i=1

Pi+P+i

, as usual,

Pmax=

k
\sum
i=1

min(Pi+,P+i)

,

k = number of codes,

Pi+

are the row probabilities, and

P+i

are the column probabilities.

Limitations

Kappa is an index that considers observed agreement with respect to a baseline agreement. However, investigators must consider carefully whether Kappa's baseline agreement is relevant for the particular research question. Kappa's baseline is frequently described as the agreement due to chance, which is only partially correct. Kappa's baseline agreement is the agreement that would be expected due to random allocation, given the quantities specified by the marginal totals of square contingency table. Thus, κ = 0 when the observed allocation is apparently random, regardless of the quantity disagreement as constrained by the marginal totals. However, for many applications, investigators should be more interested in the quantity disagreement in the marginal totals than in the allocation disagreement as described by the additional information on the diagonal of the square contingency table. Thus for many applications, Kappa's baseline is more distracting than enlightening. Consider the following example:

! colspan="2"
Reference
GR
ComparisonG114
R01
The disagreement proportion is 14/16 or 0.875. The disagreement is due to quantity because allocation is optimal. κ is 0.01.
! colspan="2"
Reference
GR
ComparisonG01
R114
The disagreement proportion is 2/16 or 0.125. The disagreement is due to allocation because quantities are identical. Kappa is −0.07.

Here, reporting quantity and allocation disagreement is informative while Kappa obscures information. Furthermore, Kappa introduces some challenges in calculation and interpretation because Kappa is a ratio. It is possible for Kappa's ratio to return an undefined value due to zero in the denominator. Furthermore, a ratio does not reveal its numerator nor its denominator. It is more informative for researchers to report disagreement in two components, quantity and allocation. These two components describe the relationship between the categories more clearly than a single summary statistic. When predictive accuracy is the goal, researchers can more easily begin to think about ways to improve a prediction by using two components of quantity and allocation, rather than one ratio of Kappa.[18] Some researchers have expressed concern over κ's tendency to take the observed categories' frequencies as givens, which can make it unreliable for measuring agreement in situations such as the diagnosis of rare diseases. In these situations, κ tends to underestimate the agreement on the rare category.[19] For this reason, κ is considered an overly conservative measure of agreement.[20] Others[21] contest the assertion that kappa "takes into account" chance agreement. To do this effectively would require an explicit model of how chance affects rater decisions. The so-called chance adjustment of kappa statistics supposes that, when not completely certain, raters simply guess—a very unrealistic scenario. Moreover, some works[22] have shown how kappa statistics can lead to a wrong conclusion for unbalanced data.

Related statistics

Scott's Pi

A similar statistic, called pi, was proposed by Scott (1955). Cohen's kappa and Scott's pi differ in terms of how is calculated.

Fleiss' kappa

Note that Cohen's kappa measures agreement between two raters only. For a similar measure of agreement (Fleiss' kappa) used when there are more than two raters, see Fleiss (1971). The Fleiss kappa, however, is a multi-rater generalization of Scott's pi statistic, not Cohen's kappa. Kappa is also used to compare performance in machine learning, but the directional version known as Informedness or Youden's J statistic is argued to be more appropriate for supervised learning.[23]

Weighted kappa

The weighted kappa allows disagreements to be weighted differently[24] and is especially useful when codes are ordered.[25] Three matrices are involved, the matrix of observed scores, the matrix of expected scores based on chance agreement, and the weight matrix. Weight matrix cells located on the diagonal (upper-left to bottom-right) represent agreement and thus contain zeros. Off-diagonal cells contain weights indicating the seriousness of that disagreement. Often, cells one off the diagonal are weighted 1, those two off 2, etc.

The equation for weighted κ is:

\kappa=1-

k
\sum
k
\sum
j=1
wijxij
i=1
k
\sum
k
\sum
j=1
wijmij
i=1

where k=number of codes and

wij

,

xij

, and

mij

are elements in the weight, observed, and expected matrices, respectively. When diagonal cells contain weights of 0 and all off-diagonal cells weights of 1, this formula produces the same value of kappa as the calculation given above.

See also

Further reading

External links

Notes and References

  1. McHugh. Mary L.. 2012. Interrater reliability: The kappa statistic. Biochemia Medica. 22. 3. 276–282. 10.11613/bm.2012.031. 3900052. 23092060.
  2. Galton, F. (1892) Finger Prints Macmillan, London.
  3. Smeeton . N.C. . 1985 . Early History of the Kappa Statistic . Biometrics . 41 . 3. 795 . 2531300.
  4. Cohen . Jacob . 1960 . A coefficient of agreement for nominal scales . Educational and Psychological Measurement . 20 . 1. 37–46 . 10.1177/001316446002000104 . 1942/28116 . 15926286 . free .
  5. The Kappa Statistic in Reliability Studies: Use, Interpretation, and Sample Size Requirements. Physical Therapy. 85. 3. 257–268. 2005. 1538-6724. 10.1093/ptj/85.3.257. Sim. Julius. Wright. Chris C.. 15733050. free.
  6. Chicco D. . Warrens M.J. . Jurman G. . The Matthews correlation coefficient (MCC) is more informative than Cohen's Kappa and Brier score in binary classification assessment. IEEE Access. 9. June 2021 . 78368 - 78381. 10.1109/ACCESS.2021.3084050. free. 2021IEEEA...978368C . 10281/430460. free.
  7. Heidke. P.. 1926-12-01. Berechnung Des Erfolges Und Der Güte Der Windstärkevorhersagen Im Sturmwarnungsdienst. Geografiska Annaler. 8. 4. 301–349. 10.1080/20014422.1926.11881138. 2001-4422.
  8. Book: Philosophical Society of Washington (Washington, D.C.). Bulletin of the Philosophical Society of Washington.. Institution. Smithsonian. 1887. Published by the co-operation of the Smithsonian Institution. 10. Washington, D.C.. 83.
  9. Kilem Gwet . Inter-Rater Reliability: Dependency on Trait Prevalence and Marginal Homogeneity . Statistical Methods for Inter-Rater Reliability Assessment . 2 . 1–10 . May 2002 . 2011-02-02 . https://web.archive.org/web/20110707094014/http://agreestat.com/research_papers/inter_rater_reliability_dependency.pdf . 2011-07-07 .
  10. 10.1037/h0028106. Fleiss. J.L. . 1969. Cohen, J. . Everitt, B.S. . Large sample standard errors of kappa and weighted kappa. Psychological Bulletin . 72 . 5. 323–327.
  11. 10.3758/BF03209495. Robinson. B.F . Bakeman, R. . 1998. ComKappa: A Windows 95 program for calculating kappa and related statistics. Behavior Research Methods, Instruments, and Computers. 30 . 4. 731–732. free.
  12. Sim. J. Wright, C. C. 2005. The Kappa Statistic in Reliability Studies: Use, Interpretation, and Sample Size Requirements. Physical Therapy. 85. 3. 257–268. 15733050 . 10.1093/ptj/85.3.257. free.
  13. 10.1037/1082-989X.2.4.357. Bakeman. R. . Quera, V. . McArthur, D. . Robinson, B. F. . 1997 . Detecting sequential patterns and determining their reliability with fallible observers. Psychological Methods. 2. 4. 357–370.
  14. 10.2307/2529310. Landis. J.R.. Koch, G.G.. 1977. The measurement of observer agreement for categorical data. 2529310. Biometrics. 33. 1. 159–174. 843571. 11077516 .
  15. Gwet, K. (2010). "Handbook of Inter-Rater Reliability (Second Edition)"
  16. Book: Fleiss, J.L. . 1981. Statistical methods for rates and proportions. 2nd. New York . John Wiley. 978-0-471-26370-8.
  17. 10.1177/001316448904900407. Umesh . U. N. . Peterson, R.A. . Sauber M. H.. Interjudge agreement and the maximum value of kappa.. 1989. Educational and Psychological Measurement. 49 . 4 . 835–850. 123306239 .
  18. Pontius. Robert. Millones. Marco. 2011. Death to Kappa: birth of quantity disagreement and allocation disagreement for accuracy assessment. International Journal of Remote Sensing. 32. 15. 4407–4429. 10.1080/01431161.2011.552923. 2011IJRS...32.4407P. 62883674.
  19. Garrett. Joanne M.. 2005. Understanding interobserver agreement: the kappa statistic. Family Medicine. 37. 5. 360–363. Viera. Anthony J.. 15883903.
  20. Martens. R.. Prins. F.. Jochems. W.. 2006. Content analysis: What are they talking about?. Computers & Education. 46. 29–48. 10.1016/j.compedu.2005.04.002. Strijbos. J.. 10.1.1.397.5780. 14183447 .
  21. 1987. Diversity of decision-making models and the measurement of interrater agreement. Psychological Bulletin. 101. 140–146. 10.1037/0033-2909.101.1.140. Uebersax. JS.. 10.1.1.498.4965. 39240770 . 2010-10-16. https://web.archive.org/web/20160303171301/http://www.na-mic.org/Wiki/images/d/df/Kapp_and_decision_making_models.pdf. 2016-03-03.
  22. Delgado . Rosario . Tibau . Xavier-Andoni . 2019-09-26 . Why Cohen's Kappa should be avoided as performance measure in classification . PLOS ONE . en . 14 . 9 . e0222916 . 10.1371/journal.pone.0222916 . 1932-6203 . 6762152 . 31557204. 2019PLoSO..1422916D . free .
  23. David M. W. . Powers . 2012 . The Problem with Kappa . Conference of the European Chapter of the Association for Computational Linguistics (EACL2012) Joint ROBUS-UNSUP Workshop . http://arquivo.pt/wayback/20160518183306/http://dl.dropbox.com/u/27743223/201209-eacl2012-Kappa.pdf . 2016-05-18 . 2012-07-20 .
  24. 10.1037/h0026256. Cohen . J. . 1968. Weighed kappa: Nominal scale agreement with provision for scaled disagreement or partial credit. Psychological Bulletin . 70. 4 . 213–220 . 19673146.
  25. Book: Bakeman, R. . Gottman, J.M. . 1997. Observing interaction: An introduction to sequential analysis. 2nd. Cambridge, UK . Cambridge University Press. 978-0-521-27593-4.