mlxtend icon indicating copy to clipboard operation
mlxtend copied to clipboard

Added sample size estimator for a case of binomial proportion

Open pkaf opened this issue 5 years ago • 6 comments

Description

Related issues or pull requests

Pull Request Checklist

  • [X ] Added a note about the modification or contribution to the ./docs/sources/CHANGELOG.md file (if applicable)
  • [ X] Added appropriate unit test functions in the ./mlxtend/*/tests directories (if applicable)
  • [ ] Modify documentation in the corresponding Jupyter Notebook under mlxtend/docs/sources/ (if applicable)
  • [ X] Ran PYTHONPATH='.' pytest ./mlxtend -sv and make sure that all unit tests pass (for small modifications, it might be sufficient to only run the specific test file, e.g., PYTHONPATH='.' pytest ./mlxtend/classifier/tests/test_stacking_cv_classifier.py -sv)
  • [X ] Checked for style issues by running flake8 ./mlxtend

pkaf avatar Sep 16 '20 06:09 pkaf

Coverage Status

Coverage increased (+0.002%) to 90.662% when pulling 4f0717715d662ae59fbe35a942afea1dab4319d2 on pkaf:sample_size_estimator into 276fdd31ee32a58752da92cba915e1edc85a93fb on rasbt:master.

coveralls avatar Sep 16 '20 06:09 coveralls

Thanks a lot! Btw. is there a way you can add some unit tests to make sure the results are as intended? Maybe comparing it with an equivalent implementation in R or sth along these lines?

rasbt avatar Sep 18 '20 19:09 rasbt

Numbers in the LHS of assert statements within test_one_sided_binomial_proportion_estimates() and test_two_sided_binomial_proportion_estimates() are taken from there. Are you suggesting something more/different?

Happy to add.

pkaf avatar Sep 20 '20 05:09 pkaf

Oh I am sorry, I may have overlooked the unit test file before. Sorry, it's been a hectic week due to teaching. Will go over it more carefully soon :)

rasbt avatar Sep 21 '20 20:09 rasbt

All good. Anything please let me know.

pkaf avatar Sep 23 '20 01:09 pkaf

Coming back to this, the context of this function is to compute the sample size for normal approximation intervals / hypothesis tests based on normal approximations? Just asking because we probably should draft a documentation for this. Maybe we could embed this in the context of normal approximation-based confidence intervals and t-tests like I described here on pg. 10: https://arxiv.org/pdf/1811.12808.pdf

rasbt avatar Nov 26 '20 03:11 rasbt