# Alternatives to McNemar-Bowker test when symmetrical cells have zero count in contingency matrix

I need to test the difference between pre- and post- intervention over a 4-grades parameter computed on 57 samples. The contingency matrix on which I need to compute a McNemar test for paired data (McNemar-Bowker test) is the following: I obtain McNemar's chi-squared = NaN and p-value = NA as a result when I perform mcnemar.test(matrix) in R, and I know this is due to cells [1,3] and [3,1], in this case, both containing a zero.
My question is: is there any alternative test to assess the pre/post intervention difference of these samples, or any correct way to transform these data, so to make possible to perform the McNemar-Bowker test?

• This answer mentions the exact version of McNemar-Bowker. I've never tried it, so can't speak. – ttnphns Jul 21 '16 at 15:46
• Note that McNemar-Bowker ignores pairs of symmetric cells with both frequencies zero. Such pairs seem to be not problematic. The problem is when one or both symmetric cells have nonzero but low frequency, such as when the sum therein is less that 10, - then exact test would be necessary. (Have read it somewhere but don't remember where.) – ttnphns Jul 21 '16 at 16:10
• It seems to me that the problem is represented by symmetrical cells [1,3] and [3,1], both containing a zero. I say this because, if I attempt to perform the test on the same matrix, but with values multiplied by e.g. 120, the result is still NA in spite of all symmetric cells' sums being way higher than 10 (except [1,3]+[3,1]=0). If I instead modify that matrix containing much larger counts by simply putting a 1 or any other non-zero value in [3,1] or in [1,3], it returns an interpretable result, with a chi-squared value, degrees of freedom and the corresponding p-value. – Franz Jul 22 '16 at 10:13
• Franz, I'm not R user. I wonder why it returns NA. With your table shown, SPSS returns statistic=16.679 df=5 p=.005150. (This doesn't necessarily means the asymptotic p-value is unbiased with the not large sample.) With all the frequencies*100 it returns me statistic=1667.912 df=5 p=.000000. With the frequencies*100 plus all zeros changed to 1s, SPSS gave me statistic=1664.932 df=6 p=.000000. – ttnphns Jul 22 '16 at 10:45
• Thanks, it is useful to know that using SPSS, a result is returned. However I don't understand why different software behave differently with regards to the same test. I will keep investigating, but I also thought that maybe a Wilcoxon signed-rank test for paired data could represent a correct alternative test to extrapolate whether the distribution of individuals in the different classes significantly changes between pre- and post-intervention... – Franz Jul 22 '16 at 13:12