Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
79 views
in Technique[技术] by (71.8m points)

How to return decimal result in Binomial Test in Python

I am running a binomial test in python, since the P-value result is too close to 0 so it return 0 directly, but I want to return the exact P value instead of 0, how could I do that?

The code is below

from scipy import stats

p=stats.binom_test(4953,850421,0.002691, alternative='greater')
question from:https://stackoverflow.com/questions/65877786/how-to-return-decimal-result-in-binomial-test-in-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The tolerance of this library is e^-16. Thus, I think it is not possible to get a p-value in this case. In statistics, p-value is the probability of success under conditions of null hypothesis. We require to compare it with 0.01, 0.05, and 0.1 under different alpha-value. Thus, it is useless to use any other value like 0.005. It indicates that assuming null hypothesis is true is misleading. If we use a infinitesimal small probability of making type-I error then the probability of making type-II error will be significantly high.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...