
Binomial Hypothesis Tests
Trent University
Recall the Binomial distribution that we learned about recently. This is the model used for repeated flips of a not-necessarily-fair coin. We write this as:
\[ X \sim \text{Binom}(n, p) \]
where \(n\) is the number of flips of the coin, and \(p\) is the probability of Heads. This may seem artificial, but it’s a really, really good model for success/fail events, which occur all the time in the sciences.
Let \(n=20\) and \(p=0.6\).




When dealing with the binomial distribution, we also want to answer probability problems, like we did with the normal recently. But unlike the normal, we don’t need to do integrals under a continuous curve: the binomial is discrete! That means we can just add stuff up.
0 1 2 3 4 5
1.099512e-08 3.298535e-07 4.700412e-06 4.230371e-05 2.696862e-04 1.294494e-03
6 7 8 9 10 11
4.854351e-03 1.456305e-02 3.549744e-02 7.099488e-02 1.171416e-01 1.597385e-01
12 13 14 15 16 17
1.797058e-01 1.658823e-01 1.244117e-01 7.464702e-02 3.499079e-02 1.234969e-02
18 19 20
3.087423e-03 4.874878e-04 3.656158e-05
This vector contains the probabilities of \(P(X=x)\) for \(x = 0\) through \(x = 20\). With these numbers, we can answer any probability question we want for this particular model.
\(P(X \leq 6) =\) 0.0064659
\(P(X > 11) =\) 0.5955987
\(P(7 < X \leq 13) =\) 0.7289604
The null hypothesis \((H_0)\) often represents either a skeptical perspective or a claim of “no difference” to be tested.
The alternative hypothesis (\(H_A\)) represents an alternative claim under consideration and is (for us, always!) represented by a range of possible values for the value of interest.
Setting Up \(H_{0}\) and \(H_{A}\)
When the hypotheses can be represented as a mathematical expression, the expression that contains equality is the null!
“Containing equality” means: \(=\), \(\leq\), or \(\geq\)
Recall the simulation (10,000 replicates) we did for the gender bias study. We found results that were \(\geq\) the observed statistic (called the test statistic).
Those were results that were as extreme as (the \(=\)) or more extreme than (the \(>\)) the observed difference in proportions.
Let’s try increasing numbers of simulations and see what happens for this case.
Parameters as Numeric Quantities
This doesn’t mean that the variable we are considering is numeric, simply that we are considering a numeric value.
E.g., Proportion of blue cars.
E.g., Count of people with an area code of 613.
In the case of the parameter of interest being the population proportion, our null hypothesis will written with respect to \(p\).
This is some underlying truth about the population that we don’t know.
So our null will always be a statement like:
\[ H_0: p = ??? \]
Later, we will use the sample proportion, \(\hat{p}\), to make a statistical decision.
And what is that something \(??\)? Always the value in the null hypothesis!
Note
Think about what this “test” is: it is a binary decision. Either you decide the evidence (from the data) isn’t rare and odd, so you can’t reject the null; or you decide the evidence is rare, and odd, so you reject the null.
In the latter case, you don’t actually know what the truth is, just that it isn’t the null. So \(>\), \(<\) or \(\neq\) is the best you can do.
In such a case, we say that the null distribution is a Binomial.
Perform a test where you require that the observed outcome be very rare (less than 0.02 probability) in order to believe the exceptional claim she is making.
Convert this into math. From the provided population average:
\[ H_0: p = 0.10 \]
Her exceptional claim: that she is better than the average, and her patients experience less complications than average.
\[ H_A: p < 0.10 \]
Finally, from the patient information:
\[ X = 3 \quad \text{ or } \quad \hat{p} = 3/62 = 0.0483871 \]
We don’t round!
That is:
\[ X \sim \text{Binomial}(n=62, p=0.10) \]
Today’s topic was drawn from Chapter 16 of Introduction to Modern Statistics (2e).
