Resampling Statistics

Explore data through resampling-based statistical methods

← Back to Home

Each entry below links to a Jupyter notebook that produces the corresponding figure from the book. Click Run interactively in browser to open an interactive session — no installation required. The notebook runs entirely in your browser via JupyterLite. If it's slow to load, click View code to browse the static Python code and figures instantly.

Every notebook here is yours to modify — swap in your own colors, styling, and data, and use it as a starting point for your own publication-quality graphics.

Figure 2.16

KDE Illustration

KDE illustration thumbnail

Kernel density estimates for a 100-point SBP dataset using four different kernel widths (σ = 0.4, 1, 2, 3), showing how bandwidth affects smoothness.

Figure 2.22

Three-Cluster Scatter Plot

Three-cluster scatter plot thumbnail

An artificial (X, Y) data set with three clusters generated via Gaussian blobs, illustrating how scatter plots reveal grouping structure.

Figure 2.24

Iris Dataset 2D KDE

Iris 2D KDE thumbnail

2D kernel density estimate of sepal width vs sepal length for two Iris species, using color instead of height to show density.

Figure 3.4

Simulating Probabilities: How many girls?

Null distribution of girls in a family of 5 thumbnail

Null distribution for the number of girls in a family of 5 children, from 100,000 simulated families with equal probabilities of boys and girls.

Figure 3.12

Girl Birth Rate: Two-Sided NHST

Girl birth rate histogram thumbnail

Null-hypothesis simulation for a 52/48 girl/boy birth split, shading both tails of the null distribution to compute a two-sided surprise value.

Figure 4.22

Sex Ratio Near Power Plants: Confidence Interval

Sex ratio confidence interval histogram thumbnail

Resampling-based confidence interval for a study observing 52% girl births in 300 births near power plants.

Figures 6.8–6.12

T-Cell Count: Two-Group Comparison

T-cell count beeswarm plot thumbnail

Beeswarm, histogram, KDE, summary statistics, and big-box NHST resampling for Control vs Treatment groups.

Figures 6.18–6.21

Survival Data: Two-Group Comparison

Survival data beeswarm plot thumbnail

Beeswarm, histogram, summary statistics with boxplot, and big-box NHST resampling for Control vs Treatment cancer survival data.

Figures 6.37–6.43

Swimsuit vs Wetsuit Swimming Speed

Paired swim speed plot thumbnail

Dot plots, paired-differences plot, and independent vs paired null distributions for paired swim speed data.

Figures 7.20, 7.23–7.24

T-Cell Count: Three-Group Comparison

Three-group beeswarm plot thumbnail

Omnibus resampling test and pairwise post-hoc comparisons — choosing big-box vs two-box by variance ratio — with p-values and 99% confidence intervals, for T-cell counts across a control and two drug groups.

Figures 8.37, 8.40, 8.41

Titanic Survival by Class

Mt. Fuji insignificance-band plot thumbnail

Observed and expected contingency tables, NHST null distribution, and Mt. Fuji insignificance-band plot for survival by passenger class.

Figure 10.40

Wildfire Regression & Resampling-based CI

Resampling-based CI regression lines thumbnail

OLS regression of wildfire area over time, null-hypothesis shuffle test, and resampling-based confidence interval for the slope.

Figures 11.8–11.9

Power of a Study

Power of a study histogram thumbnail

Bootstrap NHST power simulation comparing sample sizes of n = 10 and n = 25, showing how power increases with a bigger study.

Figures 12.25–12.26

Bayesian Clinical Trial

Bayesian posterior curves thumbnail

Bayesian updating of a drug's cure rate as 10 patients come in one at a time, plus the null-hypothesis distribution and p-value for the same data.

We follow the excellent exposition of Donald Berry's Bayesian clinical trials (Berry, 2006).