1
$\begingroup$

I'm trying to calculate an odds ratio for a table with very few cases. I've tried epitools oddsratio which I see won't work as the uniroot function error occurs due to dividing by 0.

The table is as follows:

           Outcome
Program  Yes    No
      X    6     0
      Y 9994 10000

I've tried fishers test using epitools function, and epi2by2 also. I know it would seem to not be the right test but I need the odds ratio on this sample for comparison to later mining methods which return more higher positives, so results to show before and after mining methods applied.

Fishers test returns:

Fisher's Exact Test for Count Data

data:  data
p-value = 0.03123
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
 1.177777      Inf
sample estimates:
odds ratio 
       Inf 

So this is uninterpretable and obviously the too few cases will give that un-iformative wide confidence interval.

Epi.2by2 Odds Ratio test returns:

Point estimates and 95% CIs:
-------------------------------------------------------------------
Prevalence ratio                               NaN (NaN, NaN)
Odds ratio                                     NaN (NaN, NaN)
Attrib prevalence in the exposed *             0.06 (0.01, 0.11)
Attrib fraction in the exposed (%)            NaN (NaN, NaN)
Attrib prevalence in the population *          0.03 (0.01, 0.05)
Attrib fraction in the population (%)         100.00 (NaN, 100.00)
-------------------------------------------------------------------
Yates corrected chi2 test that OR = 1: chi2(1) = 4.168 Pr>chi2 = 0.041
Fisher exact test that OR = 1: Pr>chi2 = 0.031
 Wald confidence limits
 CI: confidence interval
 * Outcomes per 100 population units 

I can draw no conclusions from this. HOWEVER, when I use MedCalc I get an Odds Ratio of 13, though of course a very very wide confidence interval. See below:

Odds ratio  13.0078
95 % CI:    0.7327 to 230.9443
z statistic 1.748
Significance level  P = 0.0805

I just don't know how to interpret this over the three tests. Is the very high Odds Ratio undermined completely by significance level and wide conf interval. And why is this odds so high which fits the data but the rest seems inconclusive...How do I report these results?

$\endgroup$
2
  • $\begingroup$ Odds ratio cannot be calculated in a standard way in this case. The fact that MedCalc produces a result is more a consequence of imperfect implementation in the software than it is a true answer. By the way, the MadCalc page medcalc.org/calc/odds_ratio.php also lists the formulas that were supposedly used. It clearly shows that division by zero occurred. $\endgroup$ Commented Jun 14, 2023 at 12:54
  • $\begingroup$ Have a look at this paper. $\endgroup$ Commented Jun 14, 2023 at 16:05

1 Answer 1

2
$\begingroup$

Assuming that the zero isn't a "structural zero", with zeros or low cell counts it's common to use the Haldane-Anscombe correction, which is simply to add 0.5 to all cells.

Some software packages do this by default.

Also note that some software packages report log odds by default, or use other algorithms to calculate odds ratio.

It's not clear to me exactly which package and function you are using, but the following gives the same results as your MedCalc:

Input =("
Program  Yes    No
X          6     0
Y       9994 10000
")

Matrix = as.matrix(read.table(textConnection(Input), header=TRUE, row.names=1))

library(epitools)

Matrix2 = Matrix + 0.5

oddsratio(Matrix2, method="wald")$measure

   ### odds ratio with 95% C.I. estimate     lower    upper
   ###                       X   1.0000        NA       NA
   ###                       Y  13.0078 0.7326957 230.9321
$\endgroup$

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.