(Basic Statistics for Citizen Data Scientist)
Hypothesis Testing for Binomial Distribution
Example 1: Suppose you have a die and suspect that it is biased towards the number three, and so run an experiment in which you throw the die 10 times and count that the number three comes up 4 times. Determine whether the die is biased.
Define x = the number of times the number three occurs in 10 trials. This random variable has the binomial distribution where π is the population parameter corresponding to the probability of success on any trial. We use the following null and alternative hypotheses:
H0: π ≤ 1/6; i.e. the die is not biased towards the number 3
H1: π > 1/6
Setting α = .05, we have
P(x ≥ 4) = 1–BINOM.DIST(3, 10, 1/6, TRUE) = 0.069728 > 0.05 = α.
and so we cannot reject the null hypothesis that the die is not biased towards the number 3 with 95% confidence.
Example 2: We suspect that a coin is biased towards heads. When we toss the coin 9 times, how many heads need to come up before we are confident that the coin is biased towards heads?
We use the following null and alternative hypotheses:
H0: π ≤ .5
H1: π > .5
Using a confidence level of 95% (i.e. α = .05), we calculate
BINOM.INV(n, p, 1–α) = BINOM.INV(9, .5, .95) = 7
which means that if 8 or more heads come up then we are 95% confident that the coin is biased towards heads, and so can reject the null hypothesis.
We confirm this conclusion by noting that P(x ≥ 8) = 1–BINOM.DIST(7, 9, .5, TRUE) = 0.01953 < 0.05 = α, while P(x ≥ 7) = 1–BINOM.DIST(6, 9, .5, TRUE) = .08984 > .05.
Example 3: Historically a factory has been able to produce a very specialized nano-technology component with 35% reliability, i.e. 35% of the components passed its quality assurance requirements. They have now changed their manufacturing process and hope that this has improved the reliability. To test this, they took a sample of 24 components produced using the new process and found that 13 components passed the quality assurance test. Does this show a significant improvement over the old process?
We use a one-tailed test with null and alternative hypotheses:
H0: p ≤ .35
H1: p > .35
p-value = 1–BINOM.DIST(12, 24, .35, TRUE) = .04225 < .05 = α
and so conclude with 95% confidence that the new process shows a significant improvement.
Statistics for Beginners in Excel – Hypothesis Testing for Binomial Distribution
Disclaimer: The information and code presented within this recipe/tutorial is only for educational and coaching purposes for beginners and developers. Anyone can practice and apply the recipe/tutorial presented here, but the reader is taking full responsibility for his/her actions. The author (content curator) of this recipe (code / program) has made every effort to ensure the accuracy of the information was correct at time of publication. The author (content curator) does not assume and hereby disclaims any liability to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from accident, negligence, or any other cause. The information presented here could also be found in public knowledge domains.
Learn by Coding: v-Tutorials on Applied Machine Learning and Data Science for Beginners
Latest end-to-end Learn by Coding Projects (Jupyter Notebooks) in Python and R:
All Notebooks in One Bundle: Data Science Recipes and Examples in Python & R.
End-to-End Python Machine Learning Recipes & Examples.
End-to-End R Machine Learning Recipes & Examples.
Applied Statistics with R for Beginners and Business Professionals
Data Science and Machine Learning Projects in Python: Tabular Data Analytics
Data Science and Machine Learning Projects in R: Tabular Data Analytics
Python Machine Learning & Data Science Recipes: Learn by Coding
R Machine Learning & Data Science Recipes: Learn by Coding
Comparing Different Machine Learning Algorithms in Python for Classification (FREE)
There are 2000+ End-to-End Python & R Notebooks are available to build Professional Portfolio as a Data Scientist and/or Machine Learning Specialist. All Notebooks are only $29.95. We would like to request you to have a look at the website for FREE the end-to-end notebooks, and then decide whether you would like to purchase or not.