Equality criterion for paired and unpaired allele tests (source code)

= Equality criterion for paired and unpaired allele tests

Let a paired binary table have cells $a,b,c,d$ and $n=a+b+c+d$. The uncorrected <McNemar test> is $(b-c)^2/(b+c)$, while the ordinary independent-sample <chi-squared test> on the two marginal allele columns is $2n(b-c)^2/[(2a+b+c)(2d+b+c)]$. For nonzero difference and positive denominators, they coincide exactly when $(2a+b+c)(2d+b+c)=2n(b+c)$. Such numerical coincidence does not justify discarding pairing; altering concordant counts can change the unpaired statistic while leaving McNemar's statistic unchanged.

// Target: biology.bigb