A hypothesis test has the objective of testing different results against each other. You use them to check a result against something you already believe is true. In a hypothesis test, you’re checking if the new alternative hypothesis ${H}_{A}$ would challenge and replace the already existing null hypothesis ${H}_{0}$.

Hypothesis tests are either one-sided or two-sided. In a one-sided test, the alternative hypothesis is left-sided with $p<{p}_{0}$ or right-sided with $p>{p}_{0}$. In a two-sided test, the alternative hypothesis is $p\ne {p}_{0}$. In all three cases, ${p}_{0}$ is the pre-existing probability of what you’re comparing, and $p$ is the probability you are going to find.

**Note!** In hypothesis testing, you calculate the alternative hypothesis to say something about the null hypothesis.

Rule

- 1.
- You formulate a null hypothesis and an alternative hypothesis. ${H}_{0}:p={p}_{0}$ against ${H}_{a}:p>{p}_{0}$ (possibly ${H}_{a}:p<{p}_{0}$ or ${H}_{a}:p\ne {p}_{0}$).
For example, you would have a reason to believe that a high observed value of $p$, makes the alternative hypothesis ${H}_{a}:p>{p}_{0}$ seem reasonable.

- 2.
- Then you do an experiment and find that the event occurs $k$ times.
- 3.
- You calculate the probability that $X\ge k$ (possibly $X\le k$) provided that $p={p}_{0}$.
- 4.
- If this probability is less than $1$ %, $5$ % or $10$ %, then you reject ${H}_{0}$, depending on the level of significance you have selected.

Example 1

**There is a drug on the market that you know cures $\text{}85\text{}\phantom{\rule{0.17em}{0ex}}\text{\%}$ of all patients. A company has come up with a new drug they believe is better than what is already on the market. This new drug has cured 92 of 103 patients in tests. Determine if the new drug is really better than the old one. **

This is a classic case of hypothesis testing by binomial distribution. You now follow the recipe above to answer the task and select $5$ % level of significance since it is not a question of medication for a serious illness.

- 1.
- The null hypothesis is that the new drug is worse or as good as the old one:
$$p=0.85$$ The alternative hypothesis in this case is that the new drug is better. The reason for this is that you only need to know if you are going to approve for sale and thus the new drug must be better:

$$p>0.85$$ - 2.
- You see that the event occurs 92 times, since the new drug cured 92 of 103 patients.
- 3.
- You then calculate the probability of seeing at least one equally high observation in a digital probability distribution tool: $$\begin{array}{llll}\hfill P\phantom{\rule{-0.17em}{0ex}}\left(X\ge 92\right)& =1-P\phantom{\rule{-0.17em}{0ex}}\left(X\le 91\right)\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill & =0.136\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$$$$\begin{array}{lll}\hfill P\phantom{\rule{-0.17em}{0ex}}\left(X\ge 92\right)=1-P\phantom{\rule{-0.17em}{0ex}}\left(X\le 91\right)=0.136& \phantom{\rule{2em}{0ex}}& \hfill \end{array}$$This result indicates that there is a $13.6$ % chance that more than 92 patients would be cured with the old medicine.
- 4.
- You have decided that if the old medicine is to be replaced, then your $p$ value must be less than $5$ %. Therefore, there must be less than a $5$ % chance of rejecting ${H}_{0}$ when the new drug is not better than the old drug. Your $p$ value is
$$p=13.6\phantom{\rule{0.17em}{0ex}}\text{\%}>5\phantom{\rule{0.17em}{0ex}}\text{\%}$$ so ${H}_{0}$ cannot be rejected. The new drug does not enter the market.

If the $p$ value had been less than the level of significance, that would mean that the new drug represented by the alternative hypothesis is better, and that you are sure of this with statistical significance.