Repository navigation
BUG/ENH: proportion_confint: impose bounds, support asarray and pandas - #4410
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4410 +/- ##
==========================================
+ Coverage 80.03% 80.04% +<.01%
==========================================
Files 560 560
Lines 84277 84319 +42
Branches 9545 9554 +9
==========================================
+ Hits 67452 67490 +38
- Misses 14602 14603 +1
- Partials 2223 2226 +3
Continue to review full report at Codecov.
|
|
There is a disagreement for jeffreys for proportions close to or at the boundary between statsmodels and R and same at 0/30 and 1/30 I don't know what R binom is doing. We just use a beta distribution based on a prior that corresponds to a (0.5, 0.5) presample observation. |
fb56dfd to
9cc4146
Compare
|
(silly indexing mistake, and I was running the wrong tests function locally, |
|
ok about jeffreys/bayes R binom binom.confint uses a highest density interval for bayes by default, while I use 'central' compared to There is still a discrepancy at 0/30, where R binom seems to shift the weight to the other tails I ignore this for now, maybe mention it in docstring. I just found a bug in pandas handling while trying these example. no unit tests for using lists, so this broke. |
|
all green docstring needs some work and updating, otherwise ready to merge |
|
What I haven't done here is to replace the binom.test reference numbers by those from binom.bayes with centered confint type. R's binom has a few more confidence intervals, but we should be able to replicate those with GLM by choosing the corresponding link function. Likelihood Profile confidence intervals are not yet merged, AFAIR. Nevertheless, I want to stop for this round and merge when green. (and open a new issue for another round) |
|
I made a mistake in the docstring, maybe. binom.bayes corresponds to jeffreys in which binom.test uses highest density, and adjusts at boundary if centered. I added it in the description of Clopper-pearson exact ci. Both jeffreys and beta are centered and don't shift probability at the boundary from one tail to the other. |
|
all green except for a test_simulate hang on one of the appveyor's (I will force push an amended commit to adjust the docstring, then merge right away. No need to run ci testing again on PR.) |
43cbd7e to
c16ef02
Compare
closes #2742, see discussion there
also closes #2609
fixes nan and out of bounds issue
adds asarray, but returns pandas if pandas was used
no additional unit tests yet