Setting Up a Hypothesis Test
A sample result is never exactly what theory predicts, even when theory is correct. A hypothesis test is a formal way of asking: is this difference real, or just noise?
Null and alternative hypotheses
Every hypothesis test starts with two competing claims about a population parameter — here, a binomial probability $p$.
A test never proves $H_0$ true. It either finds enough evidence to reject $H_0$ in favour of $H_1$, or it doesn't — in which case $H_0$ is simply not rejected, not confirmed.
A one-tailed test is used when you're only interested in a change in one specific direction ("has the proportion increased?"). A two-tailed test is used when you're interested in any change ("has the proportion changed at all?"). The wording of the question — "increased", "decreased", "changed", "is different from" — decides which to use, and must be decided before looking at the data.
Significance level and critical region
The significance level, usually $5\%$ or $1\%$, is the threshold probability used to judge whether a result is unusual enough to doubt $H_0$. The critical region is the set of values of the test statistic so extreme that, if observed, $H_0$ would be rejected — chosen so that the probability of the test statistic falling in it (assuming $H_0$ is true) is as close as possible to the significance level, without exceeding it.
1. State $H_0$ and $H_1$ in terms of $p$.
2. Identify the test statistic and the distribution it follows under $H_0$.
3. Find the critical region at the given significance level.
4. Compare the observed value against the critical region.
5. State a conclusion in the context of the original question.
Worked example 1
Always define $p$ in words first ("the true proportion of satisfied customers") before writing the hypotheses symbolically — a bare "$H_0: p=0.6$" with no definition of $p$ often loses marks even if the numbers are correct.
Worked example 2
This decision must be made from the wording of the research question before any data is collected or examined — choosing the test direction based on which way the data happens to point is a serious methodological error, since it effectively cheats the significance level.
Worked example 3
Every later step of a hypothesis test — finding the critical region, computing a p-value — depends entirely on knowing the test statistic's distribution under the assumption that $H_0$ is true. Getting this distribution right, including checking the binomial conditions, is the foundation the rest of the test is built on.
$H_0$ always states a specific, testable value ($p=p_0$) — never a vague claim or an inequality. Inequalities belong only in $H_1$. And "not rejecting $H_0$" is not the same as "proving $H_0$ true" — a test can only ever find evidence against the null hypothesis, never evidence definitively for it.
Check yourself
A website claims 25% of visitors make a purchase. A manager wants to test whether this proportion has changed, in either direction. State $H_0$ and $H_1$, and say whether the test is one-tailed or two-tailed.
(Hint: "changed" — has a direction been specified?)