What Is Hypothesis Testing? A Practical Order for Evaluating a Claim
Hypothesis testing is an inferential procedure for evaluating how well sample data fit a specific claim about a population. Define the question, state the null and alternative hypotheses before inspecting results, choose a test that fits the assumptions, and compare its p-value with a prespecified significance level. Not crossing that threshold does not prove the null hypothesis is true.
What does a test compare?
Estimation describes the size of a population mean or proportion, often with an uncertainty interval. A test starts with a proposed value, such as “Is the population preference rate 50%?”, and asks how expected the observed data would be under that claim. The null hypothesis is the reference claim for the test; the alternative hypothesis describes a difference or direction the data could support. Both concern population parameters, not merely sample statistics.
If the question is whether the proportion preferring a feature differs from 50%, use a two-sided alternative. If the question is whether it exceeds 50%, use a right-tailed test. Do not choose the direction after seeing which result looks favorable. Picking a one-sided tail only after looking at both sides makes the reported p-value and error rate misleading. Define the target population, period, and outcome alongside the test direction.
A sequence for producing a test result
| Step | What to do | Why it matters |
|---|---|---|
| 1. Define the question and parameter | Specify the population, period, outcome, and parameter of interest. | Connects the sample calculation to the population claim. |
| 2. Set hypotheses and direction | State the null value and a two-sided, left-tailed, or right-tailed alternative before viewing results. | Changing direction afterward changes the meaning of the p-value and error rate. |
| 3. Check method and assumptions | Select a statistic and reference distribution that fit the data type, independence, pairing, and sampling design. | A p-value from a mismatched method may not have the intended error properties. |
| 4. Choose alpha in advance | Consider the tolerable Type I error and the consequences of a wrong decision. | 0.05 is common, not mandatory; do not choose it after seeing the result. |
| 5. Calculate the statistic and p-value | Assuming the null and test assumptions, calculate the probability of an outcome at least as extreme in the alternative’s direction. | A p-value is conditional on the null model and assumptions. |
| 6. Decide and report in context | Compare p with alpha and reject or fail to reject the null. Also report the estimated effect, interval, assumptions, and limits. | Statistical significance does not replace effect size or practical importance. |
Use fail to reject, not “accept the null.” Data that do not detect a difference are not the same as proof that no difference exists. A small sample or noisy measurement may miss a meaningful effect.
A hypothetical example: 14 of 20 people prefer a feature
This is a hypothetical example, not a result from a real product study. Suppose 20 independent respondents were asked whether they prefer a new feature, and 14 said yes. The target is the preference proportion p in a relevant population. For the question “Does preference differ from 50%?”, write:
Null hypothesis: H₀: p = 0.50
Alternative hypothesis: Hₐ: p ≠ 0.50
The observed sample proportion is 14/20 = 70%. The test does not decide from 70% alone. If the null is true, the count X follows a binomial distribution with 20 trials and success probability 0.5. For a two-sided test, outcomes at least as far from the null expectation of 10 as 14 are 14–20 or 0–6. By symmetry, the exact p-value is:
2 × P(X ≥ 14 | X ~ Binomial(20, 0.5)) = 2 × (60460 / 1048576) ≈ 0.1153
If alpha was set to 0.05 before examining the data, p = 0.1153 is larger, so we fail to reject the null. This does not prove that population preference is exactly 50%; it means 20 responses provide insufficient evidence of a difference from 50%. In a real study, also check whom the sample represents, whether responses are independent, and whether the wording steered preferences.
Error risk, power, and practical meaning
A test decision has two possible kinds of error:
| Reality | Reject the null | Fail to reject the null |
|---|---|---|
| Null is true | Type I error: claim a difference that is not present | Correct decision |
| Null is false | Correct decision | Type II error: miss a real difference |
The significance level alpha is the long-run error-rate criterion for Type I errors when the null is true. Type II error beta is the chance of missing a particular alternative, and power is 1 − beta: the chance of correctly detecting that alternative. Power depends on which effect you want to detect. Small samples and noisy measurements can make it low; increasing sample size often helps, but requires planning and resources.
A very large sample can also make a tiny difference statistically significant. Do not change a feature or policy based on a p-value alone. Consider the estimated effect, its confidence interval, a practical threshold chosen in advance, and the costs of wrong decisions. Repeating many tests also raises the chance of seeing a small p-value by chance, so multiple-testing issues need separate attention.
What to include when reporting a result
The population, period, outcome, and parameter tested
The null and alternative, test direction, and reason it was chosen in advance
The method, key assumptions, sample size, and observed summary
The prespecified alpha, p-value, decision, and a conclusion tied to the question
The effect estimate and interval, practical magnitude, and sampling or measurement limits
Whether multiple hypotheses were explored and how that was handled
For a two-sided test, a confidence interval built under matching assumptions and methods can provide a related view: at the 5% level, the test corresponds to whether the null value falls within the matching 95% interval. This relationship does not automatically apply to every test and interval method, so check their assumptions.
References
Penn State STAT 200: hypotheses, p-values, and test procedures
Penn State STAT 200: Type I and II errors, significance, power, and practical meaning
American Statistical Association: Statement on Statistical Significance and P-Values
NIST Engineering Statistics Handbook: relationship between tests and confidence intervals