Created
February 17, 2017 23:33
-
-
Save Bollegala/9d304680503d6890e13ce98669e5edd2 to your computer and use it in GitHub Desktop.
Binomial Exact Test with Clopper-Pearson Confidence Intervals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from statsmodels.stats.proportion import proportion_confint as binofit | |
# download statmodels from: http://statsmodels.sourceforge.net/ | |
import sys | |
acc = float(sys.argv[1]) | |
# 0.01 confidence intervals | |
easy_interval = binofit(acc * 400, 400, 0.01) | |
print "0.01 interval = ", easy_interval | |
strict_interval = binofit(acc * 400, 400, 0.001) | |
print "0.001 interval = ", strict_interval |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment