# Krippendorff's alpha

Krippendorff's alpha coefficient, named after academic Klaus Krippendorff, is a statistical measure of the agreement achieved when coding a set of units of analysis in terms of the values of a variable. Since the 1970s, alpha is used in content analysis where textual units are categorized by trained readers, in counseling and survey research where experts code open-ended interview data into analyzable terms, in psychological testing where alternative tests of the same phenomena need to be compared, or in observational studies where unstructured happenings are recorded for subsequent analysis.

Krippendorff's alpha generalizes several known statistics, often called measures of inter-coder agreement, inter-rater reliability, reliability of coding given sets of units (as distinct from unitizing) but it also distinguishes itself from statistics that are called reliability coefficients but are unsuitable to the particulars of coding data generated for subsequent analysis.

Krippendorff's alpha is applicable to any number of coders, each assigning one value to one unit of analysis, to incomplete (missing) data, to any number of values available for coding a variable, to binary, nominal, ordinal, interval, ratio, polar, and circular metrics (levels of measurement), and it adjusts itself to small sample sizes of the reliability data. The virtue of a single coefficient with these variations is that computed reliabilities are comparable across any numbers of coders, values, different metrics, and unequal sample sizes.

Software for calculating Krippendorff's alpha is available.

## Reliability data

Reliability data are generated in a situation in which m ≥ 2 jointly instructed (e.g., by a code book) but independently working coders assign any one of a set of values 1,...,V to a common set of N units of analysis. In their canonical form, reliability data are tabulated in an m-by-N matrix containing N values vij that coder ci has assigned to unit uj. Define mj as the number of values assigned to unit j across all coders c. When data are incomplete, mj may be less than m. Reliability data require that values be pairable, i.e., mj ≥ 2. The total number of pairable values is nmN.

To help clarify, here is what the canonical form looks like, in the abstract:

u1 u2 u3 ... uN
c1 v11 v12 v13 ... v1N
c2 v21 v22 v23 ... v2N
c3 v31 v32 v33 ... v3N
... ... ... ... ... ...
cm vm1 vm2 vm3 ... vmN

## General form of alpha

We denote by $R$ the set of all possible responses an observer can give. The responses of all observers for an example is called a unit (it forms a multiset). We denote a multiset with these units as the items, $U$ .

Alpha is given by:

$\alpha =1-{\frac {D_{o}}{D_{e}}}$ where $D_{o}$ is the disagreement observed and $D_{e}$ is the disagreement expected by chance.

$D_{o}={\frac {1}{n}}\sum _{c\in R}\sum _{k\in R}\delta (c,k)\sum _{u\in U}m_{u}{\frac {n_{cku}}{P(m_{u},2)}}$ where $\delta$ is a metric function (see below), $n$ is the total number of pairable elements, $m_{u}$ is the number of items in a unit, $n_{cku}$ number of $(c,k)$ pairs in unit $u$ , and $P$ is the permutation function. This can be seen to be the (weighted) average observed distance from the diagonal.

$D_{e}={\frac {1}{P(n,2)}}\sum _{c\in R}\sum _{k\in R}\delta (c,k)P_{ck}$ where $P_{ck}$ is the number of ways the pair $(c,k)$ can be made. This can be seen to be the average distance from the diagonal of all possible pairs of responses that could be derived from the multiset of all observations.

$P_{ck}={\begin{cases}c\neq k&n_{c}n_{k}\\c=k&n_{c}(n_{c}-1)\end{cases}}$ The above is equivalent to the usual form of $\alpha$ once it has been simplified algebraically.

One interpretation of Krippendorff's alpha is: $\alpha =1-{\frac {D_{{\text{within units}}={\text{in error}}}}{D_{{\text{within and between units}}={\text{in total}}}}}$ $\alpha =1$ indicates perfect reliability
$\alpha =0$ indicates the absence of reliability. Units and the values assigned to them are statistically unrelated.
$\alpha <0$ when disagreements are systematic and exceed what can be expected by chance.

