5 Sampling Distributions and the Logic of Inference
By the end of this chapter you will be able to:
- Explain what a sampling distribution shows: the variation that chance alone produces.
- Correctly define a p-value — and identify what it is not.
- Correctly interpret a 95% confidence interval.
- Describe how sample size changes the width of a sampling distribution, and why that means precision.
- Interpret degrees of freedom in context.
- Distinguish Type I from Type II errors, and name what raises a study’s power.
- Explain what random assignment and random sampling each license you to conclude.
You measure reaction times in 60 students, 30 after coffee and 30 after decaf. The coffee group is 50 ms faster on average. Is that a real effect — or just the kind of difference you’d get by chance if coffee did nothing at all?
This is the central question of inferential statistics. This chapter walks through how we answer it.
5.1 From samples to populations
We rarely know true population values — the actual mean reaction time of all coffee drinkers, the actual slope of the relationship between hours of sleep and exam scores across all students. Inferential statistics use sample data to estimate those values, and to test whether observed differences and relationships are likely to exist in the larger population.
Every inferential test, no matter how complicated, compares the same two things:
\[ \text{test statistic} = \frac{\text{observed variation}}{\text{expected variation by chance}} \]
If that ratio is large, the result is unlikely under the null hypothesis — and we have grounds to conclude that something real is going on.
5.2 Sampling distributions
Imagine you could draw not one sample of 30 students per group, but thousands of samples, each with 30 per group. For each sample, you compute the difference between coffee and decaf means. Plot all those differences in a histogram. You now have a sampling distribution — a picture of how much your sample statistic varies just by random sampling. Its standard deviation has its own name: the standard error (SE). The standard error is the typical size of a chance miss.
This is the single most important idea in inferential statistics. The sampling distribution shows you what chance alone produces. Once you know that, you can ask: is my observed result extreme relative to what chance alone produces?
5.2.1 Building intuition with a simulator
The Coffee Experiment Simulator draws thousands of imaginary samples and shows you the sampling distribution as you change settings. Set the population SD to 100 ms and leave it there for all three steps (the simulator starts at 50; at that setting chance differences are much smaller, and the patterns below become too rare to see). Then try this:
- Set the true difference to 0 ms (coffee does nothing) and the sample size to 30 per group. Run many simulations. What does the histogram of mean differences look like? Most will land near zero, but some by chance will be 30, 40, even 60 ms in either direction. Even with no real effect, about 1 sample in 20 shows a difference of 50 ms or more in one direction or the other, just from sampling variability.
- Set the true difference to 50 ms, still 30 per group. Now the histogram shifts so it’s centered near 50 ms — but there’s still spread, and a few samples will (by bad luck) show no difference at all. The share of samples that would reach statistical significance is the study’s statistical power — the chance of correctly detecting an effect that’s really there.
- Keep the true difference at 50 ms and raise the sample size to 100 per group. The histogram tightens dramatically. Bigger samples give narrower sampling distributions, which means more precise estimates and more reliable tests.

