Confidence Interval Coverage Simulator

The learner draws many samples and sees each one's interval stacked against the true value, with a running coverage count and its Monte Carlo error; procedures (z, t, bootstrap, signed-rank, chi-squared, Wald/Wilson/exact, prediction, tolerance) can be compared on the same samples, with sliders for n, level and p and an exact coverage-versus-p curve for proportions.

Used in: Introduction to Statistics

Props

PropTypeDefaultDescription
titlestring—Title bar text. Default depends on the procedures.
populationstring | object{"family": "normal", "params": {"mean": 50, "sd": 12}}Population every sample is drawn from: any distribution spec the sampling core parses ("N(50, 144)", "exponential", {family, params}, a mixture). For proportion procedures only its p (and binomial n) is read.
populationsarray—Several populations (specs, each optionally with a "label") the learner picks from; overrides population.
procedurestring"t"Interval procedure: z, t, z-with-s, bootstrap-percentile, signed-rank, chi-squared-variance, prediction, tolerance, wald, wilson, wilson-cc, agresti-coull, clopper-pearson, jeffreys. prediction targets one new observation; tolerance must contain a proportion `content` of the population.
proceduresstring[]—Up to 4 procedures shown side by side on the SAME samples (all continuous-data or all proportion); overrides procedure.
statisticstring"mean"Statistic the bootstrap-percentile interval is built for (mean or median); its target follows.
levelnumber0.95Confidence level 1 − α (for tolerance: the confidence γ).
contentnumber0.9Tolerance interval content P (the population proportion it must contain).
nnumber10Sample size (proportion procedures: number of trials; default 20).
nValuesnumber[]—Sample sizes the learner switches between (toggle above the plots).
pnumber0.3True proportion for proportion procedures.
parametersarray—Sliders [{name, min, max, initial, step?, label?}] for name in n, level, p, content.
replicatesnumber40Number of samples drawn on load (the learner draws more; capped by a work budget).
maxRowsnumber50Most recent intervals drawn as rows (coverage counts every sample).
viewstring"intervals"intervals (stacked repeated intervals) or coverage-curve (exact coverage against the true p; proportion procedures only).
pRange[number, number][0.01, 0.99]Range of p on the coverage curve.
showSuccessFailurebooleanfalseShade where np ≥ 10 and n(1 − p) ≥ 10 on the coverage curve.
bootstrapBnumber400Bootstrap resamples per interval.
showSamplebooleantrueShow the latest sample, its intervals and (bootstrap) its resampling histogram.
seednumber | string1Seed of the simulation (same seed, same samples).
controlsstring[]all controls shownIds of the hideable readouts and toggles to show (see the controls registry: readout.mc-se, readout.miss-rate, readout.exact-coverage, view.coverage-curve). Core controls always show. Page building fills this from the subject's topic scope.