STATS 101 · Module 1

Data, samples and describing data

By the end you can tell a population from a sample, choose a graph, describe a data set, find its outliers, and explain why correlation is not causation.

Lecture, 50 minutesFirst year, no statistics background

Three questions, then a quiz

  1. Where do the data come from? about 15 min
  2. What kind of data are they? about 7 min
  3. What do the data say? about 22 min
  4. Quiz and summary about 5 min

Why statistics?

Statistics is the science of collecting, describing and drawing conclusions from data.

It works in the presence of variation and uncertainty.

Image placeholder: John Snow's 1854 street map of Soho, with each cholera death marked as a dot and the Broad Street pump

Part 1 · Where do the data come from?

A map of deaths pointed to the cause

In 1854 John Snow marked each cholera death on a street map. The deaths clustered around one water pump on Broad Street. The pump's handle was removed.

Image placeholder: the Literary Digest magazine, 1936 issue (cover or masthead)

Part 1 · Where do the data come from?

A huge biased sample is worse than a small, good one

Part 1 · Vocabulary

We want to know the population; we only measure a sample

Population: the whole group. Sample: the part we collected data from.

Part 1 · Sampling

Random samples spread across the population; convenience samples clump

Illustrative dot grids, not real data. Each dot is one person; the bright dots are the sample.

Part 1 · Sampling methods

Four methods use chance; convenience sampling is the one to avoid

How it worksExample
Simple randomevery n-person group has the same chance100 student IDs drawn at random
Stratifiedrandom sample from each group25 students from each year
Clusterrandom whole groups5 lecture sections, all surveyed
Systematicevery k-th after a random startevery 20th name on the list
Conveniencenot random: avoidasking friends in the cafeteria

Part 1 · Bias

Bias: four ways a sample misleads, and size fixes none of them

  1. Selection bias

    The way the sample is chosen leaves out part of the population.

  2. Non-response bias

    The people who do not respond differ from those who do.

  3. Response bias

    Question wording or setting pushes people towards an answer.

  4. Voluntary response bias

    Only people with strong opinions choose to take part.

  5. A bigger sample does not fix bias

    It only makes a biased answer look more precise.

Part 1 · Study design

Only a randomised experiment can show cause and effect

  1. Observational study

    Researchers observe without assigning treatments, e.g. surveying students about sleep and grades. It shows association, not cause and effect.

  2. Experiment

    Researchers assign the treatments and compare outcomes, with a control group, random assignment, and a placebo and blinding where possible.

Part 2 · Types of variables

Every variable is either categorical or numerical

Watch out: numbers are not always numerical. A postcode or a student ID is categorical; averaging it means nothing.

Part 2 · Levels of measurement

Only ratio data have order, equal intervals and a true zero

NominalOrdinalIntervalRatio
Order?noyesyesyes
Equal intervals?nonoyesyes
True zero?nononoyes
Exampleeye colourrace finishing positiontemperature in °Cweight, income, time

Why it matters

20 °C is not twice as hot as 10 °C. 20 kg is twice 10 kg.

Interval data have no true zero; ratio data do.

Part 3 · Graphs

Plot before you compute, using the graph that fits the variable

DataGraphWhat it shows
Categoricalbar chart or pie chartcounts or percentages
Numericalhistogramshape of the distribution
Numericalbox plotfive-number summary, outliers
Two numericalscatter plotdirection, form, strength
Over timeline graphtrends

Part 3 · Always plot first

Same summary numbers, four completely different pictures

9mean of x in each data set
7.50mean of y, about
0.816correlation, about
0.5slope of the regression line, y = 3 + 0.5x

Anscombe's quartet (1973): four data sets of 11 points each

Part 3 · Shape and centre

Right skew pulls the mean above the median

Illustrative curves. In a right-skewed distribution the mean is above the median; in a left-skewed one it is below. Use the median for skewed data such as incomes.

Part 3 · Centre

