Chapter 1 · OpenStax Ch 1
Sampling and Data
How we get data, and why the way we sample decides what we can conclude.
1.1 Population and sample
The grey dots are every person we care about, the population. Their average height is the population mean \(\mu\), a fixed number called a parameter. In real life we never see all the dots. We measure a sample, a handful chosen at random, and compute its average \(\bar{x}\), a statistic.
Click the field a few times. Each click is a fresh sample. The highlighted dots change and the solid line \(\bar{x}\) jumps to a new place, while the dashed line \(\mu\) never moves. The small triangles remember where earlier sample means landed. Now raise \(n\) and click again. With more dots in each sample the jumps get smaller, but they never stop. A statistic is an estimate, not the truth.
Reading: OpenStax Introductory Statistics, Section 1.1.
Try it
- The population is the 800 dots. Sample size, n starts at 25.
- Press Draw a sample, or click anywhere on the dots. 25 dots light up and their mean is marked.
- Compare Sample mean x̄ with Population mean μ. They differ, because 25 dots cannot stand in for 800 exactly.
- Press Draw a sample ten more times. The marks of past means form a trail around μ.
- Slide n to 200 and draw again. New means land much closer to μ. New population starts over with fresh dots.
1.2 Sampling methods and bias
The town has four neighbourhoods with very different commute times. How we pick residents decides what we can conclude. A simple random sample gives every resident the same chance. A stratified sample takes a share from each neighbourhood in proportion to its size. A cluster sample picks one whole neighbourhood at random. A convenience sample takes whoever is nearest the entrance.
Choose a method and press “Draw 20”. Watch the mean of all sample means. The first three settle on the population mean, though cluster samples swing wildly on the way. The convenience sample settles somewhere else, every time, because it keeps asking the same neighbourhood. That gap is sampling bias, and no amount of extra data removes it.
Reading: OpenStax Introductory Statistics, Section 1.2.
Try it
- Simple random is selected to begin with, and Sample size, n is 40.
- Press Draw a sample. The chosen people light up and This sample's mean appears.
- Press Draw 20. Mean of all sample means settles close to Population mean.
- Pick Stratified or Cluster and draw again. Both still centre on the population mean.
- Pick Convenience and press Draw 20. It takes the people nearest the entrance, and the mean of sample means drifts from the truth.
1.3 Variation in samples
Draw one sample and note its mean. Draw another, honestly, from the same population, and you get a different number. Neither is wrong. This is sampling variability. Samples disagree because they contain different people. The histogram piles up the means of every sample drawn so far. The pile centres on the population mean, and its width shows how far a single sample can wander.
Now slide \(n\) up and draw again. The pile becomes narrower, because bigger samples disagree less. The readout SD of sample means measures that width.1 Two students who each survey ten people should expect different answers. Two who each survey a hundred should expect close ones.
1 Standard deviations on this site divide by \(n - 1\), the sample convention. Reading: OpenStax Introductory Statistics, Sections 1.2, 1.3.
Try it
- Sample size, n starts at 10. Press Draw 1 sample. One sample lights up and its mean drops into the histogram below.
- Press Draw 100. A pile of sample means forms around Population mean.
- Read SD of sample means. That number is the sampling variation at n = 10.
- Slide n to 40, press Reset, then Draw 100 again. The pile is narrower and the SD is about half.
- Slide n to 2 for the opposite. Auto-draw keeps drawing until you press it again.