Neural networks
Bayesian computation
Regression models
-
Non-linear effects in a linear model
Fit a curved BMI–blood pressure association without leaving the linear model framework.
Switch between polynomials, fractional polynomials, linear splines and restricted cubic splines; vary the degree, the powers and the number of knots; compare the fitted curves and R².
-
Correlated covariates
Turn up the correlation between two covariates and see what it does to their coefficients.
Set the sample size and the three pairwise correlations — between the two covariates, and between each covariate and the outcome — then inspect the fitted regression, the coefficient estimates and the residual plot as they change.
-
One continuous and one binary covariate
See why this model is just two parallel lines, one per level of the binary covariate.
Sliders for the correlation between the two covariates, the R², and the sample size, with the fitted lines redrawn as each changes.
-
Coding dummy variables
See how a categorical variable becomes a set of 0/1 columns, and what the reference level does.
An interactive demonstration of how dummy variables are coded from a categorical variable.
Trial design
-
Randomisation from a table of digits
Enrol patients one at a time the way it was done on paper, then see how far the groups drift apart.
Pick a starting cell in a grid of random digits, apply a digit-to-allocation rule, and allocate under simple or blocked randomisation. Plots the running treatment−control imbalance, then re-runs the same design 2,000 times to show the distribution of the final imbalance. Includes teaching notes and discussion questions.
-
Sample size and power calculator
Size a study for the outcome you actually have, and check the formula against a simulation.
Covers continuous, binary, odds ratio, hazard ratio, restricted mean survival time and count outcomes. Every scenario can be computed from the closed-form formula or by simulation, so the two can be compared directly; the simulation mode also allows for adjustment for a baseline covariate correlated with the outcome.
Sampling distributions
-
The central limit theorem
Draw a population by hand, then watch the sampling distribution of the mean turn normal anyway.
Set a population distribution — normal, uniform, exponential, bimodal, or sketched directly on the plot — then draw repeated samples of size 5 to 100 and accumulate the sampling distribution of the mean or the median against a fitted normal curve.
-
The Galton board
Every ball takes nine independent coin flips on its way down, and the bell shape appears without anyone drawing it.
A physical simulation of a nine-row pin board. Release a single ball and follow its path, or open the hopper and let a stream run until the bins fill. The heights that build up are the binomial distribution one ball at a time.
Probability
Using these in your own teaching
Embed one in your course site
Every simulation is a self-contained page and drops into an LMS page or slide with an iframe:
<iframe src="https://atpinto.github.io/CLT/"
width="100%" height="640"
style="border:1px solid #ccc"></iframe>
Licence and citation
Released under CC BY 4.0 — reuse, adapt and remix in your own teaching, with attribution.