Null Distribution Simulator

The learner simulates thousands of data sets with the null hypothesis true and sees the test statistic's histogram against its claimed null law (t, F, chi-squared, normal, Kolmogorov) with the rejection region shaded, and the actual rejection rate against the nominal alpha; switching the parent distribution, group sizes and sds, within-group correlation or an effect slider shows when a test keeps its level, and level or power curves sweep a parameter.

Used in: Introduction to Statistics

Props

PropTypeDefaultDescription
titlestring—Title bar text. Default names the test(s).
teststring"one-sample-t"The test whose statistic is simulated under the null: one-sample-t, signed-rank, chi-squared-variance, ks-normal, ks-normal-estimated, pooled-t, welch-t, rank-sum, variance-ratio-f, one-way-anova-f, kruskal-wallis, bartlett, levene, brown-forsythe, pooled-two-proportion-z, fisher-exact. Common aliases (anova, welch, fisher, mann-whitney, lilliefors...) are accepted.
testsstring[]—Up to 3 tests computed on the SAME simulated data sets and shown side by side (all must take the same kind of data: one sample, independent groups, or two binomial counts); overrides test.
populationstring | object"normal"Parent distribution of the errors (any spec the sampling core parses: "exponential", "t5", "laplace", {family, params}); it is standardised to mean 0, sd 1 and scaled by each group's sd. The learner can switch to a built-in menu of other parents.
populationsarray—Parents the learner picks from (specs, optionally with a "label"); the first is shown first. Overrides population and the built-in menu.
groupsnumber | array—Number of groups k, or one object per group {n, sd, label}. Groups designs default to 2 (two-sample tests) or 3 groups.
nnumber | number[]10Sample size per group (a number for all groups, or one per group). Proportion tests: trials per group (default 20, at most 300).
sigmasnumber[]—True standard deviation of each group (default all 1).
rhonumber0Correlation between observations in the same group (pseudoreplication); groups designs only.
pnumber0.3Common success probability of both groups (proportion tests).
effectnumber0Effect under H1, shown when the learner switches to H1: location tests shift group 1's mean by effect × σ₁; variance tests multiply σ₁ by 1 + effect; proportion tests set p₁ = p + effect. A nonzero effect (or an effect slider) shows the H0/H1 toggle.
hypothesisstring"null"Which hypothesis is true at the start: null or alternative.
alphanumber0.05Nominal significance level.
alternativestring"two-sided"two-sided, less or greater, for the t, rank, z and Fisher tests (the F, chi-squared, KS and ANOVA-type tests use their usual rejection regions).
parametersarray—Sliders [{name, min, max, initial, step?, label?}] for name in n, n1..n8, sigma1..sigma8, sigmaRatio (σ₁/σ₂), rho (alias withinGroupCorrelation), p, effect, alpha; any other name is a symbol in the population spec.
replicationsnumber2000Data sets simulated on load (the learner adds more; capped by a work budget, at most 40,000).
viewstring"statistic"statistic (histogram vs the claimed law with the rejection region), p-values (histogram vs Uniform(0,1)) or curve (rejection rate against curveParameter).
curveParameterstring—Parameter swept by the curve view (n, n1.., p, rho, effect, sigmaRatio, alpha or a slider name). Default: the first slider, else p for proportion tests, else n. Proportion tests give exact curves; effect gives a power curve.
showAsymptoticbooleanfalseAlso draw the law the statistic approaches for large samples under this parent (normal for t; χ²/(k−1) for ANOVA F; the kurtosis-corrected laws for the variance-ratio, chi-squared-variance and Bartlett tests).
showMeanSquaresbooleantrue for one-way-anova-fShow the simulated average of MS_Tr and MS_E beside their expectations under the simulated model (groups designs).
showSamplebooleantrueShow the latest simulated data set with each test's statistic, p-value and decision.
seednumber | string1Seed of the simulation (same seed, same data sets).
controlsstring[]all controls shownRegistry ids of the view tabs, rejection region, rate readouts and panels to show (core ones always show). Absent shows everything. Fitted by tooling from the props and what the lecture has taught; authors do not pick it by hand.