Repository navigation
Conversation
|
Hello @josef-pkt! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:
|
| pt = ExactTwoProportion(yo1, n1, yo2, n2) | ||
|
|
||
| print(pt.chisquare_proportion_indep(yo1, yo2)) | ||
| print(pt.chisquare_proportion_indep(yo1, yo2, alternative='todo')) |
| if alternative == '2-sided': | ||
| pvalue = stats.chi2.sf(stat, 1) | ||
| else: | ||
| pvalue = stats.norm.sf(stat) |
| If None, then the default method is used, currently a grid. | ||
| If int, then the integer specifies the number of grid points. | ||
| If grid is a tuple, then either the values are integers for linspace or | ||
| ('bb', alpha, n_points) for Berger, Boos limitats for the maximum. |
There was a problem hiding this comment.
Berger-Boos looks a bit hidden with this interface
|
|
||
| This is an exact pvalue and maintains and guarantees the size. | ||
|
|
||
| `grid` argument is currently not used. |
There was a problem hiding this comment.
sentence looks outdated
| pvm_ind = res[:,1].argmax(0) | ||
| pval = np.clip(res[pvm_ind, 1] + bb_correct, 0, 1) | ||
|
|
||
| return pval, res[pvm_ind, 0], pvm_ind, res |
There was a problem hiding this comment.
return Holder instance
|
I'm not sure I can merge this PR with just a few changes. I don't remember enough, especially what structure we would need for future enhancements. What other cases does this need to handle in future? Code looks overall fine as experimental version. unit tests against article and Berger-Boos website. currently only equality hypothsis "Tests for equality of two independent proportions" I guess this could be extended to call other test statistics function for the base statistic that defines the rejection region. Then we could define "exact" p-values for any two-sample proportion test. Too much work (especially, I don't want to go through the literature right now) |
|
In poisson we have we can do the same here I implemented poisson etest in a simpler way using just a function instead of using a class as in here IIRC: the "exact" version here is max and BB, (i.e. sup over nuisance parameter) |
rebased version of #2608 from 2015
no merge conflict, no extra changes