In this general form, disagreements Do and De may be conceptually transparent but are computationally inefficient. They can be simplified algebraically, especially when expressed in terms of the visually more instructive coincidence matrix representation of the reliability data.

## Coincidence matrices

A coincidence matrix cross tabulates the n pairable values from the canonical form of the reliability data into a v-by-v square matrix, where v is the number of values available in a variable. Unlike contingency matrices, familiar in association and correlation statistics, which tabulate pairs of values (cross tabulation), a coincidence matrix tabulates all pairable values. A coincidence matrix omits references to coders and is symmetrical around its diagonal, which contains all perfect matches, viu = vi'u for two coders i and i' , across all units u. The matrix of observed coincidences contains frequencies:

{\begin{aligned}o_{vv'}&=\sum _{u=1}^{N}{\frac {\sum _{i\neq i'}^{m}I(v_{iu}=v)\cdot I(v_{i'u}=v')}{m_{u}-1}}=o_{v'v},\\[5pt]n_{v}&=\sum _{\ell =1}^{V}o_{v\ell }=\sum _{v_{ij}}^{m,N}I(v_{ij}=v){\text{ and }}n=\sum _{\ell =1,p=1}^{V}o_{\ell p},\end{aligned}} omitting unpaired values, where I(∘) = 1 if is true, and 0 otherwise.

Because a coincidence matrix tabulates all pairable values and its contents sum to the total n, when four or more coders are involved, ock may be fractions.

The matrix of expected coincidences contains frequencies:

$\ e_{vv'}={\frac {\sum _{i\neq i'}^{m}I(v_{iu}=v)\cdot I(v_{i'u}=v')}{n-1}}={\frac {1}{n-1}}\cdot \left.{\begin{cases}n_{v}(n_{v}-1)&{\text{if }}v=v'\\n_{v}n_{v'}&{\text{if }}v\neq v'\end{cases}}\right\}=e_{kc},$ which sum to the same nc, nk, and n as does ock. In terms of these coincidences, Krippendorff's alpha becomes:

$\alpha =1-{\frac {D_{o}}{D_{e}}}=1-{\frac {\sum _{v=1,v'=1}^{V}o_{vv'}\delta (v,v')}{\sum _{v=1,v'=1}^{V}e_{vv'}\delta (v,v')}}.$ ## Difference functions

