Therefore, Cohen's kappa can be written as Ka = (p0 - pe)/ (1 - pe), where, overall proportion of observed agreement p0 = (n11 + n22 + …. + nkk + nk+1k+1)/n, is the sum of diagonal entries in the table divided by n; and, overall proportion of chance-expected agreement pe = (n1. x n.1 + n2. x n.2 + … + nk. x n.k + nk+1. x n.k+1)/n2 is the sum of the products of the marginal frequencies divided by n2 .