Contradicting p-value and confidence interval in the Mantel-Haenzsel Test [R-Code] This is a part of the appendix to a past paper I have but it is just essentially R-Code.
For the Mantel-Haenszel test, the p-value is greater than 5% so I would Fail To Reject the null hypothesis that there is no partial association at any level of the third variable.
However, the 95% confidence interval [0.530 090 09, 0.998 165 1] does not contain 1. Although it almost does. It seems that I would Reject the null hypothesis.
Am I interpreting this correctly? I can see that it does not seem to be very significant at a 5% level but I wouldn't expect the test to lead to different conclusions.


 A: Well, the p-value is generated based on comparing the observed value of the test statistic with an appropriate chi-square distribution (by 'appropriate' I refer to the degrees of freedom used for parameterizing the chi-square distribution). 
I can't find a specific mention of the method used for calculating the confidence interval in the documentation for the mantelhaen.test function, but typically these confidence intervals are based on a normal approximation; e.g. the interval is defined by $[\frac{OR}{EF},OR\times EF]$ where OR is the odds ratio and EF is the "exposure factor" (as it is sometimes referred to in epidemiology), which is defined as $exp(1.96 \times SE)$, where SE is the standard error of the odds ratio estimate. That is, the width of the confidence interval is based on the standard normal distribution (that's where the 1.96 comes from). 
So, it would seem to me that there is no surprise that the two won't exactly agree, since they are using fundamentally different (albeit related) methods. While both are testing the same null hypothesis, one of them is based on a chi-square approximation and the other is based on a normal approximation. 
