STATS 101 · Module 1
Data, samples and describing data
By the end of today you can say where data come from, what kind they are, and what they say: with a graph and a few numbers.
STATS 101Module 1 of the course50-minute lecture
Today we ask three questions of any data set
- Where do the data come from? populations, samples, study design
- What kind of data are they? types of variables
- What do the data say? graphs, centre, spread, shape
- Check your understanding six-question quiz
Image: a collage of everyday statistics: an opinion poll, a clinical trial of a new medicine, sports analytics, a weather forecast, a website A/B test
1 · Why statistics?
Statistics draws conclusions from data despite variation
- Descriptive: summarise the data we have. Most of today.
- Inferential: from a sample to a population, with a measure of uncertainty. Later modules.
Image: John Snow’s 1854 street map of Soho, with each cholera death marked and the Broad Street pump at the centre of the cluster
2 · Two stories about data
A map of deaths found the source of cholera
London, 1854. John Snow marked each cholera death in Soho on a street map.
The deaths clustered around one water pump on Broad Street. Its handle was removed.
2 · Two stories about data · 1936
A huge biased sample lost to a small well-chosen one
Result: Roosevelt won about 61% of the popular vote and 46 of the 48 states. Bars drawn to scale.
3 · Population, sample, parameter, statistic
We study a sample to learn about a population
Memory aid: Population – Parameter; Sample – Statistic.
4 · Types of variables
Every variable is categorical or numerical
Watch out: a postcode or a student ID is categorical. Averaging them means nothing.
5 · Levels of measurement
Only ratio data have a true zero
| Nominal | Ordinal | Interval | Ratio |
| Order? | no | yes | yes | yes |
| Equal intervals? | no | no | yes | yes |
| True zero? | no | no | no | yes |
| Example | eye colour | race finishing position | temperature in °C | weight, income, time |
20 °C is not “twice as hot” as 10 °C; 20 kg is twice 10 kg.
Where do the data come from?
How data are collected matters more than how much
Study design, sampling methods, and the biases that mislead.
6 · Observational studies and experiments
Only a randomised experiment can show cause and effect
An observational study only watches and measures, so it can show an association, not cause and effect.
7 · Sampling methods
Pick a random method; avoid convenience samples
Every group of n has the same chance. Draw 100 student IDs at random.
A random sample from each group. 25 students from each year of study.
Randomly choose whole groups. Pick 5 lecture sections, survey everyone in them.
Every k-th after a random start. Every 20th name on the class list.
Whoever is easiest to reach: not random, avoid. Asking friends in the cafeteria.
A bigger sample does not fix bias
- Selection: the sampling leaves people out (1936: poorer voters).
- Non-response: those who don’t reply differ.
- Response: “Don’t you agree that…?”
- Voluntary response: online polls, call-in shows.
- More data only makes a biased answer look more precise.
What do the data say?
Plot first, then measure centre, spread and shape
Graphs, the mean and median, IQR and standard deviation, outliers, z-scores.
9 · Graphs
Match the graph to the data, and plot first
| Data | Graph | What it shows |
| One categorical variable | bar chart (or pie chart) | counts or percentages per category |
| One numerical variable | histogram | shape of the distribution |
| One numerical variable | box plot | five-number summary and outliers |
| Two numerical variables | scatter plot | direction, form, strength |
| A variable over time | line graph | trends |
9 · Anscombe’s quartet, 1973
Same summary numbers, four different pictures
Each set: 11 points, mean of x 9, mean of y ≈ 7.50, correlation ≈ 0.816, line y = 3 + 0.5x.
10 · Describing a distribution
Describe shape, centre, spread and anything unusual
Centre: where the typical value is. Spread: how much values vary. Unusual: outliers, gaps.
11 · Measures of centre
The outlier pulls the mean; the median resists
Mean x̄ = Σx / n = 260 / 10 = 26. Median: the middle of the ordered data, (20 + 22) / 2 = 21. Mode: most frequent.
12 · Measures of spread
The IQR measures the middle half: 27 − 15 = 12 minutes
Commute times, ordered. Q1 is the median of the lower half; Q3 the median of the upper half.
12 · Standard deviation
One outlier triples the standard deviation
s = √( Σ(x − x)² / (n − 1) )
- s
- roughly the typical distance of values from the mean
- n − 1
- for a sample; the sample mean sits closer to the data than the true mean
Commute: variance ≈ 341.3, s ≈ 18.5 min. Without the 76: s ≈ 6.1 min.
13 · Five-number summary, box plots and outliers
Beyond the 45-minute fence, the 76-minute commute is an outlier
Five-number summary: 12, 15, 21, 27, 76. IQR 12, so 1.5 × IQR = 18: fences 15 − 18 = −3 and 27 + 18 = 45.
14 · z-scores
A z-score counts standard deviations from the mean
z = (x − mean) / SD
- SD
- standard deviation; z > 0 above the mean, z < 0 below
- use
- compare a hard test with an easy one
Exam mean 70, SD 8: z for 86 = (86 − 70) / 8 = 2
15 · The 68–95–99.7 rule
Bell-shaped data: 68% within 1 SD, 95% within 2, 99.7% within 3
Exam: mean 70, SD 8. Only for roughly bell-shaped data; not for skewed data like the commute times.
16 · Correlation is not causation
Ice cream does not cause drowning; hot weather drives both
Other non-causal reasons: reverse causation, coincidence (especially when many variables are searched).
Check your understanding · 1 of 6
Is “favourite colour” categorical or numerical, and at what level?
- Categorical, nominal
- Categorical, ordinal
- Numerical, discrete
- Numerical, continuous
Check your understanding · 2 of 6
A survey about exercise habits only asks people leaving a gym. What is the problem?
- The sample is too small
- Selection bias: gym-goers exercise more
- Response bias from the wording
- No problem: it is random
Check your understanding · 3 of 6
Find the mean and median of 2, 4, 4, 5, 10.
- mean 5, median 4
- mean 4, median 5
- mean 5, median 5
- mean 4, median 4
Check your understanding · 4 of 6
Which is resistant to outliers: the mean or the median?
- The mean
- The median
Check your understanding · 5 of 6
An exam has mean 70 and SD 8. What is the z-score of 82?
- 1
- 1.5
- 2
- 12
Check your understanding · 6 of 6
Ice-cream sales and drownings are correlated. Does ice cream cause drowning?
- Yes: the correlation proves it
- No: hot weather is a confounding variable
- Yes, if the sample is big enough
Summary · next: Module 2, Probability
You can now ask three questions of any data set
Where from?
- Population → parameter (μ, σ); sample → statistic (x̄, s)
- Collect at random; more biased data doesn’t help
What kind?
- Categorical: nominal, ordinal
- Numerical: discrete, continuous
What do they say?
- Plot first; mean vs median; IQR, SD
- 1.5 × IQR; z; 68–95–99.7
- Correlation is not causation