# In R, how is a "conditional MLE" calculated for the odds ratio of an exact McNemar test?

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
0.5833333


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?

• 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. Commented Aug 9, 2021 at 3:18
• 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! Commented Aug 9, 2021 at 16:29

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.