Sub topic 18
Statistical Significance and Effect Size
This chapter assumes you know what a mean is, how to read a simple graph, and the difference between an experiment and a correlational study. It covers two questions you can ask about any result. First, could chance alone plausibly explain it? Second, how big is it?
The working model
Researchers usually study a sample, not a whole population. Two samples drawn from the same population will differ a little by luck. Statistical inference is the set of tools for judging whether an observed difference or relationship is larger than that kind of luck would typically produce.
The standard procedure is null hypothesis significance testing:
- State a null hypothesis: there is no difference (or no relationship) in the population.
- Collect data and compute a test statistic, such as a t value or a correlation r.
- Compute the p-value: the probability of seeing a result at least this extreme if the null hypothesis were true.
- Compare p to a preset cutoff, the alpha level, usually .05. If p is below alpha, the result is called statistically significant and the null hypothesis is rejected.
Random assignment matters here. It makes the chance model concrete: if the treatment does nothing, any group difference comes only from how people happened to be split. The p-value asks how often a random split alone would produce a gap this large.
What a p-value does and does not say
A p-value of .03 means: if there were truly no effect, results this extreme would occur about 3% of the time. It does not mean any of the following:
- That there is a 97% chance the hypothesis is true.
- That the effect is large or important.
- That the result will replicate.
- That the study was free of confounds.
Significance also depends heavily on sample size. With enough participants, a tiny and useless difference becomes significant. With too few, a real and large difference can fail to reach significance.
Effect size
An effect size measures how big a difference or relationship is, independent of sample size. Two common ones:
- Cohen's d is the difference between two group means divided by the pooled standard deviation. It says how many standard deviations apart the groups are. A common rough guide is 0.2 small, 0.5 medium, 0.8 large.
- Pearson's r is itself an effect size. Rough guides are .1 small, .3 medium, .5 large. Squaring it gives r², the proportion of variance in one variable that is shared with the other.
These benchmarks are conventions, not laws. A small effect can matter a lot for a cheap intervention applied to millions of people, and a medium effect can be trivial in a different setting.
| Question | Tool | What it tells you |
|---|---|---|
| Is the result unlikely under "no effect"? | p-value | Evidence against the null, mixed with sample size |
| How large is the result? | Effect size (d, r) | Magnitude, comparable across studies |
| How precise is the estimate? | Confidence interval | Range of plausible population values |
A confidence interval (CI) gives a range around an estimate. A 95% CI is built so that, across many repeated studies, about 95% of such intervals would contain the true value. A wide interval signals an imprecise estimate, often from a small sample.
Worked example: same effect, different samples
The code below simulates the same true effect (d = 0.3) at three sample sizes. It uses a hand-written t statistic and a normal approximation for the p-value, so it runs with only the standard library.
import random
from statistics import mean, stdev, NormalDist
def run_study(n_per_group, true_d, rng):
control = [rng.gauss(0, 1) for _ in range(n_per_group)]
treatment = [rng.gauss(true_d, 1) for _ in range(n_per_group)]
m1, m2 = mean(treatment), mean(control)
s1, s2 = stdev(treatment), stdev(control)
pooled = ((s1 ** 2 + s2 ** 2) / 2) ** 0.5
d = (m1 - m2) / pooled
se = (s1 ** 2 / n_per_group + s2 ** 2 / n_per_group) ** 0.5
z = (m1 - m2) / se
p = 2 * (1 - NormalDist().cdf(abs(z))) # normal approximation
return d, p
rng = random.Random(7)
for n in (20, 100, 1000):
d, p = run_study(n, true_d=0.3, rng=rng)
print(f"n per group = {n:4d} d = {d:5.2f} p = {p:.4f}")Across runs, the estimated d stays near 0.3, but p shrinks as n grows. With 20 per group the study often misses significance despite a real effect. With 1000 per group, p is tiny, yet the effect is still only "small to medium." The p-value tracked the sample size. The effect size tracked the phenomenon.
Errors and power
Testing can go wrong in two ways.
- A Type I error is a false positive: rejecting a true null. Its long-run rate is set by alpha.
- A Type II error is a false negative: failing to reject a false null.
Statistical power is the probability of detecting a real effect of a given size. Power rises with larger samples, larger true effects, and less noisy measurement (which links back to reliability). Researchers often aim for 80% power and estimate the needed sample size before collecting data.
Common errors
- Treating p < .05 as proof. It is one piece of evidence. Design quality still decides whether a causal claim is justified.
- Treating p > .05 as "no effect." A non-significant result from a small study is often inconclusive. Check the confidence interval and power.
- Reporting only p. Report the effect size and CI as well.
- Multiple comparisons. Running 20 tests at alpha .05 gives a high chance that at least one is a false positive. Correct for this or limit tests to those planned in advance.
- p-hacking. Trying different analyses, dropping participants, or adding data until p dips below .05 inflates false positives. Preregistering the analysis plan reduces this risk and connects to the replication chapter.
- Confusing significance with causation. A significant correlation is still a correlation. Only random assignment in a well-controlled experiment supports a causal reading.
Exercise
Study A has 40 participants and finds d = 0.80, p = .07. Study B has 4,000 participants and finds d = 0.08, p = .01. Which study found the larger effect, which found the "significant" result, and what should you conclude about each?
Show answer
Study A found the larger effect (d = 0.80, a large effect), but it was not significant at .05, probably because the sample was small, so its estimate is imprecise and the result is inconclusive rather than evidence of no effect. Study B was significant but its effect is very small (d = 0.08). The large sample made a tiny difference detectable. Conclude that B shows a real but trivial difference, while A suggests a possibly large effect that needs a bigger sample to confirm.
Exercise
A researcher runs 20 independent tests on data where no true effects exist, using alpha = .05. About how many significant results should be expected by chance, and what practice protects against this problem?
Show answer
About one (20 × .05 = 1). Protections include correcting for multiple comparisons (for example, a Bonferroni adjustment, which divides alpha by the number of tests) and preregistering a small set of planned analyses.