Extention from McNemar test to r by r table (r>2).
Ho: \(p_{ij} = p_{ji}\) for all different i,j.
Ha: not equal
The test is finding whether there is a categorical shift from i pre-treatment to j post-treatment.
Stuart.Maxwell.Test(noncen, p.ij, p.ji, r)
the solution of the equation, which is non-central parameter of non-central chisquare distribtuion .
the probability of shift from i pre-treatment to j post-treatment
the probability of shift from j pre-treatment to i post-treatment
r by r tables, r is df
Chow SC, Shao J, Wang H. Sample Size Calculation in Clinical Research. New York: Marcel Dekker, 2003