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
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | — | Title bar text. Default names the test(s). |
| test | string | "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. |
| tests | string[] | — | 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. |
| population | string | 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. |
| populations | array | — | Parents the learner picks from (specs, optionally with a "label"); the first is shown first. Overrides population and the built-in menu. |
| groups | number | array | — | Number of groups k, or one object per group {n, sd, label}. Groups designs default to 2 (two-sample tests) or 3 groups. |
| n | number | number[] | 10 | Sample size per group (a number for all groups, or one per group). Proportion tests: trials per group (default 20, at most 300). |
| sigmas | number[] | — | True standard deviation of each group (default all 1). |
| rho | number | 0 | Correlation between observations in the same group (pseudoreplication); groups designs only. |
| p | number | 0.3 | Common success probability of both groups (proportion tests). |
| effect | number | 0 | Effect 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. |
| hypothesis | string | "null" | Which hypothesis is true at the start: null or alternative. |
| alpha | number | 0.05 | Nominal significance level. |
| alternative | string | "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). |
| parameters | array | — | 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. |
| replications | number | 2000 | Data sets simulated on load (the learner adds more; capped by a work budget, at most 40,000). |
| view | string | "statistic" | statistic (histogram vs the claimed law with the rejection region), p-values (histogram vs Uniform(0,1)) or curve (rejection rate against curveParameter). |
| curveParameter | string | — | 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. |
| showAsymptotic | boolean | false | Also 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). |
| showMeanSquares | boolean | true for one-way-anova-f | Show the simulated average of MS_Tr and MS_E beside their expectations under the simulated model (groups designs). |
| showSample | boolean | true | Show the latest simulated data set with each test's statistic, p-value and decision. |
| seed | number | string | 1 | Seed of the simulation (same seed, same data sets). |
| controls | string[] | all controls shown | Registry 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. |
PreviousNext