# Odds ratio MLE calculation: unconditional vs conditional?

I am running an odds ratio calculation for site methylation amongst cases and controls.

In this situation is it preferable to use a conditional or unconditional MLE? I am asking because R uses a conditional estimator while scipy uses an unconditional estimator. See here.

As a result, I am getting differences in the p-values calculated. I found an article from 1984 which suggests that conditional MLE is far superior. If this is the case, why does scipy API suggest that using unconditional MLE is much more common?

It was also asked here by gotgenes. But no answer was provided so far.

odds_extractor <- function(cpg_id,disease,control){
# Make a temporary data frame to hold just one cpg site frequency table
temp <- cpg_list[[cpg_id]][c(disease, control),]
# Get all of the a,b,c,d values
a <- as.numeric(temp[1,1])
b <- as.numeric(temp[1,2])
c <- as.numeric(temp[2,1])
d <- as.numeric(temp[2,2])
# Perform the odds ratio calculation
oddsratio(a+rts,b+rts,c+rts,d+rts)

}
...
writting[i,4] <- odds_extractor(names(cpg_list)[i],disease,control)$estimate  • Given the commentary around when this was implemented, I suspect the scipy developers haven't a clue what the difference is. – Devon Ryan Jul 3 '17 at 21:02 • @DevonRyan That's actually quite useful. I did not stumble upon that. And yes it might be good to move it to cross-validated - though considering odds ratios are a popular metric amongst biostatisticians it's probably useful here too. Jul 3 '17 at 21:05 • Your comment is slightly unclear (since oddsratio$estimate would be a piece of an object, not a function call). You mean you call the function oddsratio and look at the returned value of estimate? Out of curiosity, what was the problem with fisher.test in vanilla R, which produces an odds ratio and computes a p-value for Fisher's exact test? (Fisher's exact text conditions on the marginal totals, which I presume is the conditioning under discussion here) Jul 3 '17 at 22:48
• Probably related: stats.stackexchange.com/q/54530/82584
– bli
Jul 4 '17 at 7:15
• Was the 1984 article you mention the one by Hauck? Jul 5 '17 at 21:42