Statistics Playground
An interactive playground for probability and statistics. Pick a function,
edit its parameters, and see the distribution curve, the computed value,
and a plain-English interpretation — all computed in your browser
(no server, no install). The functions mirror familiar R syntax
(for example pnorm, dbinom, t.test)
and the numbers come from numpy running under Pyodide.
The normal distribution
- pnorm(q, mean = 0, sd = 1) — Cumulative probability for the normal distribution.
- dnorm(x, mean = 0, sd = 1) — Height of the bell curve at a point (the density).
- qnorm(p, mean = 0, sd = 1) — The inverse of pnorm; turns a probability back into a value.
- rnorm(n, mean = 0, sd = 1) — Draws random values from a normal distribution.
- scale(x) — Re-expresses values as z-scores (mean 0, sd 1).
Binomial & Poisson distributions
- dbinom(x, size, prob) — Probability of exactly x successes in n trials.
- pbinom(q, size, prob) — Probability of q or fewer successes.
- dpois(x, lambda) — Probability of exactly x events at rate λ.
- ppois(q, lambda) — Probability of q or fewer events at rate λ.
The chi-square distribution & hypothesis testing
- pchisq(q, df) — Cumulative probability for the χ² distribution.
- t.test(x, mu = 0) — One-sample t-test against a hypothesised mean.
Correlation & regression
- cor(x, y) — Strength of a linear relationship, −1 to +1.
- lm(y ~ x) — Fits a least-squares straight line through the points.
Descriptive statistics
- mean(x) — The arithmetic average.
- median(x) — The middle value of the data.
- sd(x) — Standard deviation; typical distance of a value from the mean.
- var(x) — Variance; the mean squared deviation from the mean.
- IQR(x) — Span of the middle 50% of the data.
- range(x) — The minimum and maximum values.
- quantile(x) — Sample quantiles that split the data into equal slices.
- summary(x) — The five-number summary plus the mean.
- weighted.mean(x, w) — An average where each value carries a weight.
Combinatorics, sampling & visualisation
- factorial(x) — x!, the ways to arrange x distinct items in order.
- choose(n, k) — Ways to choose k items from n, order ignored.
- sample(x, size, replace = FALSE) — Draw a random sample.
- hist(x, breaks) — A frequency histogram of the data.
- boxplot(x) — A box-and-whisker summary of the spread.