Bigger samples don’t change the true effect. They change how precisely you can estimate it. A 50 ms difference observed in 10 people is fragile evidence; the same difference observed in 1,000 people is hard to dismiss as chance.
The width shrinks with the square root of n: the standard error of a mean is \(\sigma / \sqrt{n}\) (Chapter 4). To cut the standard error in half, you need four times the sample, not twice.
A spoonful from a well-stirred pot tells you about the whole pot. Taste one spoonful: that’s your sample mean. Now imagine tasting hundreds of spoonfuls and writing down each one’s saltiness — that pile of recordings is the sampling distribution. Most spoonfuls taste close to the pot’s true saltiness; a few, by luck of the scoop, taste saltier or blander.
Mapping: pot = population; one spoonful = your sample; saltiness of a spoonful = the sample mean; spoonful-to-spoonful variation = sampling variability; bigger spoon = larger n (less variation per taste).
Where this breaks: in real research you get one spoonful. You never re-taste — the sampling distribution is imagined, and the Central Limit Theorem (next section) tells you its shape without ever drawing another sample.
5.3 The role of the normal distribution
Why do sampling distributions tend to be bell-shaped, even when the raw data are not?
The Central Limit Theorem (CLT) says that as sample size increases, the sampling distribution of the mean approaches a normal distribution, almost regardless of the shape of the underlying data — provided the data have a finite mean and a finite variance. As long as observations are independent and the sample is reasonably large, the mean is approximately normal even if the raw measurements are skewed, bimodal, or otherwise non-normal. (The finite-variance condition is what rules out pathological cases such as the Cauchy distribution, whose sample mean never settles down no matter how large the sample.)
This is why nearly every inferential test in this book uses the normal distribution (or one of its close cousins — t, F, χ²) as its reference. Even if your data are not normal, the sampling distribution of the test statistic often is, especially with larger samples.
| Distribution | Used in | Based on | What it tests |
|---|---|---|---|
| Normal (Z) | Large samples, \(\sigma\) known | Sums of independent observations | Standardized scores |
| t | t-tests, regression coefficients | \(\sigma\) estimated from the data (any n) | Differences in means, slopes |
| F | ANOVA, regression overall test | Ratios of variances | Group differences, model fit |
| χ² | Frequency tests | Squared standardized counts | Independence, goodness of fit |
All four ultimately trace back to the normal distribution.
5.4 Degrees of freedom
The shape of the t, F, and χ² distributions depends on degrees of freedom (df) — the number of values that are free to vary once certain totals are fixed.
A simple example: if three numbers must average 10 (sum to 30), you can choose any two values freely, but the third is determined. df = 2.
Five friends, five seats at a dinner table that must all be filled: the first four can sit wherever they like, but the last person’s seat is determined by everyone else’s choices. Freedom to vary ran out one short of the group size.
Mapping: friends = data values; the constraint (every seat filled) = the estimated mean; the stuck last person = the value that is no longer free; df = n − 1.
Where this breaks: the analogy explains counting df, not why df changes the shape of the t distribution — and some tests (Welch’s t) use fractional df no seating chart can produce.
| Test | df formula | Example |
|---|---|---|
| One-sample t | \(n - 1\) | 25 data points → df = 24 |
| Two-sample t (Student’s) | \(n_1 + n_2 - 2\) | 15 + 15 → df = 28 |
| One-way ANOVA | Between: \(k - 1\), Within: \(N - k\) | 3 groups × 10 each → 2, 27 |
| χ² independence | \((\text{rows} - 1)(\text{cols} - 1)\) | 2 × 3 table → df = 2 |
R’s t.test() runs Welch’s test by default, which adjusts the two-sample df for unequal group variances. Expect a fractional df such as 26.4 in R output; that is not an error (Chapter 15).
For t, a bigger df gives the distribution thinner tails, so the critical value shrinks: about 2.57 at df = 5, 2.04 at df = 30, and 1.98 at df = 100, against 1.96 for the normal. Past about 30, df barely matters. It is a correction for small samples. The main reason sample size matters is the one above: the standard error shrinks as \(\sqrt{n}\) grows.
5.5 How hypothesis testing actually works
Every hypothesis test follows the same four steps. Once you see the pattern, Part IV will look very repetitive — which is the point.
- Assume the null hypothesis is true. (\(H_0\): no effect, no difference, no association.) This is the world you’re hoping to argue against.
- Compute a test statistic (t, F, χ², etc.) from your data.
- Compare the statistic to its theoretical distribution. That distribution describes what the statistic looks like under \(H_0\), given your sample size (via df).
- Locate the statistic in the distribution. If it falls in the tail region — i.e., the probability of seeing something this extreme under \(H_0\) is small (typically \(p < .05\)) — you reject \(H_0\).
The p-value is the answer to a specific question: if the null hypothesis were true, how likely would I be to observe a test statistic at least as extreme as the one I got?
A trial starts by presuming innocence, then asks: if the defendant were innocent, how surprising would this evidence be? A “not guilty” verdict doesn’t declare innocence — it says the evidence wasn’t strong enough.
Mapping: presumed innocence = H₀; evidence = test statistic; surprise-if-innocent = p-value; “not guilty ≠ innocent” = failing to reject ≠ no effect.
Where this breaks: courts never quantify “reasonable doubt”; α = .05 is an explicit (and arbitrary) line. And a trial happens once — statistics imagines the long run of repeated trials.
- It is not the probability that the null hypothesis is true.
- It is not “the probability that the results happened by chance.” That phrase quietly turns into the line above. The p-value assumes chance alone is operating and asks how surprising the data would be.
- It is not “the effect size.”
- It is not a measure of practical importance.
- It is not 1 minus your confidence in the result.
The p-value is a statement about the data, conditional on the null being true. Misreading it is one of the most common ways to misuse statistics.
A 95% confidence interval is easy to misread the same way. It does not mean “there’s a 95% chance the true value is in this interval” — the true value is fixed, not random; either it’s in the interval or it isn’t. The correct reading is about the procedure: if you repeated the study many times, about 95% of the intervals it produces would capture the true value. The figure below makes that concrete.

