Hypothesis Testing in Biostatistics
On this page 19 sections
Overview
Clinical Medicine Year 2 • Biostatistics
Hypothesis testing in biostatistics is a planned method for using sample data to evaluate a specific claim about a population, such as whether two treatments differ in mean blood pressure or whether an exposure is associated with a health outcome. A test does not prove a hypothesis true or false. It quantifies how incompatible the observed data are with a defined null model, subject to the sampling design, measurement quality and statistical assumptions. Correct interpretation also considers effect size, a confidence interval, clinical importance and possible bias.
Learning outcomes
After this lesson, you should be able to define null and alternative hypotheses; distinguish one-sided and two-sided tests; explain alpha, p-value, Type I and Type II errors and power; match basic tests to questions and data structures; interpret decisions without saying “accept the null”; and report statistical evidence alongside effect estimates and limitations.
1. From a research question to a testable claim
A research question asks about a population, outcome, comparison or relationship. A statistical hypothesis expresses a claim about a population parameter in measurable terms. For example, “Does an appointment reminder improve attendance?” becomes a question about a defined attendance outcome, time period and comparison. The relevant parameter might be a risk difference, risk ratio or odds ratio, depending on the design and objective.
Testing is not a substitute for a good design. A trial may compare assigned groups; an observational study may compare exposure groups but remain vulnerable to confounding. State the unit of analysis, eligibility criteria, outcome definition and estimand before selecting the test. A p-value cannot repair inaccurate records, non-random recruitment or a mismatched analysis.
2. Null and alternative hypotheses
The null is a statistical reference, not a claim that “nothing happened” in every clinical sense. The alternative is not automatically the investigator’s preferred explanation. Write hypotheses in words and symbols, define the parameter and outcome, and make sure the direction matches the question.
3. One-sided and two-sided alternatives
A two-sided alternative allows an effect in either direction, for example that a new service could increase or decrease attendance. A one-sided alternative specifies a direction in advance. Use a one-sided test only when the opposite direction would not be treated as evidence of interest or safety concern and the justification is set before examining results. Choosing a one-sided test after seeing which direction the estimate went inflates the chance of a false positive and is not defensible.
4. Significance level and decision rule
The significance level, alpha (α), is a threshold selected before analysis for the long-run Type I error rate under the test’s assumptions. A common convention is α = 0.05, but this is not a law of nature or a boundary between “true” and “false.” Clinical trials with multiple primary comparisons, interim monitoring or serious safety outcomes may require a prespecified adjustment or decision process. Report the chosen threshold and why it fits the analysis plan.
After calculating the test statistic and p-value, compare the p-value with α under the prespecified rule. If p < α, reject H₀ for that test. If p ≥ α, fail to reject H₀. The second result does not prove H₀ or establish that groups are equivalent; it may reflect a small effect, inadequate information, measurement error or a wide interval. Equivalence or non-inferiority questions require specific margins and methods.
5. What a p-value does—and does not—mean
The p-value is the probability, assuming the null hypothesis and statistical model are true, of obtaining a test statistic at least as extreme as the observed statistic in the direction(s) specified by the test. It is not the probability that H₀ is true, that the result is due to chance, that the study will replicate, or that a treatment works. The p-value depends on the effect, variability, sample size, design, missing data and model.
A small p-value can occur for a trivial effect in a large sample. A large p-value can occur when an important effect is estimated imprecisely in a small sample. It should not be read in isolation from the point estimate, confidence interval, study design and clinical context. Avoid selectively reporting only outcomes with p < 0.05.
6. Type I error, Type II error and power
| Decision and reality | Null is true | Null is false |
|---|---|---|
| Reject H₀ | Type I error (false positive); its long-run probability is controlled by α under assumptions. | Correct detection of a difference or association for this decision rule. |
| Fail to reject H₀ | Correct non-rejection. | Type II error (false negative); probability is β for a specified alternative. |
Power is 1 − β: the probability a planned study rejects H₀ for a specified true effect, given the assumptions and analysis. Power is not a post hoc probability that the result is true. Sample-size planning should consider a clinically meaningful effect, variability or baseline event rate, α, desired power, allocation ratio, clustering, loss to follow-up and the planned analysis. Inflating sample size without improving measurement or reducing bias does not guarantee valid conclusions.
7. Steps in a responsible hypothesis test
8. Select a test that matches the question
| Question / outcome | Possible basic test | Important conditions to check |
|---|---|---|
| Compare a continuous mean in two independent groups | Independent-samples t-test | Independent observations, meaningful group definition, outliers and distribution; consider unequal-variance version if appropriate. |
| Compare paired measurements, such as before/after in the same people | Paired t-test | Analyse within-person differences; check their distribution and pairing. |
| Compare means across three or more groups | ANOVA | Plan comparisons, check independence and variance assumptions, and address multiple comparisons. |
| Compare proportions or categorical outcomes | Chi-square test; Fisher’s exact test for suitable small tables | Check expected cell counts, independence and sampling design. |
| Compare two independent ordinal or skewed outcomes | Mann–Whitney test | It compares rank distributions; it is not automatically a test of medians unless distributional shapes are comparable. |
| Assess paired binary change | McNemar test | Requires paired binary observations; use discordant pairs for the comparison. |
| Model a binary outcome with covariates | Logistic regression | Check model specification, sparse data, independence, confounding and interpretation of odds ratios. |
This is an introductory guide, not a complete menu. Repeated measures, clustered facilities, survey weights, survival outcomes, matched designs or diagnostic accuracy may require specialised methods. Consult a statistician when the design or assumptions are not straightforward.
9. Worked example: appointment reminders
Illustrative results only—not real clinic data: suppose a well-defined study compares missed follow-up between adults assigned to receive a reminder and adults assigned usual care. The estimated risk difference is −8 percentage points (reminder minus usual care), the 95% CI is −14 to −2 percentage points, and the two-sided p-value is 0.01. If α = 0.05 was prespecified and the model is appropriate, the test rejects a zero risk difference. The interval suggests a reduction of about 2 to 14 points under the model, while the point estimate is an 8-point reduction.
Before claiming the reminder caused an improvement, verify randomisation, follow-up, outcome definitions, adherence to assigned groups and missing data. Decide whether an 8-point absolute change matters clinically or operationally. The same p-value in a poorly designed observational study would not establish causation. This example shows how the test decision, effect estimate and practical interpretation answer different parts of the question.
10. Statistical significance versus practical importance
Statistical significance concerns compatibility with a null value under a test; practical importance concerns magnitude, consequences and context. A small difference can be statistically significant in a very large dataset. A potentially important difference can be non-significant when information is limited. Compare results with a prespecified minimum important difference or policy threshold, and discuss benefits, harms, feasibility, costs and equity.
11. Multiple comparisons and selective reporting
Running many tests increases the chance that at least one will cross a conventional threshold even when no real association exists. This may arise from many outcomes, subgroups, time points, exposure definitions or repeated looks at accumulating trial data. Prespecify primary analyses, label exploratory comparisons honestly, and use a justified multiplicity approach when required. Do not change the outcome, hypothesis, subgroup or test because an initial result was not significant.
12. Link to confidence intervals
A confidence interval often communicates the effect size and range of values compatible with the data more usefully than a binary decision. Under corresponding two-sided methods, a 95% interval for a difference that excludes zero generally aligns with a 5% test rejecting zero; for a ratio, compare the interval with one. This relationship depends on the same model and assumptions. Review confidence intervals in health research for the interpretation and limits of interval estimates.
13. Common errors and their corrections
14. Mini case and exam practice
A district compares mean waiting time before and after introducing a triage process, using records from the same facilities in two different months. Before testing, define the outcome, units, eligible visits, whether observations are paired at any level, and whether case mix changed. A simple independent t-test may be inadequate if facility clustering or seasonal differences are important. Write the null and alternative for the chosen effect scale, select a test from the design, then report the difference, interval, p-value and limitations.
- Define a p-value in relation to H₀ and the model.
- What is a Type I error? What does power mean?
- Why should the analysis plan specify a primary outcome?
- When is a paired test appropriate?
- Why is “p ≥ 0.05 proves no effect” incorrect?
Continue learning
Study confidence intervals, mean, median and mode, health-research designs and the Clinical Medicine Year 2 curriculum.
References and further reading
- NIST/SEMATECH. Critical values and p-values—statistical definitions and interpretation.
- NIST/SEMATECH. Relationship between hypothesis testing and confidence intervals.
- CDC. Analyzing and interpreting data: Field Epidemiology Manual.
- SlideShare. Hypothesis Testing for Health Science—supplementary worked teaching slides on means and proportions.
- SlideShare. Introduction to Biostatistics in Medical Research—additional teaching material on hypothesis testing and common procedures.
Educational revision content only. Statistical tests depend on design and assumptions; follow the approved analysis plan and seek qualified statistical advice for complex or high-stakes work.
Further Reading
For deeper study, use authoritative statistics and reporting resources: