#BA = 12, #AB = 3, p <= 0.0352
H0:
AB pairs are as likely as BA pairs.
Assumptions:
Only that the pairs are matched.
Scale:
Nominal
Procedure:
Ignore the pairs with identical labels, count the pairs AB (n+) and the pairs
BA (n-).
Level of significance:
n+ and n- are
binomial distributed with p = q = 1/2
and N = (n+) + (n-).
If k is the smaller of (n+) and (n-) then:
p <= 2 * Sum (i=0 to k) {N!/(i!*(N-i)!)}/4
(with k! = k*(k-1)*(k-2)*...*1 is the factorial of k and 0! = 1)
Approximation:
If (n+) + (n-) = N > 25, then
Z = (| n+ - n- | - 1)/sqrt( N )
can be approximated with a
Standard Normal distribution. In our example, we calculate the exact
probabilities upto N = 100.
For N > 30, the Student t-test can be used.
Remarks:
For McNemar's Test, the same remarks hold as for the
Sign-Test. In many cases, it is the only test that can be applied without
making many unlikely assumptions. This is especially so because, e.g., error
rates in identification experiments tend to be small. As a result, there often
are too few relevant observations to use parametric tests.