STATS 101 · Module 1

Data, samples and describing data

By the end of this hour you can tell a sample from a population, pick a graph, and explain why correlation is not causation.

First-year course50 minutes

The plan

Three questions structure this hour

  1. Where do the data come from? populations, samples, study design
  2. What kind of data are they? types of variables
  3. What do the data say? graphs, centre, spread, shape

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

Where do the data come from?

Two branches: describe what we have, or infer beyond it

Descriptive statistics

Summarise the data we have: tables, graphs, averages. Most of this module.

Inferential statistics

Use a sample to draw conclusions about a larger population, with a measure of uncertainty. Later modules.

Story 1 · London, 1854

A simple picture of data pointed to the cause

During a cholera outbreak in Soho, John Snow marked each death on a street map. The deaths clustered around one water pump on Broad Street. The pump's handle was removed.

Image placeholder: John Snow's 1854 map of cholera deaths around the Broad Street pump.

Story 2 · The Literary Digest poll, 1936

A giant poll predicted the wrong winner

10Mballots mailed, about
2.4Mreturned, about
61%of the popular vote went to Roosevelt, about
46 of 48states won by Roosevelt

Takeaway

A huge biased sample is worse than a small well-chosen one

George Gallup, with a much smaller but better-chosen sample of about 50,000 people, correctly predicted Roosevelt's win. How data are collected matters more than how much there is.

Image placeholder: a 1936 newspaper front page about the Roosevelt landslide.

Where do the data come from?

A sample gives a statistic that estimates the population's parameter

Memory aid: Population – Parameter; Sample – Statistic.

What kind of data are they?

Every variable is categorical or numerical

Watch out: a postcode or a student ID is categorical; averaging them means nothing.

What kind of data are they?

Levels of measurement decide which arithmetic makes sense

LevelOrder?Equal intervals?True zero?Example
Nominalnononoeye colour
Ordinalyesnonorace finishing position
Intervalyesyesnotemperature in °C
Ratioyesyesyesweight, income, time

Where do the data come from?

Only an experiment can show cause and effect

Observational study

Researchers observe and measure without assigning treatments, e.g. surveying students about sleep and grades. It can show an association, but not cause and effect.

Experiment

Researchers assign treatments and compare outcomes. Only a well-designed randomised experiment can establish cause and effect.

Where do the data come from?

A good experiment has four ingredients

  1. Control group

    for comparison

  2. Random assignment

    groups alike apart from the treatment

  3. Placebo

    where possible

  4. Blinding

    double-blind: neither subjects nor researchers know who got what

Where do the data come from?

Random sampling methods beat convenience

MethodHow it worksExample
Simple randomevery group of n has the same chancedraw 100 student IDs
Stratifiedrandom sample from each stratum25 students per year
Clusterrandomly choose whole groupspick 5 lecture sections
Systematicevery k-th after a random startevery 20th name on a list
Conveniencewhoever is easiest: avoidfriends in the cafeteria

Four ways a sample can mislead

A bigger sample does not fix bias. It only makes a biased answer look more precise.

What do the data say?

The type of data picks the graph

DataGraphWhat it shows
One categorical variablebar chart (or pie chart)counts or percentages per category
One numerical variablehistogramshape of the distribution
One numerical variablebox plotfive-number summary and outliers
Two numerical variablesscatter plotdirection, form, strength
A variable over timeline graphtrends

What do the data say?

Same summary numbers, four completely different pictures

Anscombe's quartet (1973): 11 points each; mean of x = 9, mean of y about 7.50, correlation about 0.816, line y = 3 + 0.5x. Sketch of the four shapes.

What do the data say?

Describe every distribution by shape, centre, spread and unusual features

Skewed left is the mirror image of skewed right. Centre: the typical value. Spread: how much values vary. Unusual: outliers, gaps.

What do the data say? · Centre

Ten commute times: mean 26, median 21, mode 15

12, 15, 15, 18, 20, 22, 25, 27, 30, 76 minutes

26 minMean: sum 260 ÷ n = 10
21 minMedian: middle values 20 and 22
15 minMode: appears twice

What do the data say? · Centre

One outlier drags the mean but barely moves the median

Remove the 76-minute commute: the mean drops from 26 to about 20.4, the median only from 21 to 20.

Commute example, 10 students

With 76Without 76
Mean2620.4
Median2120

What do the data say? · Spread

Range is fragile; IQR and SD tell the spread better

64 minRange: 76 − 12, very sensitive to outliers
12 minIQR: Q3 − Q1 = 27 − 15, the middle 50%
18.5 minStandard deviation s, about

What do the data say? · Spread

The standard deviation is the typical distance from the mean

s = √( Σ(x − x)² / (n − 1) )
x
the sample mean
n
how many values; we divide by n − 1 for a sample

What do the data say? · Outliers

The 1.5 × IQR rule flags the 76-minute commute as an outlier

Five-number summary: 12, 15, 21, 27, 76. Fences: 15 − 18 = −3 and 27 + 18 = 45 (1.5 × 12 = 18).

What do the data say? · How unusual?

A z-score counts standard deviations from the mean

z = (x − mean) / SD
+ / −
above or below the mean
use
compare values on different scales

Exam: mean 70, SD 8. Score 86 → z = (86 − 70) / 8 = 2

What do the data say? · Bell-shaped data

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

Exam, mean 70, SD 8: 62–78, 54–86, 46–94. A score of 86 (z = 2) beats about 97.5% of the class. Not for skewed data like the commutes.

What do the data say? · Caution

Correlation is not causation: look for the confounder

Other reasons: reverse causation, coincidence (especially when many variables are searched). Only a randomised experiment shows cause and effect.

Check your understanding · 1 of 2

Quiz: data, bias and centre

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

    Categorical, nominal

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

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

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

    Mean 5, median 4

Check your understanding · 2 of 2

Quiz: resistance, z-scores and causation

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

    The median

  2. Exam mean 70, SD 8. What is the z-score of 82?

    1.5

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

    No; hot weather is a confounding variable

Summary

Collect well, plot first, then summarise

Data

  • Data become conclusions amid variation
  • Population → μ, σ; sample → x̄, s
  • Categorical or numerical

Collection

  • Random samples, randomised experiments
  • Bigger biased samples do not help
  • Always plot first

Describing

  • Mean vs median; range, IQR, SD
  • Outliers: 1.5 × IQR rule
  • z-scores; 68–95–99.7
  • Correlation is not causation