← Course home
MODULE 5 · FIRST-YEAR LEVEL

Sampling, confidence intervals and power

How precisely can a sample inform us about a population?

70–90 minutesConcepts first, R optionalSynthetic data

Learning outcomes

Conceptual lesson

With random sampling, different samples from the same population yield different estimates. A sampling distribution describes how a statistic would vary across hypothetical repeated samples. Standard error measures the variability of an estimate across samples, not the spread of individual observations.

A 95% confidence-interval procedure has approximately 95% long-run coverage of the fixed population parameter under its assumptions. It does not mean that a fixed parameter randomly moves into the particular observed interval with 95% probability.

Statistical power is the probability of rejecting a false null hypothesis under a specified effect and test. Sample size, true effect, noise and the significance threshold influence power. Large samples do not remove selection bias.

Worked research example

Calculate a t-based confidence interval for the mean of 36 fictional quiz scores. But a mathematically computed interval from volunteers with unknown representativeness does not automatically justify inference about an actual university population.

Common reasoning trap

Saying the fixed population parameter has a literal 95% frequentist probability of being inside the observed interval is not the standard confidence-interval interpretation.

Practice tasks

  1. 1. Distinguish standard deviation from standard error in words.
  2. 2. Calculate a mean and t-based confidence interval for the 36 records; state a limitation to generalisation.
  3. 3. Predict how standard error changes as sample size increases while variability stays constant.

Explain your reasoning, not just the numerical result.

Optional R practice

Download the fictional CSV into your working folder, then run the script below or download the .R file. No additional packages are needed.

Download CSV · Download R lab · Module 0 refresher

# Statistics Lab / ferdo — synthetic data (no real student records)
# Save stats_synthetic.csv in your working directory.
d <- read.csv("stats_synthetic.csv", stringsAsFactors = TRUE)
stopifnot(nrow(d) == 36, all(c("score_pre","score_post","group") %in% names(d)))
# Groups are observational labels: differences cannot establish a treatment effect.

d <- read.csv("stats_synthetic.csv")
n <- sum(!is.na(d$score_post))
xbar <- mean(d$score_post)
se <- sd(d$score_post) / sqrt(n)
c(mean=xbar, standard_error=se)
t.test(d$score_post)$conf.int
# Inferential validity still depends on the data-generating process.

Stretch: mathematical track

Compare SE = s/sqrt(n) for n = 25, 100 and 400. What happens when sample size quadruples?

Exit ticket

Write one evidence-bounded claim and one limitation about this week's example.

This week's student workbook

Four original written problems (20 marks) and a formative four-question self-check.

Open week 5 workbook →

Optional mathematical derivations

Extend this topic with worked mathematics, written exercises and base R checks.

Math M5 · Math M6 · Full math pathway