You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ENH: binom_test 2-sided is minlike, add centered #2735
(I didn't realize this before, but I ran into problems explaining binom_test in a notebook.)
binom_test from scipy.stats is reused in statsmodels but it's not a centered test, it's minlike in Fay's terminology
from exactci documentation:
minlike: sum probabilities of all likelihoods equal or less than observed
central: double minimum one-sided p-value
blaker: combine smaller observed tail probability with opposite tail not greater than observed tail
The following function replicates the results from exactci "central"
Note "minlike" looks more powerful, scipy binom_test matches R's binom.test (verified)
However we need central for consistency with one-sided tests and equivalence tests.
(Note Fisher's exact test as implemented is also minlike)
follow-up
there is currently a function binom_test_reject_interval which is for central binomial and not for minlike. This matches several functions in R, AFAIR, that also don't take into account that the standard binom_test is minlike. The notebook has plots for the difference in power between the two.
R package MESS looks like it has the correct power for minlike binomial test, power.binom.test.
Activity
josef-pkt commentedon Dec 20, 2015
The example and code to look into this is currently in a notebook in josef-pkt/misc#11
josef-pkt commentedon May 30, 2016
followup to merge of #2935 unit tests and check minlike versus central for the proportion_confint
josef-pkt commentedon May 4, 2020
inheriting the behavior
exact conditional 2-sample poisson test (#6677 (comment)) and, AFAIR, paired binomial test (McNemar) inherit behavior of binom test.