Statistics · Hypothesis testing
1 / 12
Setting up a hypothesis test
The language and structure of a binomial hypothesis test: the population proportion p, the null hypothesis H0 : p = p0 and the alternative hypothesis H1, deciding between a one-tailed (p < p0 or p > p0) and a two-tailed (p ≠ p0) test from the wording, the test statistic X ~ B(n, p0) under H0, and what the significance level means.
Statistics · Hypothesis testing
Setting up a hypothesis test
The language and structure of a binomial hypothesis test: the population proportion p, the null hypothesis H0 : p = p0 and the alternative hypothesis H1, deciding between a one-tailed (p < p0 or p > p0) and a two-tailed (p ≠ p0) test from the wording, the test statistic X ~ B(n, p0) under H0, and what the significance level means.
Why it works
A hypothesis test uses the result of one sample to decide between two competing claims about a population parameter — here a population proportion (the probability of "success": a defective item, a red bead, a late customer). We can't see the whole population, so we reason from how surprising the sample would be if a particular value of were true.The two hypotheses.
- The null hypothesis is the "no change / status quo" claim, and is always an
- The alternative hypothesis is what you are testing for. It takes one of
- — an upper one-tailed test ("increased", "more than", "better");
- — a lower one-tailed test ("decreased", "fewer", "worse");
- — a two-tailed test ("changed", "different", "not equal to").
The test statistic. We assume is true and model the number of successes in the sample as
where is the sample size. We then ask: under this model, how likely is a result as extreme as the one observed? If that probability is small enough, looks implausible.
The significance level. The significance level (commonly or ) is the cut-off for "small enough". Crucially, is the probability of rejecting when it is actually true — the risk of a wrong rejection you are willing to accept. A smaller demands stronger evidence before rejecting .
The decision. Compute the probability, in the relevant tail, of a result at least as extreme as the observed one (assuming ). If it is less than (for a two-tailed test, less than in that tail), the result lands in the unlikely region, so you reject ; otherwise there is insufficient evidence and you do not reject . Every conclusion must be stated in context.