Calculate the concordance (Rand's and Wallace's Coefficients) between two sets of columns. This function can be used to compare the results of different typing systems.

For calculation, pairs of the results of 2 typing systems $(x,y): x,y \in {Samples}$ of all Samples are created. All pairs are arranged in a 2x2 table, according to their type in both typing systems:

The ratio $\frac{(A+D)}{A+B+C+D}$ is the frequently called in publications the typing system concordance. This value is also known as Rand's coefficient.

However, if comparing two random data sets, concordance calculation does not approach the value 0. Therefore, when calculating the Adjusted Rand coefficient, a correction factor is used to take into account the presence of chance agreement:

Adjusted Rand = $\frac {A+D-n_c}{A+B+C+D-n_c}$ with

$n_c = \frac {n(n^2+1) - (n+1) \sum n_i^2-(n+1) \sum n_j^2+2 \sum \sum n_c = \frac {n_i^2 n_j^2}{n}}{2(n-1)}$

where $n$ represents the total number of Samplesand $n_i, n_j$ represent the numbers of Samples with values $i$ and $j$ for System 1 and System 2.

Wallace's coefficients are calculated by
$W_1 = \frac {A}{A+B}$ and
$W_2 = \frac {A}{A+C}$

They represent the probability that a pair of Samples that have the same type in System 1 also have the same type in System 2 and vice versa. See [Carriço et. al. 2006].

Unknown values are treated as own category.

## References

Carriço J.A., Silva-Costa C., Melo-Cristino J., Pinto F.R., de Lencastre H., Almeida J.S., Ramirez M.: Illustration of a common framework for relating multiple typing methods by application to macrolide-resistant Streptococcus pyogenes., J. Clin. Microbiol. 44:2524-32, 2006