The Dance of the Confidence Intervals turns the figure above into a partner worksheet. Build 100 intervals, watch roughly 95 capture the true value, and then follow one real effect across repeated studies as the significance verdict changes from sample to sample.
The module also returns in Chapter 15, where its Welch-test and reporting sections connect directly to the independent-samples t-test.
5.6 Why normality matters
Statistical tests rest on the assumption that something in the analysis is normally distributed:
- For t-tests, the sampling distribution of the mean difference should be approximately normal.
- For ANOVA and regression, the residuals (the unexplained part of each observation) should be approximately normal.
When the relevant quantity is normally distributed, p-values and confidence intervals have their stated meanings. When it isn’t, those numbers can be misleading.
The Central Limit Theorem provides robustness: even when the raw data are non-normal, the sampling distribution becomes more normal as \(n\) grows. Large samples make most tests robust to non-normality. Small samples are where normality violations actually hurt.
We will return to this in detail in Chapter 10. For now, the takeaway is: normality is about the errors, not about the raw data.
5.7 Tying it all together: a conceptual flow
\[ \text{Sample} \;\longrightarrow\; \text{Sampling distribution} \;\longrightarrow\; \text{Test statistic} \;\longrightarrow\; \text{Theoretical distribution} \;\longrightarrow\; p\text{-value} \]
You collect a sample. You imagine the sampling distribution of your statistic under the null. You compute your actual statistic. You compare it to a theoretical distribution with the right df. The result is a p-value: how unlikely your observed result would be if the null were true.
If the result is very unlikely under \(H_0\), you reject \(H_0\): the result is larger than chance alone comfortably explains. Whether it reflects a causal effect that generalizes depends on design (see “Study design and what you can conclude” below).
Failing to reject H₀ (p > .05) does not mean H₀ is true or that there is no effect. It means the data did not provide sufficient evidence to reject the null — the effect could be real but the study underpowered, or the sample too small to detect it reliably. Absence of evidence is not evidence of absence.
5.8 Two ways to be wrong
Every hypothesis test ends in a decision: reject \(H_0\) or don’t. The truth, which you never get to see, is either that \(H_0\) is true or that it’s false. That gives four possible outcomes, and two of them are errors:
| \(H_0\) is actually true (no real effect) | \(H_0\) is actually false (a real effect exists) | |
|---|---|---|
| You reject \(H_0\) | Type I error: a false positive | Correct: you detected a real effect |
| You fail to reject \(H_0\) | Correct | Type II error: a false negative |
- α (alpha) is the Type I error rate you accept ahead of time. Setting α = .05 means that when the null is true, you’ll wrongly reject it about 5% of the time in the long run. You choose α; it doesn’t come from your data.
- β (beta) is the probability of a Type II error: missing an effect that’s really there.
- Power = 1 − β. It’s the probability of detecting an effect that really exists. By convention, studies aim for at least .80.
You saw both errors in the Coffee Experiment. With the true effect set to 0, a few samples still showed a large difference; testing one of those and rejecting \(H_0\) would be a Type I error. With the true effect set to 50 ms, some samples showed almost no difference; failing to reject from one of those would be a Type II error.
What controls power: a larger sample, a larger true effect, less noise in the measurements, and a less strict α all raise power. You rarely control the true effect, and α is usually fixed at .05 by convention. So your real levers are sample size and noise: more participants, more reliable measures, or a design that compares each person with themselves (Chapter 16). That’s why a non-significant result from a small study is weak evidence of anything: its power to detect a real effect may have been low from the start. Appendix E shows how to calculate the sample size you need before collecting data.
The trade-off: lowering α to reduce false positives raises β. With the same data, you’ll miss more real effects. No choice of α eliminates both kinds of error.
5.9 Common pitfalls
- “\(p < .05\)” does not mean “strong effect.” Tiny effects can become statistically significant with large enough samples. A significant p with a small effect size means the data are hard to reconcile with an effect of exactly zero, not that the effect is large.
- Statistical significance vs. practical significance. A weight-loss drug that produces a statistically significant 0.2 lb reduction is not a useful drug. Always report effect sizes alongside p-values.
- Multiple comparisons inflate false positives. If you run twenty tests at \(\alpha = .05\) and none of the effects is real, you expect about one false positive by chance alone. Use post-hoc corrections (Tukey HSD for ANOVA; Bonferroni or FDR for many separate tests) when running many comparisons.
5.10 Study design and what you can conclude
Not all significant results mean the same thing. What you can legitimately infer from a p-value depends on how the study was designed, not just whether the test was significant. Two features of design determine the scope of your conclusions:
- Random assignment to conditions (experiment vs. observation): what licenses a causal interpretation.
- Random sampling from the population: what licenses generalizing beyond the people you studied.
| Random sampling from population | Convenience / volunteer sample | |
|---|---|---|
| Random assignment to conditions | Supports causal inference and generalization | Supports causal inference; not generalization beyond this sample |
| No random assignment (observational) | Supports generalization; not causal inference | Supports neither |
These are design permissions, not guarantees. A randomized study still has to be carried out as designed — high dropout, participants who don’t follow the protocol, or an outcome that measures the wrong thing can undercut a causal claim no matter how the groups were formed.
Nearly all behavioral research uses convenience samples, often student volunteers, so most studies sit in the right-hand column. An experiment there supports a causal claim about the people studied, but not beyond them. An observational study there, with a convenience sample and no random assignment, supports neither. That is not a fatal flaw, but for such a study the p-value tells you the association in your sample is larger than sampling variability alone comfortably accounts for. It does not tell you that the association generalizes to the population, or that one variable caused the other.
The inferential tools in Part IV test whether effects exist. Whether those effects are causal and generalizable depends on design decisions made before data collection.
5.11 In plain language
If we understand how data behave by chance, we can tell when a result is too extreme to be explained by chance alone. That is what inferential statistics do. They compare what we observed to what random variation predicts.
Examples of questions this lets you answer:
- Do neurons fire faster after stimulation?
- Does hormone level differ by experimental condition?
- Are behavioral choices evenly distributed across categories?
- Does study time predict exam score?
Each of those becomes a hypothesis test, with the same four steps and the same underlying logic.
5.12 Where regression fits in
It is worth flagging now what you will see in Chapter 22 and later: regression uses the same inferential logic as t-tests and ANOVA but applies it to continuous predictors. Each slope coefficient (\(\beta\)) represents the expected change in the outcome for a one-unit change in the predictor (holding the other predictors constant, when there are several). This is a different β from the Type II error rate above. Statistics reuses Greek letters, and context tells you which is meant.
- A t-test on each slope asks: is this slope different from zero?
- An F-test on the whole model asks: do the predictors collectively explain more variance than expected by chance?
- \(R^2\) summarizes the proportion of outcome variance the model explains.
| Idea | In ANOVA | In regression |
|---|---|---|
| Variation the model explains | Between-group variance | Explained (model) variance |
| Variation left over | Within-group variance | Residual (unexplained) variance |
| F-test | Between ÷ within: do the group means differ more than noise predicts? | Model ÷ residual: do the predictors explain more than noise predicts? |
| t-test | Compares two specific groups (post-hoc or contrast) | Tests one slope against zero |
| Share of variance explained | η² | R² |
Regression, ANOVA, and t-tests are all versions of the same inferential idea: comparing explained variation to unexplained variation. That is the unifying thread of Parts IV and V.
Core idea: A p-value tells you how likely a result at least as extreme as yours would be if the null hypothesis were true — not the probability that the null is true, and not the probability you made an error. Statistical significance is a threshold, not a measure of importance.
You should understand:
- What a sampling distribution is and why it exists
- The four-step logic of hypothesis testing: assume H₀ is true, compute a test statistic, compare it to its distribution under H₀, and reject H₀ if the result is extreme enough (p < α)
- Why a non-significant result is not the same as “no effect”
- Why a significant result with a tiny effect size can be practically meaningless
- What the standard error is, and why it shrinks with \(\sqrt{n}\)
- What a 95% confidence interval promises: a procedure that captures the true value 95% of the time, not a 95% chance for any one interval
- What a Type I and Type II error are, and what α and power control
- Why normality matters for the right quantity (sampling distributions and residuals), and why large samples soften violations
- Why random assignment licenses causal claims and random sampling licenses generalization
Plain-language check: A friend says “p = .04 means there’s a 4% chance the results happened by chance.” What is wrong with that statement, and what does p = .04 actually mean?
The one mistake to avoid: Interpreting a non-significant result as proof of no difference. “We did not find evidence of an effect” is not the same as “there is no effect.” Small samples have low power and may simply have missed a real effect.
Practice: A study finds no significant difference between a drug and placebo (p = .18, n = 12 per group). A journalist writes “the drug has no effect.” Why is this conclusion not justified?
Key terms from this chapter are defined in the Glossary.
Next: the chapters in Part II move from theory to practice: installing R, getting data in, plotting it, and reshaping it for analysis.
The Coffee Experiment Simulator you used earlier has a partner worksheet. It draws sample after sample and plots the mean of each one, so the sampling distribution assembles in front of you rather than being asserted. Watch what happens to its width as you raise the sample size.
Worked in pairs and printed to PDF to hand in. No R needed for this one — everything happens on the page.
This module opens in a new tab.