P-values, explained with examples
A p-value measures how surprising your data would be if the null hypothesis were true. It is the number that decides most significance tests, and also one of the most misunderstood ideas in statistics.
On this page
- The definition
- The logic of a significance test
- Comparing with the significance level
- Worked examples
- What a p-value is not
- Statistical significance versus practical importance
- Why 0.05?
- Where p-values come from in practice
- Common mistakes
- Practice questions
- Frequently asked questions
- Key takeaways
- Related guides
The definition
A p-value is the probability, assuming the null hypothesis H0 is true, of getting a sample result at least as extreme as the one actually observed, in the direction of the alternative hypothesis.
Every part of that sentence matters. “Assuming H0 is true”: the calculation imagines a world where nothing unusual is going on. “At least as extreme”: we count the observed result and anything further from what H0 predicts. “In the direction of Ha”: a one-sided test looks in one tail; a two-sided test looks in both.
The logic of a significance test
Suppose a coin is claimed to be fair, and you get 64 heads in 100 flips. If the coin really were fair, how often would you see 64 or more heads? If that would happen only rarely, you have evidence that the coin is not fair. A small p-value says: “this result would be unusual if H0 were true”. So either something very unlikely happened, or H0 is wrong. A significance test takes the second option when the p-value is small enough.
Comparing with the significance level
Before collecting data, choose a significance level α, usually 0.05. Then:
- If p-value < α, reject H0. There is convincing evidence for Ha.
- If p-value ≥ α, fail to reject H0. There is not convincing evidence for Ha.
Never say “accept H0”. A large p-value means the data are consistent with H0, not that H0 has been proved true. The sample may simply have been too small to detect a real effect.
Worked examples
Example 1: a one-sided test for a proportion
A school claims 50% of students walk to school. A researcher suspects it is more. In a random sample of 100 students, 58 walk. Find the p-value.
- H0: p = 0.5. Ha: p > 0.5.
- Standard deviation of p̂ under H0: √(0.5 × 0.5/100) = 0.05. z = (0.58 − 0.5)/0.05 = 1.6.
- p-value = P(Z ≥ 1.6) ≈ 0.0548.
Example 2: the decision
Using α = 0.05, what should the researcher conclude?
- 0.0548 > 0.05, so fail to reject H0.
- There is not convincing evidence that more than half of the school's students walk. The result is close to the cut-off, so a larger sample would help.
Example 3: a two-sided test
If the researcher had tested Ha: p ≠ 0.5 with the same data, what would the p-value be?
- Two-sided: count both tails, 58% or more and 42% or fewer.
- p-value ≈ 2 × 0.0548 = 0.1096.
Example 4: interpreting a p-value in context
A test of whether a new diet lowers cholesterol gives a p-value of 0.012. Interpret it.
- Assuming the diet has no effect on mean cholesterol, there is a 0.012 probability of getting a sample mean reduction at least as large as the one observed, by random chance alone.
- This is the interpretation AP readers want: it states the assumption, the probability, and the “at least as extreme” idea, all in context.
Example 5: a p-value from a t-test
A random sample of 25 bags of crisps has mean mass 31.0 g and standard deviation 2.0 g. Test whether the mean is more than the stated 30 g.
- H0: μ = 30. Ha: μ > 30. The population standard deviation is unknown, so use a t-test with 24 degrees of freedom.
- t = (31.0 − 30)/(2.0/√25) = 1.0/0.4 = 2.5.
- p-value = P(t24 ≥ 2.5) ≈ 0.0098. At α = 0.05, reject H0: there is convincing evidence that the mean mass of all bags is more than 30 g.
What a p-value is not
- It is not the probability that H0 is true.
- It is not the probability that the result happened by chance.
- It does not measure how big or important an effect is. A tiny, unimportant difference can have a very small p-value if the sample is huge.
- A p-value above 0.05 does not prove there is no effect.
Statistical significance versus practical importance
With a large enough sample, even a trivial difference becomes statistically significant. A medicine might lower blood pressure by 0.5 points with p = 0.001: real, but not useful. That is why a confidence interval, which shows the size of the effect, is a valuable companion to a p-value. Always ask both questions: is there evidence of an effect, and is the effect large enough to matter?
Why 0.05?
The 5% level is a convention, not a law of nature. It balances the risk of a false alarm against the risk of missing a real effect. In medicine or engineering, where a false alarm could be costly, researchers often use 0.01. In early exploratory work, 0.10 is sometimes used. The key rule is to choose α before seeing the data.
Where p-values come from in practice
On the AP exam you find p-values with a calculator, a table, or computer output. Every test follows the same pattern: state the hypotheses, check conditions, calculate a test statistic (z, t or χ²), find the p-value from the matching distribution, compare with α, and conclude in context.
Common mistakes
- Interpreting the p-value as the probability that H0 is true.
- Writing “accept H0” instead of “fail to reject H0”.
- Forgetting to double the one-tail area for a two-sided test.
- Giving a conclusion without context or without linking the p-value to α.
- Choosing α after seeing the p-value.
Practice questions
Try each one before opening the answer.
Q1. A test gives p = 0.003 with α = 0.01. What is the decision?
Show answer
Q2. A test gives p = 0.21. Does this prove H0 is true?
Show answer
Q3. A one-sided test has z = 2.0. Find the p-value.
Show answer
Q4. The same z for a two-sided test?
Show answer
Frequently asked questions
Are p-values on the AP Statistics exam?
Yes. They appear in every significance test in Units 6 to 9, and interpreting a p-value in context is a frequent free-response task.
Are p-values in A level Maths?
A level Maths hypothesis tests often compare a probability with the significance level, which is a p-value approach, though some boards use critical regions instead.
Key takeaways
- A p-value assumes H0 is true.
- It is the probability of a result at least as extreme as the one observed.
- Small p-values give evidence against H0.
- Compare with α chosen in advance; conclude in context.
- Significance is not the same as practical importance.