Statistics 101

Labs & Demos

Interactive pages for this course. Every number on them is computed in your browser — nothing is a recorded animation, and nothing calls out to a server.

12 labs · 10 interactive demos
How to read these. Each page states which of its numbers are computed, which come from a published figure, and which are illustrative. Several were generated with AI assistance and say so on the page. They are teaching instruments, not measurements of real hardware.

Labs

Lab: Explore Centre and Spread

The centre and the spread, computed not eyeballed

M1Lab6 steps
What you will do
  1. The mean of 1, 2, 3, 4, 5
  2. The sample variance, and why n − 1
  3. Add one wild value: the mean jumps
  4. The median does not budge
  5. The 1.5·IQR upper fence
  6. Which point gets flagged

Lab: Always Plot Your Data

Identical numbers, different pictures

M2Lab6 steps
What you will do
  1. The correlation of Anscombe Set I
  2. Set II: the same r, a different picture
  3. The same fitted line, too
  4. A truncated axis exaggerates
  5. A zero baseline is honest
  6. Simpson's paradox: the sign flips

Lab: The Base-Rate Surprise

A positive test, a rare disease

M3Lab6 steps
What you will do
  1. The base-rate surprise
  2. How often the test even fires
  3. Count them: the true positives
  4. And the false positives
  5. The counts agree with Bayes
  6. When the disease is common

Lab: Confidence Intervals

Read the interval as a multiplier times a standard error

M5Lab5 steps
What you will do
  1. The 95% multiplier z*
  2. The margin of error at n = 25
  3. Quadruple n to 100, halve the margin
  4. Unknown σ: the wider multiplier t*
  5. The t-interval margin at n = 25

Lab: Fit a Line, Then Find What Moves It

Fit a line, then find its influential point

M7Lab5 steps
What you will do
  1. The least-squares slope, b₁
  2. The intercept, b₀
  3. How much variance does R² explain?
  4. The leverage of a far point, hᵢᵢ
  5. Cook's distance — the influence

Lab: Rank Correlation and Kernel Density

Read a link by its ranks, a shape by its density

M8Lab5 steps
What you will do
  1. Rank correlation on a curved climb
  2. The linear coefficient, same cloud
  3. One wild point drags Pearson
  4. …but Spearman barely notices
  5. A density that shows two peaks

Lab: Sample a Posterior with MCMC

Sample a posterior you cannot solve

M9Lab5 steps
What you will do
  1. Where the chain lives: the mean
  2. The spread: the variance
  3. The headline: covariance → ρ
  4. Gibbs: an exact conditional
  5. Why n draws are worth fewer: acf[0]

Lab: Decompose, Correlate, Forecast a Time Series

Split a series into trend, season and noise — then read its memory

M10Lab5 steps
What you will do
  1. Autocorrelation at lag zero
  2. A pure wave, and its ACF spike
  3. Which lag does the ACF peak at?
  4. Does T + S + R add back to the series?
  5. An AR(1) coefficient equals the lag-1 ACF

Lab: A/B Testing

A significant p needs a real lift and enough n

M11Lab5 steps
What you will do
  1. The two-proportion z
  2. Its p-value, and the verdict
  3. At zero lift, the false-positive rate
  4. How much n buys 80% power?
  5. Peeking breaks the α guarantee

Demos

Data explorer

Edit a small dataset (or load symmetric, skewed, bimodal and with-outlier presets) and watch the mean, median, mode, standard deviation, five-number summary and the 1.5×IQR outlier rule recompute, with a live histogram and box plot — the mean chases the tail while the median resists.

M1 · L1AI-generated

Probability simulator

Run a seeded coin or die and watch the running frequency converge to the true probability while the raw count difference drifts the other way; then set a medical test’s prevalence, sensitivity and specificity and read the exact P(disease | +) off a confusion table and a probability tree — a 99% test on a 1% disease is right only about half the time it says yes.

M3 · L1AI-generated

A/B testing simulator

A two-sample A/B experiment: set the control and variant conversion rates and the per-arm size, and read the pooled two-proportion z, the p-value and the unpooled confidence interval for the lift. See the power to detect the lift, the sample size a target power needs, and why peeking at the results early makes a 5% test reject far more than 5% of the time.

M11 · L1AI-generated

Non-parametric methods

Non-parametric methods, made computable: a kernel density estimate with an adjustable bandwidth (and Silverman’s rule) that finds two humps where one fitted normal sees only one; a LOESS smoother that follows a bend the global line flattens; and Spearman’s rank correlation shown against Pearson’s r — rho stays 1 on y = x³ and shrugs off an outlier that drags r.

M8 · L1AI-generated

Time series analysis

From lesson Time Series Basics

Time-series analysis on a seeded trend + season + noise series: an additive decomposition whose trend, seasonal and residual add back to the series exactly; the ACF and PACF with ±1.96/√N bands, where a seasonal spike stands above the band; and an AR(p) forecast fit by Yule–Walker — for AR(1), φ̂ = ρ₁ exactly.

M10 · L1AI-generated