Statistics recap

A working set of notes for applied statistics — descriptive stats, distributions and the everyday tables. Numbers in formulas use μ, σ for a whole population and x̄, s for a sample.

Sampling

Before any statistic means anything, the sample has to represent the population. A good sample is spread across the whole population; a bad sample clusters in one place and misses the rest.

Good sample
even coverage

Bad sample
clustered, with a couple of strays

Centre & spread

Two questions about any dataset: where is the middle (central tendency), and how far do values wander from it (spread)?

Central tendency

unimodal — one peak
1, 2, 3, 3, 3, 4, 5
bimodal — two peaks
1, 1, 1, 2, 3, 3, 3, 4, 5
no mode — nothing repeats more
1, 1, 2, 3, 3, 4, 5, 5

Spread — variance & standard deviation

Variance is the average squared distance from the mean. Standard deviation is its square root, putting spread back into the original units — roughly “how far is a typical value from the mean?”

PopulationSample
Meanμ = Σx / Nx̄ = Σx / n
Varianceσ² = Σ(x − μ)² / Ns² = Σ(x − x̄)² / (n − 1)
Std deviationσ = √σ²s = √s²

A sample divides by n − 1 (Bessel’s correction): a sample tends to underestimate the true spread, so we shrink the denominator to compensate.

Spread — the interquartile range (IQR)

The quartiles cut the sorted data into four. IQR = Q3 − Q1 — the range of the middle 50%.

The distribution curve

One graph for most of it. Move the mean to slide the curve, change the spread to make it taller/narrower or shorter/wider, and add skew to pull a tail. Toggle the layers to see the empirical rule, Chebyshev’s bounds, the mean/median/mode split, and a z-score.

Normal distribution & the empirical rule

A normal distribution is the symmetric bell. Because its shape is fixed and predictable, set proportions fall within each band of the mean:

68% within μ ± 1σ
95% within μ ± 2σ
99.7% within μ ± 3σ

The smooth bell is a density curve: the y-axis is probability density, not count, and the total area under it is 1. Probability = area under a stretch of the curve.

z-scores

A z-score restates a value as “how many standard deviations from the mean”, so values from different distributions become comparable.

z = (x − μ) / σ

Look up the area (probability) for a z-score at ztable.io.

Chebyshev’s theorem — any shape

The empirical rule needs a normal shape. When the distribution is skewed or unknown, Chebyshev still gives a guaranteed minimum proportion within k standard deviations — it works for any shape, so it’s more conservative.

proportion ≥ 1 − 1/k²   (k > 1)
k (std devs)234
Normal (empirical)95%99.7%
Any shape (Chebyshev, at least)75%89%94%

k must be > 1 (at k = 1 the formula gives 0, so no useful bound). k is just a z-score: k = (x − μ) / σ.

Shape: symmetry, skew & outliers

Where the mean, median and mode sit relative to each other tells you the shape. The mean chases the tail.

Left (negative) skew
tail on the left
mean < median < mode

Symmetric
no tail
mean = median = mode

Right (positive) skew
tail on the right
mode < median < mean

mean   median   ··· mode

Which measures to use

ShapeBest centreBest spread
Symmetric / normalMeanStandard deviation
Skewed / has outliersMedianIQR

When a tail or outlier would drag the mean and standard deviation around, switch to the median and IQR — both ignore the extremes.

Spotting outliers — the 1.5×IQR rule

A value is an outlier if it falls outside the fences:

below  Q1 − 1.5×IQR   or   above  Q3 + 1.5×IQR

Plots

Box & whiskers

Draws the five-number summary (min, Q1, median, Q3, max). The box is the IQR; whiskers reach the last value inside the fences; dots beyond them are outliers. Great for comparing spread and skew, and for seeing outliers at a glance.

IQR = Q3 − Q1 min Q1 median Q3 max outlier

Stem & leaf

Keeps the raw values while showing the shape (like a histogram on its side). The stem is the leading digit(s), each leaf the last digit. Best for small datasets. Below: 23, 25, 31, 34, 34, 42, 47, 48, 51.

stem | leaf
  2  | 3 5
  3  | 1 4 4
  4  | 2 7 8
  5  | 1

Histogram, frequency polygon & density curve

A histogram bins continuous data and draws a bar per bin (bars touch). A frequency polygon joins the bar midpoints with a line. A density curve is the smooth, idealised version — the population shape the data is hinting at. All three show centre, spread, skew and modality.

density polygon

Tables & distributions

A one-way table counts one variable. A two-way (contingency) table cross-tabulates two. From one two-way table you can read every distribution below. Example: 100 students, by year and whether they drink coffee.

Coffee: yesCoffee: noTotal
Junior302050
Senior45550
Total7525100

The joint distribution as area — each of the 100 squares is one student, grouped by the four cells. The block sizes are the joint proportions:

Junior·Yes (30) Junior·No (20) Senior·Yes (45) Senior·No (5)