Hypothesis Testing and P Value
On this page
Direct answer
Hypothesis testing is a procedure for judging whether an observed difference could plausibly be due to chance, by comparing a null hypothesis with an alternative. The p value is the probability of obtaining results at least as extreme as those observed, assuming the null hypothesis is true. A p value below the chosen significance level, usually 0.05, leads to rejection of the null hypothesis.
What you must remember
- Null hypothesis (H0): the statement of no difference or no association, which the test assumes true until the data argue otherwise.
- Alternative hypothesis (H1): the statement of a difference or association that the study seeks to establish.
- Level of significance (alpha): the cut-off probability of a false positive, conventionally 0.05, or 5 per cent.
- P value: the probability of the observed data if H0 is true; it is not the probability that H0 is true.
- Statistical significance: a p value below alpha leads to rejection of H0, but says nothing about clinical importance.
- Two-tailed test: looks for a difference in either direction and is the default in most medical research.
- Failure to reject: H0 is never proved true; the data simply did not provide enough evidence against it.
A stepwise method for any test
Every test follows the same logical sequence, whatever statistic it uses. The steps below apply equally to a t test, a chi-square test or an ANOVA.
- State the hypotheses: define H0, the statement of no difference, and H1 before looking at the data.
- Fix alpha: set the significance level in advance, commonly at 0.05.
- Choose the test: select the statistic by data type, sample size and study design, such as a t test or chi-square test.
- Calculate the statistic: compute the test value from the sample data.
- Obtain the p value: find the probability of a result at least as extreme as this one if H0 is true.
- Decide and report: reject H0 if p is below alpha, and report the exact p value together with the effect size and the confidence interval.
Setting alpha before the analysis protects the study from choosing a threshold that suits the result.
Where the exam tries to catch you
Examiners test whether you can read a p value without overstating it.
- Trap: reading p = 0.03 as a 97 per cent chance that the result is true Correct: p is the probability of the data given H0, not the probability that H0 is true.
- Trap: equating statistical significance with importance Correct: a very large sample can give a small p for a trivial difference, so the effect size must be reported.
- Trap: writing that the null hypothesis is accepted Correct: H0 is not accepted but not rejected, because absence of evidence is not evidence of absence.
- Trap: changing alpha after seeing the p value Correct: alpha is fixed before the analysis to avoid bias in the conclusion.
Frequently asked questions
What is a p value in hypothesis testing?
A p value is the probability of obtaining a result at least as extreme as the observed one, assuming the null hypothesis is true. A small p value indicates that the data would be unlikely under the null hypothesis.
Why is the significance level usually 0.05?
The 0.05 threshold is a convention that accepts a 5 per cent risk of a false positive result. It is a convention rather than a law, so it is set before the data are analysed and not adjusted afterwards.
What is the difference between one-tailed and two-tailed tests?
A two-tailed test looks for a difference in either direction, whereas a one-tailed test looks for a difference in one specified direction only. Two-tailed tests are the default in most medical research because they are more conservative.
Does a non-significant p value prove there is no difference?
A non-significant p value means the data did not provide enough evidence to reject the null hypothesis, but it does not prove that no difference exists. A small sample or high variability can hide a real effect.