Topic contents

Lesson 4

Sampling error, standard error, and margin of error

A height survey of male university students · One example, three concepts, explained step by step

Why might the sample mean differ from the population mean?

Part 1 · One sample

The university has 20,000 students. We want to estimate the mean height of all male students at the university. Suppose the true mean of the simulated population is μ = 172 cm, with population standard deviation σ = 6 cm.

Class discussion: if we randomly select 100 male students, must their mean height be exactly 172 cm?
168169170171172173174175176Mean height (cm)Population mean μ = 172Click “Randomly select 100 male students” to start
  • Population mean μ
  • Current sample mean x̄
  • Sampling error e
The horizontal axis shows mean height. The dashed line marks the fixed population mean, and the blue dot marks the current sample mean. The annotation between them shows this sample's sampling error e.

Current sample meanNo sample drawn yet

The actual deviation appears after sampling.

Expressing sampling error

e=xˉ−μe=\bar{x}-\mu

This section expresses a sample's sampling error as a signed difference; its absolute value measures the size of the deviation.

Repeated sampling

Try it

Students per sample n

How does sampling error fluctuate?

Part 2 · Repeated sampling

If we keep drawing independent random samples from the same population, the sample mean may differ each time. The standard error measures the typical variability of sample means under repeated sampling: it is the standard deviation of the sample mean's sampling distribution.

Theoretical standard error
0.600 cm
Samples simulated
Samples: 0
Empirical standard deviation of sample means
—
168169170171172173174175176Sample mean (cm)μ = 172Click “Draw 10 samples” or “Draw 100 samples” to start
  • Sample means
  • μ ± σ/√n
  • Theoretical sampling distribution N(μ, σ²/n)
  • Population mean μ
Blue dots show the sample means. As more samples are drawn, their variability around the population mean becomes easier to see. The shaded band is μ ± σ/√n, and the curve at the bottom is the theoretical sampling distribution N(μ, σ²/n).

Proportion within μ ± σ/√n: —

Calculating the standard error

σxˉ=σn\sigma_{\bar{x}}=\frac{\sigma}{\sqrt{n}}

Under independent and identically distributed sampling; σ = 6 cm

Substitute: 6 ÷ √100 = 0.600 cm

How does the standard error change when sample size increases from 25 to 400?

Note: the standard error is neither the actual error in each sample nor a simple arithmetic mean of the errors.

Construct an interval

Try it

Confidence level
Sample size n

How much deviation do we allow when constructing an interval estimate?

Part 3 · Construct an interval

The researcher first chooses the desired confidence level (such as 90%, 95%, or 99%). This determines how far the interval extends on either side: the margin of error Δ. A higher confidence level usually requires a wider interval.

Sample mean
172.63 cm
Standard error
0.600 cm
Coefficient k (determined by confidence level)
1.9600
Margin of error
Δ = 1.176 cm

95% confidence interval[171.45, 173.81] cm

μ = 172168169170171172173174175176Mean height (cm)Sample mean171.45173.81
  • x̄ ± Δ
  • Sample mean
  • Population mean μ
When the confidence level changes, the sample mean stays fixed and only interval width changes, making the role of the confidence level easier to observe.

This interval covers the population mean μ = 172 cm.

Margin of error and the interval

Δ=k×σn\Delta=k\times\frac{\sigma}{\sqrt{n}}

k is a coefficient determined by the selected confidence level; the source and calculation of z values will be explained in detail in later lessons

Substitute: 1.9600 × 6 ÷ √100 = 1.176 cm

xˉ±Δ\bar{x}\pm\Delta

Interval estimate = point estimate ± margin of error

Class discussion: if we increase the confidence level from 90% to 99% to seek greater coverage, should the interval become wider or narrower?

Conclusion: Other conditions being equal, a higher confidence level gives a larger margin of error and a wider interval.

Three concepts in one sentence

Sampling error is the difference between a particular sample estimate and the true value; standard error measures typical variability under repeated sampling; margin of error is the half-width used to construct an interval at a given confidence level.

Note: we choose the confidence level in advance, but Δ is not arbitrary: it also depends on sample size and standard error. The margin does not guarantee that every actual sampling error stays within Δ; at a 95% confidence level, about 5% of intervals miss the true value in the long run.