Binomial Test
Table of contents
Binomial Distribution
Binomial distribution is a discrete probability distribution that describes the probability of a success in a binomial (yes-no) experiment.
Each binomial experiment is also called a Bernoulli trial:
- Each trial has binary outcome: success or failure
- Each trial is independent of each other
- The probability of success is the same for each trial, denoted as
- The number of trials is fixed, denoted as
When probability of success
, the distribution is symmetric , the distribution is skewed to the left , the distribution is skewed to the right
Probability Mass Function
Let
Then, the probability mass function of
Binomial Coefficient
where
Then we say that
Sum of Binomial Random Variables
If
Hypothesis Test
Null Hypothesis
Let
Supose we were testing whether a coin is fair or not.
Then, the null hypothesis would be:
Meaning the chances of getting heads or tails are equal.
Calculating the p-value
When the null hypothesis is true, we can plug in
Suppose our sample had 21 heads out of 30 trials.
Now we want to calculate our p-value which is the probability of observing an outcome as extreme as the one we observed, in a binomial distribution with
The probability of this extreme case is the sum of the probabilities of getting 21 or more heads or 9 or less heads:
Remember, with two-tailed test, we need to take both extremes into account.
Based on the results, we can reject the null hypothesis as