Introduction
Almost every statistics course, lab report and research paper ends up at the same number: the p-value. Software prints it in a second. Interpreting it correctly is much harder, and misreading it is one of the most common mistakes in student work and published research alike.
This guide explains what a p-value actually measures, walks through two complete examples, and shows how to report a result so that it is both correct and useful.
What a P-Value Is
Every hypothesis test starts with two competing statements:
- The null hypothesis ($H_0$) — the "nothing is going on" claim: the coin is fair, the drug has no effect, the two groups have the same mean.
- The alternative hypothesis ($H_1$) — what you suspect instead: the coin is biased, the drug works, the means differ.
You then summarise your data in a single test statistic (such as a t or z value) that measures how far the data are from what $H_0$ predicts.
The p-value is the probability of getting a result at least as extreme as the one you observed, assuming the null hypothesis is true.
A small p-value means your data would be surprising if $H_0$ were true. That surprise is evidence against $H_0$. A large p-value means the data are quite compatible with $H_0$ — which is not the same as proving it.
The null hypothesis is "innocent until proven guilty". The p-value asks: if the defendant really were innocent, how likely is evidence this strong? If it is very unlikely, we reject innocence. If not, the verdict is "not guilty" — not "proven innocent".
Example 1 — A Suspicious Coin
A friend's coin lands heads 60 times in 100 flips. Is the coin biased, or could a fair coin do this by chance?
State the hypotheses. $H_0$: the probability of heads is $p = 0.5$. $H_1$: $p \neq 0.5$ (biased in either direction).
Ask what a fair coin would do. With 100 flips, a fair coin gives on average 50 heads, with a standard deviation of
So 60 heads is two standard deviations above what we expect: $z = (60 - 50)/5 = 2$.
Find the p-value. "At least as extreme" means 60 or more heads or 40 or fewer, because we care about bias in either direction. The exact binomial calculation gives
(The normal approximation with $z = 2$ gives about 0.046; with only 100 flips the exact binomial value is the one to trust.)
If the coin were fair, a result at least this lopsided would happen in about 5.7% of sets of 100 flips. That is unusual but not rare. At the common 5% significance level we would not reject $H_0$ — the data are suggestive, not conclusive. Flipping the coin more times would settle it.
One-Sided or Two-Sided?
In the coin example we counted extreme results in both directions. That is a two-sided test. If, before collecting any data, you had a genuine reason to care only about one direction (say, the coin was claimed to favour heads), a one-sided test counts only that tail. For 60 heads it gives $p \approx 0.028$ — roughly half the two-sided value.
Switching to a one-sided test after seeing which way the data went, just to get under 0.05, is a form of p-hacking. Two-sided tests are the default in almost all research and in software, and that is the safe choice unless your study plan says otherwise.
Example 2 — Did Tutoring Help?
Twenty-five students write a test, take six weeks of tutoring, then write a comparable test. Their scores improve by an average of 4.2 points, with a standard deviation of 8 points. Is that improvement real, or could it be noise?
Hypotheses. $H_0$: the mean improvement is $\mu = 0$. $H_1$: $\mu \neq 0$. Because the same students are measured twice, we test the 25 differences.
Standard error and test statistic.
P-value and confidence interval. With $n - 1 = 24$ degrees of freedom, the two-sided p-value is about 0.015. The critical value $t_{0.975,\,24} \approx 2.064$ gives the 95% confidence interval
If tutoring had no effect on average, an improvement this large would happen only about 1.5% of the time, so we reject $H_0$ at the 5% level. The confidence interval adds what the p-value cannot: the average gain is plausibly anywhere from about 1 to 7.5 points. (Without a comparison group we cannot say the gain was caused by tutoring rather than, say, practice with the test format — a design question, not a p-value question.)
Significance Levels and Errors
The significance level $\alpha$ is a threshold you fix in advance — most often 0.05. If $p \le \alpha$, the result is called statistically significant and you reject $H_0$. Two kinds of mistakes are possible:
| $H_0$ is actually true | $H_0$ is actually false | |
|---|---|---|
| Reject $H_0$ | Type I error (false positive) — probability $\alpha$ | Correct |
| Don't reject $H_0$ | Correct | Type II error (false negative) — probability $\beta$ |
Power, $1 - \beta$, is the chance of detecting an effect that really exists. It grows with sample size and with the size of the effect.
Each test at $\alpha = 0.05$ carries a 5% false-positive risk when $H_0$ is true. Run 20 independent tests on pure noise and the chance that at least one comes out "significant" is $1 - 0.95^{20} \approx 64\%$. When you test many outcomes or groups, use a correction such as Bonferroni or Holm, or plan fewer, focused comparisons.
What a P-Value Is Not
These misreadings are so common that the American Statistical Association published a formal statement on p-values in 2016 to address them.
No. The p-value is calculated assuming $H_0$ is true, so it cannot also be the probability that $H_0$ is true. It is the probability of the data (or more extreme), given $H_0$ — not the probability of $H_0$, given the data.
A large p-value only says the data are compatible with no effect. Small studies often miss real effects. Absence of evidence is not evidence of absence — look at the confidence interval to see which effects are still plausible.
The p-value mixes effect size with sample size. A tiny, useless effect can have a tiny p-value in a huge sample, as the next section shows.
p = 0.049 and p = 0.051 represent practically identical evidence. Report the exact p-value rather than just "significant" or "not significant".
P-Values, Sample Size and Effect Size
Two contrasting studies make the point.
| Study | Difference in means | P-value | 95% CI |
|---|---|---|---|
| A: 10,000 students per group, SD 15 | 0.5 points | 0.018 | 0.1 to 0.9 |
| B: 8 students per group, SD 10 | 6 points | 0.25 | −4.7 to 16.7 |
Study A is "significant" but the effect — half a point on a test — is too small to matter to anyone. Study B is "not significant", yet its interval includes large, important effects; it is simply too small to tell. Judged by p-values alone, you would draw the wrong lesson from both.
The p-value answers "is there evidence of an effect?". The effect size and confidence interval answer "how big is it, and how precisely do we know?". Good reports give both.
How to Report a P-Value
- Give the exact value to two or three decimals: p = 0.015, not "p < 0.05". Very small values can be written p < 0.001.
- Include the test and statistic: t(24) = 2.63.
- Lead with the effect and its confidence interval, then the p-value.
- Say whether the test was one- or two-sided if it isn't obvious.
"After six weeks of tutoring, scores improved by a mean of 4.2 points (95% CI 0.9 to 7.5; paired t-test, t(24) = 2.63, two-sided p = 0.015)."
Running It in R and Python
binom.test(60, 100, p = 0.5) — exact test for the coin (p ≈ 0.057)
t.test(after, before, paired = TRUE) — paired t-test on before/after scores
p.adjust(pvals, method = "holm") — correct a set of p-values for multiple testing
stats.binomtest(60, 100, p=0.5).pvalue — exact test for the coin
stats.ttest_rel(after, before) — paired t-test
stats.ttest_1samp(improvement, 0) — the same test on the differences
Practice Questions
Try each one, then check with the hint.
A study reports p = 0.03. A classmate says "so there is a 3% chance the results are due to chance." What is wrong with that?
A two-sided z-test gives z = 1.5. What is the p-value, and is it significant at the 5% level?
A pilot study of 16 patients finds a promising improvement, but p = 0.053. The authors conclude "the treatment does not work." How should they have reported it?
Not sure which test produces your p-value? Read How to Choose the Right Statistical Test. Need the z-scores used above? See the normal distribution guide. Working on a thesis or paper? TutorDice offers one-on-one statistics consultation — your first session is free.