In R, if I use the function mcnemar.exact from the exact2x2 package for my data set I get the following results:

    Exact McNemar test (with central confidence intervals)

data:  Matrix.3
b = 7, c = 12, p-value = 0.3593
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
 0.1945802 1.6070322
sample estimates:
odds ratio 

My question is: how was the odds ratio at the bottom calculated? I looked it up in the docs for the exact2x2 library and it says: "an estimate of the odds ratio. Note that the conditional Maximum Likelihood Estimate (MLE) rather than the unconditional MLE (the sample odds ratio) is used."

But no equation is provided.

What equation yielded the value 0.5833333?

  • 1
    $\begingroup$ The help on this function discusses references. It looks like the Breslow & Day reference and the Fay paper in R-Journal would be the ones to check. There also appears to be some related discussion in the exactMcNemar.pdf vignette that comes with the package. I don't know if any of these have exactly what you seek, but that's where I'd look. $\endgroup$
    – Glen_b
    Commented Aug 9, 2021 at 3:18
  • 1
    $\begingroup$ Thank you, I looked at the paper you linked and unfortunately the equation is not there. I looked at the vignette and none of the provided equations yield the value. Those were good suggestions and one of them should have given me the solution I'm looking for. Strange, to be sure! $\endgroup$ Commented Aug 9, 2021 at 16:29

1 Answer 1


Ok. First, note b = 7, c = 12 in the output Second, note that 7/12=0.5833333.

In a $2\times 2$ table of matched binary data with cells labelled $a$, $b$, $c$, $d$, the ratio $b/c$ of the two off-diagonal cells is the Mantel-Haenszel estimate of the odds ratio. For matched-pair data, this is also the conditional MLE.

In general, there's no straightforward formula for the conditional MLE, it's just the number that maximises the conditional likelihood, which is a complicated sum over all sets of possible tables agreeing with the observed margins.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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