4

I am calculating two different $p$ values for the McNemar test and what I believe is the corresponding exact test, even for combined counts larger than 25.

Take, for example the contingency table

                   Posttest
Pretest      Outcome A   Outcome B
Outcome A       xx          50
Outcome B       65          xx

The chi-square statistic is $$\chi^2=\frac{(50-65)^2}{50+65}=1.96,$$ with $$p=0.1619. \tag{R}$$

According to Sheskin (2011, Test 20, VI.3, pg 844), the exact test for these situations is essentially a binomial sign test (for a single sample) with parameter $\pi=0.5$ and the two counts equal to the two the cells of interest in the contingency table. My understanding of this is that I'm calculating the probability that, out of $50+65=115$ trials with probability of success 0.5, at least 65 of them are successes. My attempt to calculate this for the particular situation above is: $$ p = \sum_{i=65}^{115} \begin{pmatrix} 115 \\ i \end{pmatrix} 0.5^{i}\ 0.5^{115-i} = 0.0957 \tag{Mathematica} $$

Why do these two $p$-values differ so much? Am I making a simple mistake?

Waldir Leoncio
  • 2,137
  • 6
  • 28
  • 42
BMS
  • 155
  • 8
  • I've just one again checked it in SPSS. McNemar = Sign test for dichotomous data (asymptotic = asymptotic, exact = exact). – ttnphns Jun 05 '14 at 06:30

2 Answers2

4

Two points:

1. Continuity Correction

McNemar's test uses discrete data (counts of discordant pairs) to produce a $\chi^{2}$ test statistic with one degree of freedom. However, the $\chi^{2}$ distribution is not discrete, but continuous. Hence, the need for a continuity correction.

$\chi^{2}=\frac{\left(\left|50-65\right|-1\right)^{2}}{\left(50+65\right)} = 1.781818$

$p = \text{P}\left(X^{2}_{\text{df}=1} \ge \chi^{2}\right) = 0.182$

2. Two-sided Test

$0.0957 \times 2 = 0.191 \approx 0.182$

Although, even without the continuity correction $0.191 \approx 0.162$ (kinda).

Alexis
  • 26,219
  • 5
  • 78
  • 131
  • Thanks! I thought something was fishy when I was leaving out the sum from 0 to 50. And I think I have more respect for the continuity correction now. – BMS Jun 05 '14 at 04:04
1

The actual chi-square statistic is discrete, not continuous - the chi-square distribution is an asymptotic continuous approximation.

If you simulate the distribution of the chi-square statistic under the null hypothesis, you can properly compare p-values.

Glen_b
  • 257,508
  • 32
  • 553
  • 939