What a p-value means (and what it does not), with an example
A p-value is the probability of getting a result at least as extreme as the one you observed, if the null hypothesis were true, that is, if nothing had really changed or differed. A small p-value means your data would be unusual under "nothing is going on", which is evidence against that assumption. It is not the probability that the null hypothesis is true, and it says nothing about how large or important an effect is. Those two misreadings cause most of the trouble with p-values in engineering reports.
A worked example: is the supplier's 1% believable?
A supplier states that at most 1% of its molded clips are defective. Incoming inspection checks a random sample of 200 clips from a lot and finds 6 defective. If the true rate were 1%, you would expect 200 × 0.01 = 2 defectives. Six is more, but samples vary. Is 6 surprising?
The null hypothesis is H₀: the defect rate is 1%. The alternative is that it is higher (one-sided, because a better-than-claimed lot is not a problem). Under H₀, the number of defectives in 200 parts follows a binomial distribution with n = 200 and p = 0.01:
The p-value is the total height of the bars at 6 and beyond, the results at least as extreme as the one observed:
p = P(X ≥ 6 | n = 200, p = 0.01) = 1 − P(X ≤ 5) = 0.0160In the super calculator, 1 - BINOMCDF(5, 200, 0.01) gives 0.0160229069092.
What this means: if the supplier's rate really were 1%, a sample of 200 with 6 or more defectives would turn up only about 1.6% of the time. Either the lot is worse than claimed, or inspection drew an unusual sample. At α = 0.05, you reject H₀ and conclude the rate is above 1%.
What it does not mean: it does not mean there is a 1.6% chance the supplier is right, and it does not tell you the actual rate. For that, estimate it: the sample rate is 6/200 = 3.0%, and a 95% Wilson confidence interval runs from 1.38% to 6.39%. That interval, not the p-value, is what you would put in the supplier complaint.
How fragile the threshold is
Look at what one clip changes:
| Defectives found | p-value P(X ≥ k) | At α = 0.05 |
|---|---|---|
| 4 | 0.1420 | Not significant |
| 5 | 0.0517 | Not significant |
| 6 | 0.0160 | Significant |
| 7 | 0.0043 | Significant |
Five defectives give p = 0.0517 and six give p = 0.0160. The evidence changes gradually, but a hard cut at 0.05 turns it into a yes/no switch. Treat p = 0.0517 and p = 0.0490 as practically the same evidence, and read p-values as a scale: around 0.05, some evidence; around 0.01, fairly strong; below 0.001, very strong, provided the assumptions hold.
Five common misreadings
- "p is the probability that H₀ is true." No. The p-value is calculated assuming H₀ is true. The probability that H₀ is true depends also on how plausible it was before the data, which the test does not use.
- "p is the probability that the result is due to chance." The same mistake in other words. The p-value is the probability of the data (or more extreme) given chance alone, not the probability of chance given the data.
- "A small p-value means a large effect." No. With enough data, a trivial effect gives a tiny p-value. The hypothesis testing guide shows a 0.05 g difference in fill weight with p = 0.00086.
- "p > 0.05 means there is no effect." It means the data did not show one. With small samples, real effects are often missed. Check the confidence interval: if it includes both zero and differences that matter, the study was not big enough to decide.
- "1 − p is the chance the result will repeat." No. Even when an effect is real, a repeat study may well fail to reach significance if its power is modest.
Where the p-value comes from
Every test follows the same pattern:
- Assume H₀ and work out the distribution of the test statistic under it: binomial counts in the example above, the t distribution for a one-sample t-test, chi-square for a cross tabulation.
- Compute the statistic from your data.
- Add up the probability of all results at least as extreme, in the direction or directions H₁ cares about.
For a two-sided test, "extreme" means far from H₀ in either direction, so the p-value adds both tails. The one-proportion test is the standard test for a defect rate like the one in the example.
Many tests, many false alarms
Each test at α = 0.05 has a 5% chance of a false alarm when nothing is going on. Run several and the chances add up. A first-article inspection that compares 20 independent characteristics with their nominals, all of them truly on target, gives at least one "significant" result with probability:
1 − 0.95²⁰ = 0.64That is a 64% chance of chasing at least one false alarm. Remedies:
- Decide in advance which few comparisons matter, and test only those.
- Use a stricter threshold per test. The simplest is the Bonferroni correction, α divided by the number of tests: 0.05 / 20 = 0.0025.
- Treat a surprising result from a broad search as a lead to confirm with new data, not as a conclusion.
The same problem hides in "trying a few tests until one works", in slicing data by shift, line and month until a difference appears, and in stopping data collection as soon as p dips below 0.05.
How to report a p-value
- Give the exact value (p = 0.016), not just "p < 0.05", and say which test and which direction.
- Give the effect and its confidence interval: "the defect rate was 3.0% (95% CI 1.4% to 6.4%), above the 1% claimed (one-sided binomial test, p = 0.016)."
- Mention the sample size and how the sample was taken.
- State the assumptions you checked, such as independence and a random sample.
Frequently asked questions
Is p = 0.06 a failed result?
No. It is moderate evidence, a little weaker than p = 0.04. Whether to act depends on the cost of acting on a false alarm against the cost of missing a real change. Often the right decision is to collect more data; see how many samples.
Why did my p-value change when I added more data?
The p-value depends on the sample size. With more data, the same effect gives a smaller p-value, and a chance effect tends to fade. That is why sample size should be fixed in advance rather than adjusted while watching the p-value.
Should I use a one-sided or a two-sided p-value?
Two-sided unless a difference in one direction is impossible or genuinely irrelevant to the decision, and you decide before seeing the data. In the supplier example, only a worse lot matters, so one-sided is justified. See which hypothesis test to use.
Can a p-value be exactly zero?
Not really. Very small values are shown rounded, often as 0.000 or as a limit such as p < 0.001. Report them as p < 0.001 rather than p = 0.