In analogy to a similar post on continuous data, I ask the following. In paired discrete data, we test the frequentist hypothesis of equivalent marginal distributions of two discrete variables $X$ and $Y$ with the McNemar test. For example when both variables are dichotomous with cell probabilities

$$P(X=i,Y=j) = \pi_{ij} \quad; \quad i,j \in \{0,1\}$$

and marginal probabilities $\pi_{+j}$ and $\pi_{i+}$, marginal homogeneity is tested one-sided as

$$H_0: \pi_{1+} \ge \pi_{+1},$$

which is equivalent to

$$H_0: \pi_{10} \ge \pi_{01},$$

known as symmetry.

What is the adequate Bayesian analysis for this contingency table?

  • $\begingroup$ In a pithy response, a subjective Bayesian would place zero prior probability on your null hypothesis (in the vast majority of scenarios) and therefore there is no reason for such a test. $\endgroup$ – jaradniemi Feb 15 '17 at 20:14
  • $\begingroup$ Have you searched the literature? A quick search turned up this article which seems relevant. journals.math.tku.edu.tw/index.php/TKJM/article/viewFile/605/… $\endgroup$ – jaradniemi Feb 15 '17 at 20:15
  • $\begingroup$ @jaradniemi Thanks. To make it more applicable to Bayesian thinking I turned it into a one-sided hypothesis. I searched the literature without success. Will check out the link you sent. $\endgroup$ – tomka Feb 15 '17 at 20:29
  • $\begingroup$ With the new version, I would just treat it as a parameter estimation problem and calculate the area under the posterior consistent with the hypothesis. $\endgroup$ – jaradniemi Feb 16 '17 at 15:37

I have not seen any Bayesian factor counterpart to the McNemar test. However, there are some Bayesian counterparts which can be viewed as the McNemar test. Keep in mind that there are several variations of the McNemar test, each of which has their own merits/pitfalls.

For the exact McNemar test, which is arguably the most widely-used test in this family, there are several solutions. One simple approach is to use the beta-binomial conjugate to simply calculate the posterior probability) One drawback of the beta-binomial conjugate is that it only considers two states from events A and B: either A > B and A < B. So, this test throws away the samples that A and B have the same value (both success or both fail.) To take into account the equality of A and B, you should use the Dirichlet-trinomial test which can be find here. The third approach is to use the Bayesian Sign test. If you set p=0.5 in the McNemar exact test, then it is equivalent to the Sign test. The Bayesian Sign test's implementation can be found here.

I hope this helps. Unfortunately, I could not post more than two link. You can google various frequentist McNemar test (asymptotic, asymptotic with continuity correction, exact, mid-p) and you can find suitable resources for the beta-binomial conjugate.

  • $\begingroup$ You have not set up any links. $\endgroup$ – Michael Chernick May 13 '17 at 21:53
  • $\begingroup$ @ Michael Chernick $\endgroup$ – Majid Mohammadi May 14 '17 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.