Difference functions $\delta (v,v')$ between values v and v' reflect the metric properties (levels of measurement) of their variable.

In general:

{\begin{aligned}\delta (v,v')&\geq 0\\[4pt]\delta (v,v)&=0\\[4pt]\delta (v,v')&=\delta (v',v)\end{aligned}} In particular:

For nominal data $\delta _{\text{nominal}}(v,v')={\begin{cases}0&{\text{if }}v=v'\\1&{\text{if }}v\neq v'\end{cases}}$ , where v and v' serve as names.
For ordinal data $\delta _{\text{ordinal}}(v,v')=\left(\sum _{g=v}^{g=v'}n_{g}-{\frac {n_{v}+n_{v'}}{2}}\right)^{2}$ , where v and v′ are ranks.
For interval data $\delta _{\text{interval}}(v,v')=(v-v')^{2}$ , where v and v′ are interval scale values.
For ratio data $\delta _{\text{ratio}}(v,v')=\left({\frac {v-v'}{v+v'}}\right)^{2}$ , where v and v′ are absolute values.
For polar data $\delta _{\text{polar}}(v,v')={\frac {(v-v')^{2}}{(v+v'-2v_{\min })(2v_{\max }-v-v')}}$ , where vmin and vmax define the end points of the polar scale.
For circular data $\delta _{\text{circular}}(v,v')=\left(\sin \left[180{\frac {v-v'}{U}}\right]\right)^{2}$ , where the sine function is expressed in degrees and U is the circumference or the range of values in a circle or loop before they repeat. For equal interval circular metrics, the smallest and largest integer values of this metric are adjacent to each other and U = vlargest – vsmallest + 1.

## Significance

Inasmuch as mathematical statements of the statistical distribution of alpha are always only approximations, it is preferable to obtain alpha’s distribution by bootstrapping. Alpha's distribution gives rise to two indices:

• The confidence intervals of a computed alpha at various levels of statistical significance
• The probability that alpha fails to achieve a chosen minimum, required for data to be considered sufficiently reliable (one-tailed test). This index acknowledges that the null-hypothesis (of chance agreement) is so far removed from the range of relevant alpha coefficients that its rejection would mean little regarding how reliable given data are. To be judged reliable, data must not significantly deviate from perfect agreement.

The minimum acceptable alpha coefficient should be chosen according to the importance of the conclusions to be drawn from imperfect data. When the costs of mistaken conclusions are high, the minimum alpha needs to be set high as well. In the absence of knowledge of the risks of drawing false conclusions from unreliable data, social scientists commonly rely on data with reliabilities α ≥ 0.800, consider data with 0.800 > α ≥ 0.667 only to draw tentative conclusions, and discard data whose agreement measures α < 0.667.

## A computational example

Let the canonical form of reliability data be a 3-coder-by-15 unit matrix with 45 cells:

Units u: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Coder A * * * * * 3 4 1 2 1 1 3 3 * 3
Coder B 1 * 2 1 3 3 4 3 * * * * * * *
Coder C * * 2 1 3 4 4 * 2 1 1 3 3 * 4

Suppose “*” indicates a default category like “cannot code,” “no answer,” or “lacking an observation.” Then, * provides no information about the reliability of data in the four values that matter. Note that unit 2 and 14 contains no information and unit 1 contains only one value, which is not pairable within that unit. Thus, these reliability data consist not of mN = 45 but of n = 26 pairable values, not in N = 15 but in 12 multiply coded units.

The coincidence matrix for these data would be constructed as follows:

$o_{11}=\{{\text{in }}u=4\}:\,\,o_{11}=\textstyle {\frac {2}{2-1}}+\{{\text{in }}u=10\}:\,\,\textstyle {\frac {2}{2-1}}+\{{\text{in }}u=11\}:\,\,\textstyle {\frac {2}{2-1}}=6$ o13 = {in u=8}: $\textstyle {\frac {1}{2-1}}=1=$ o31
o22 = {in u=3}: $\textstyle {\frac {2}{2-1}}+$ {in u=9}: $\textstyle {\frac {2}{2-1}}=4$ o33 = {in u=5}: $\textstyle {\frac {2}{2-1}}+$ {in u=6}: $\textstyle {\frac {2}{3-1}}+$ {in u=12}: $\textstyle {\frac {2}{2-1}}+$ {in u=13}: $\textstyle {\frac {2}{2-1}}=7$ o34 = {in u=6}: $\textstyle {\frac {2}{3-1}}+$ {in u=15}: $\textstyle {\frac {1}{2-1}}=2=$ o43
o44 = {in u=7}: $\textstyle {\frac {6}{3-1}}=3$ Values v or v′: 1 2 3 4 nv
Value 1 6 1 7
Value 2 4 4
Value 3 1 7 2 10
Value 4 2 3 5
Frequency nv' 7 4 10 5 26

In terms of the entries in this coincidence matrix, Krippendorff's alpha may be calculated from:

$\alpha _{\text{metric}}=1-{\frac {D_{o}}{D_{e}}}=1-{\frac {\sum _{v=1,v'=1}^{V}o_{vv'}\delta _{\text{metric}}(v,v')}{{\frac {1}{n-1}}\sum _{v=1,v'=1}^{V}n_{v}n_{v'}~\delta _{\text{metric}}(v,v')}}.$ For convenience, because products with $\delta (v,v)=0$ and $\delta (v,v')=\delta (v',v)$ , only the entries in one of the off-diagonal triangles of the coincidence matrix are listed in the following:

$\alpha _{\text{metric}}=1-{\frac {1\delta _{\text{metric}}(1,3)+2\delta _{\text{metric}}(3,4)}{{\frac {1}{26-1}}(4\cdot 7\delta _{\text{metric}}(1,2)+10\cdot 7\delta _{\text{metric}}(1,3)+5\cdot 7\delta _{\text{metric}}(1,4)+10\cdot 4\delta _{\text{metric}}(2,3)+5\cdot 4\delta _{\text{metric}}(2,4)+5\cdot 10\delta _{\text{metric}}(3,4))}}$ Considering that all $\delta _{\text{nominal}}(v,v')=1$ when $v{\neq }v'$ for nominal data the above expression yields:

$\alpha _{\text{nominal}}=1-{\frac {1+2}{{\frac {1}{26-1}}(4\cdot 7+10\cdot 7+5\cdot 7+10\cdot 4+5\cdot 4+5\cdot 10)}}=0.691$ With $\delta _{\text{interval}}(1,2)=\delta _{\text{interval}}(2,3)=\delta _{\text{interval}}(3,4)=1^{2},\qquad \delta _{\text{interval}}(1,3)=\delta _{\text{interval}}(2,4)=2^{2},{\text{ and }}\delta _{\text{interval}}(1,4)=3^{2},$ for interval data the above expression yields:

$\alpha _{\text{interval}}=1-{\frac {1\cdot 2^{2}+2\cdot 1^{2}}{{\frac {1}{26-1}}(4\cdot 7\cdot 1^{2}+10\cdot 7\cdot 2^{2}+5\cdot 7\cdot 3^{2}+10\cdot 4\cdot 1^{2}+5\cdot 4\cdot 2^{2}+5\cdot 10\cdot 1^{2})}}=0.811$ Here, $\alpha _{\text{interval}}>\alpha _{\text{nominal}}$ because disagreements happens to occur largely among neighboring values, visualized by occurring closer to the diagonal of the coincidence matrix, a condition that $\alpha _{\text{interval}}$ takes into account but $\alpha _{\text{nominal}}$ does not. When the observed frequencies ovv are on the average proportional to the expected frequencies ev ≠ v', $\alpha _{\text{interval}}=\alpha _{\text{nominal}}$ .

Comparing alpha coefficients across different metrics can provide clues to how coders conceptualize the metric of a variable.

## Alpha's embrace of other statistics

Krippendorff's alpha brings several known statistics under a common umbrella, each of them has its own limitations but no additional virtues.

• Scott's pi is an agreement coefficient for nominal data and two coders.
$\pi ={\frac {P_{o}-P_{e}}{1-P_{e}}}{\text{ where }}P_{o}=\sum _{c}{\frac {o_{cc}}{n}},{\text{ and }}P_{e}=\sum _{c}{\frac {n_{c}^{2}}{n^{2}}}.$ When data are nominal, alpha reduces to a form resembling Scott’s pi:
$_{\text{nominal}}\alpha =1-{\frac {D_{o}}{D_{e}}}={\frac {\textstyle \sum _{c}o_{cc}-\textstyle \sum _{c}e_{cc}}{n-\textstyle \sum _{c}e_{cc}}}={\frac {\textstyle \sum _{c}{\frac {O_{cc}}{n}}-\textstyle \sum _{c}{\frac {n_{c}(n_{c}-1)}{n(n-1)}}}{1-\textstyle \sum _{c}{\frac {n_{c}(n_{c}-1)}{n(n-1)}}}}$ Scott’s observed proportion of agreement $\ P_{o}$ appears in alpha’s numerator, exactly. Scott’s expected proportion of agreement, $\ P_{e}=\textstyle \sum _{c}{\frac {n_{c}^{2}}{n^{2}}}$ is asymptotically approximated by $\textstyle \sum _{c}{\frac {n_{c}(n_{c}-1)}{n(n-1)}}$ when the sample size n is large, equal when infinite. It follows that Scott’s pi is that special case of alpha in which two coders generate a very large sample of nominal data. For finite sample sizes: ${_{\text{nominal}}\alpha }=1-\textstyle {\frac {n-1}{n}}(1-\pi )\geq \pi$ . Evidently, $\lim _{n\to \infty }{_{\text{nominal}}\alpha }=\pi$ .
• Fleiss’ kappa is an agreement coefficient for nominal data with very large sample sizes where a set of coders have assigned exactly m labels to all of N units without exception (but note, there may be more than m coders, and only some subset label each instance). Fleiss claimed to have extended Cohen's kappa to three or more raters or coders, but generalized Scott's pi instead. This confusion is reflected in Fleiss’ choice of its name, which has been recognized by renaming it K:
$K={\frac {{\bar {P}}-{\bar {P}}_{e}}{1-{\bar {P}}_{e}}}{\text{ where }}{\bar {P}}={\frac {1}{N}}\sum _{u=1}^{N}\sum _{c}{\frac {n_{cu}(n_{cu}-1)}{m(m-1)}}=\sum _{c}{\frac {o_{cc}}{mN}},{\text{ and }}{\bar {P}}_{e}=\sum _{c}{\frac {n_{c}^{2}}{(mN)^{2}}}$ When sample sizes are finite, K can be seen to perpetrate the inconsistency of obtaining the proportion of observed agreements ${\bar {P}}$ by counting matches within the m(m − 1) possible pairs of values within u, properly excluding values paired with themselves, while the proportion ${\bar {P}}_{e}$ is obtained by counting matches within all (mN)2 = n2 possible pairs of values, effectively including values paired with themselves. It is the latter that introduces a bias into the coefficient. However, just as for pi, when sample sizes become very large this bias disappears and the proportion $\textstyle \sum _{c}{\frac {n_{c}(n_{c}-1)}{n(n-1)}}$ in nominalα above asymptotically approximates ${\bar {P}}_{e}$ in K. Nevertheless, Fleiss' kappa, or rather K, intersects with alpha in that special situation in which a fixed number of m coders code all of N units (no data are missing), using nominal categories, and the sample size n = mN is very large, theoretically infinite.
$\rho =1-{\frac {6\sum D^{2}}{N(N^{2}-1)}},$ where $\textstyle \sum D^{2}=\sum _{u=1}^{N}{_{\text{ordinal}}\delta }_{c_{u}k_{u}}^{2}$ is the sum of N differences between one coder’s rank c and the other coder’s rank k of the same object u. Whereas alpha accounts for tied ranks in terms of their frequencies for all coders, rho averages them in each individual coder's instance. In the absence of ties, $\rho$ 's numerator $\textstyle \sum D^{2}=ND_{o}$ and $\rho$ 's denominator $\textstyle {\frac {N(N^{2}-1)}{6}}={\frac {n}{n-1}}ND_{e}$ , where n = 2N, which becomes $\ ND_{e}$ when sample sizes become large. So, Spearman’s rho is that special case of alpha in which two coders rank a very large set of units. Again, ${_{\text{ordinal}}\alpha }\geq \rho$ and $\lim _{n\to \infty }{_{\text{ordinal}}\alpha }=\rho$ .
• Pearson's intraclass correlation coefficient rii is an agreement coefficient for interval data, two coders, and very large sample sizes. To obtain it, Pearson's original suggestion was to enter the observed pairs of values twice into a table, once as c − k and once as k − c, to which the traditional Pearson product-moment correlation coefficient is then applied. By entering pairs of values twice, the resulting table becomes a coincidence matrix without reference to the two coders, contains n = 2N values, and is symmetrical around the diagonal, i.e., the joint linear regression line is forced into a 45° line, and references to coders are eliminated. Hence, Pearson's intraclass correlation coefficient is that special case of interval alpha for two coders and large sample sizes, ${_{\text{interval}}\alpha }\geq r_{ii}$ and $\lim _{n\to \infty }{_{\text{interval}}\alpha }=r_{ii}$ .
• Finally, The disagreements in the interval alpha, Du, Do and De are proper sample variances. It follows that the reliability the interval alpha assesses is consistent with all variance-based analytical techniques, such as the analysis of variance. Moreover, by incorporating difference functions not just for interval data but also for nominal, ordinal, ratio, polar, and circular data, alpha extends the notion of variance to metrics that classical analytical techniques rarely address.

Krippendorff's alpha is more general than any of these special purpose coefficients. It adjusts to varying sample sizes and affords comparisons across a wide variety of reliability data, mostly ignored by the familiar measures.

## Coefficients incompatible with alpha and the reliability of coding

Semantically, reliability is the ability to rely on something, here on coded data for subsequent analysis. When a sufficiently large number of coders agree perfectly on what they have read or observed, relying on their descriptions is a safe bet. Judgments of this kind hinge on the number of coders duplicating the process and how representative the coded units are of the population of interest. Problems of interpretation arise when agreement is less than perfect, especially when reliability is absent.

• Correlation and association coefficients. Pearson's product-moment correlation coefficient rij, for example, measures deviations from any linear regression line between the coordinates of i and j. Unless that regression line happens to be exactly 45° or centered, rij does not measure agreement. Similarly, while perfect agreement between coders also means perfect association, association statistics register any above chance pattern of relationships between variables. They do not distinguish agreement from other associations and are, hence, unsuitable as reliability measures.
• Coefficients measuring the degree to which coders are statistically dependent on each other. When the reliability of coded data is at issue, the individuality of coders can have no place in it. Coders need to be treated as interchangeable. Alpha, Scott's pi, and Pearson's original intraclass correlation accomplish this by being definable as a function of coincidences, not only of contingencies. Unlike the more familiar contingency matrices, which tabulate N pairs of values and maintain reference to the two coders, coincidence matrices tabulate the n pairable values used in coding, regardless of who contributed them, in effect treating coders as interchangeable. Cohen's kappa, by contrast, defines expected agreement in terms of contingencies, as the agreement that would be expected if coders were statistically independent of each other. Cohen's conception of chance fails to include disagreements between coders’ individual predilections for particular categories, punishes coders who agree on their use of categories, and rewards those who do not agree with higher kappa-values. This is the cause of other noted oddities of kappa. The statistical independence of coders is only marginally related to the statistical independence of the units coded and the values assigned to them. Cohen's kappa, by ignoring crucial disagreements, can become deceptively large when the reliability of coding data is to be assessed.
• Coefficients measuring the consistency of coder judgments. In the psychometric literature, reliability tends to be defined as the consistency with which several tests perform when applied to a common set of individual characteristics. Cronbach's alpha, for example, is designed to assess the degree to which multiple tests produce correlated results. Perfect agreement is the ideal, of course, but Cronbach's alpha is high also when test results vary systematically. Consistency of coders’ judgments does not provide the needed assurances of data reliability. Any deviation from identical judgments – systematic or random – needs to count as disagreement and reduce the measured reliability. Cronbach's alpha is not designed to respond to absolute differences.
• Coefficients with baselines (conditions under which they measure 0) that cannot be interpreted in terms of reliability, i.e. have no dedicated value to indicate when the units and the values assigned to them are statistically unrelated. Simple %-agreement ranges from 0 = extreme disagreement to 100 = perfect agreement with chance having no definite value. As already noted, Cohen's kappa falls into this category by defining the absence of reliability as the statistical independence between two individual coders. The baseline of Bennett, Alpert, and Goldstein's S is defined in terms of the number of values available for coding, which has little to do with how values are actually used. Goodman and Kruskal's lambdar is defined to vary between –1 and +1, leaving 0 without a particular reliability interpretation. Lin's reproducibility or concordance coefficient rc takes Pearson's product moment correlation rij as a measure of precision and adds to it a measure Cb of accuracy, ostensively to correct for rij's above mentioned inadequacy. It varies between –1 and +1 and the reliability interpretation of 0 is uncertain. There are more so-called reliability measures whose reliability interpretations become questionable as soon as they deviate from perfect agreement.

Naming a statistic as one of agreement, reproducibility, or reliability does not make it a valid index of whether one can rely on coded data in subsequent decisions. Its mathematical structure must fit the process of coding units into a system of analyzable terms.