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
Same question - left unanswered.
– quantik Jul 03 '17 at 21:14oddsratio$estimatewould be a piece of an object, not a function call). You mean you call the functionoddsratioand look at the returned value ofestimate? Out of curiosity, what was the problem withfisher.testin 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) – Glen_b Jul 03 '17 at 22:48fisher.testwas used, I think I'd still encounter the same problem. – quantik Jul 03 '17 at 23:54