The mean shares out the total; the median takes the middle

x̄ = Σx / n
Σx
add all the values
n
how many values
Median
middle of the ordered data; average the two middle values if n is even
Mode
the most frequent value

Worked example · commute times

Ten commutes give three different centres

26minmean: 260 ÷ 10
21minmedian: average of 20 and 22
15minmode: appears twice

Commute times in minutes, 10 students: 12, 15, 15, 18, 20, 22, 25, 27, 30, 76

Part 3 · Outliers and centre

One 76-minute commute moves the mean, but barely the median

All ten commutesWithout the 76
Mean26 minabout 20.4 min
Median21 min20 min

Part 3 · Spread

The outlier stretches the range; the IQR covers the middle 50%

64minrange: 76 − 12
12minIQR: Q3 − Q1 = 27 − 15
18.5minstandard deviation, s

Quartiles: lower half 12, 15, 15, 18, 20 gives Q1 = 15; upper half 22, 25, 27, 30, 76 gives Q3 = 27

Part 3 · Standard deviation

One 76-minute outlier triples the standard deviation

s = √( Σ(x − x̄)² / (n − 1) )
x̄
the sample mean
n − 1
for a sample we divide by n − 1, not n; this corrects for the sample mean sitting closer to the data than the true mean

With the 76: s ≈ 18.5 min. Without it: s ≈ 6.1 min.

Part 3 · Outliers

The 1.5 × IQR rule flags the 76-minute commute

Fences: Q1 − 1.5 × IQR = 15 − 18 = −3 and Q3 + 1.5 × IQR = 27 + 18 = 45. The whiskers reach 12 and 30; the 76 is an outlier.

Part 3 · z-scores

A z-score says how many SDs a value sits from the mean

z = (x − mean) / SD
x
the value we are looking at
SD
the standard deviation of the data

Exam: mean 70, SD 8. A score of 86 has z = (86 − 70) / 8 = 2: two SDs above the mean.

Part 3 · Bell-shaped data

For bell-shaped data, about 68%, 95% and 99.7% lie within 1, 2 and 3 SDs

Exam example (mean 70, SD 8): about 68% of scores fall between 62 and 78, about 95% between 54 and 86, about 99.7% between 46 and 94. The rule applies only to roughly bell-shaped data, not to skewed data such as the commute times.

Part 3 · Correlation

Ice cream does not cause drownings; hot weather drives both

Hot weather is a confounding variable. Other reasons for correlation without causation: reverse causation, and coincidence, especially when many variables are searched.

Quiz · 1 of 3

Check your understanding

  1. Is "favourite colour" categorical or numerical, and at what level?

    Categorical, nominal

  2. A survey about exercise habits only asks people leaving a gym. What is the problem?

    Selection bias from a convenience sample: gym-goers exercise more than the population.

Quiz · 2 of 3

Check your understanding

  1. Find the mean and median of 2, 4, 4, 5, 10.

    Mean 5, median 4

  2. Which is resistant to outliers: the mean or the median?

    The median

Quiz · 3 of 3

Check your understanding

  1. An exam has mean 70 and SD 8. What is the z-score of 82?

    1.5, since (82 − 70) / 8 = 1.5

  2. Ice-cream sales and drownings are correlated. Does ice cream cause drowning?

    No. Hot weather is a confounding variable.

Summary

Collect carefully, plot first, then describe with centre and spread

  1. Design matters more than size

    Random sampling and randomised experiments. A bigger biased sample does not help.

  2. Know the variable

    Categorical (nominal, ordinal) or numerical (discrete, continuous).

  3. Plot before you compute

    Anscombe's quartet: the same summary numbers, four different pictures.

  4. Centre and spread

    Mean (sensitive) or median (resistant); range, IQR, SD; outliers beyond 1.5 × IQR.

  5. Correlation is not causation

    Look for confounders. Next module: probability, the language of uncertainty.