Empirical Rule Bands

A histogram of a simulated or given data set with shaded bands x̄ ± s, ± 2s, ± 3s and the observed share inside each, set against 68%, 95% and 99.7%. The learner switches the shape (bell, skewed, bimodal, ...), grows n and redraws to see the rule hold for bell-shaped data and fail for other shapes; a Curve view shows the rule as areas under the normal curve, as on the classic slide.

Used in: Introduction to Statistics

Props

PropTypeDefaultDescription
controlsstring[]all controls shownIds of the hideable controls and text blocks to show (see the controls registry, e.g. readout.rule, legend.normal-curve, toggle.view). Core controls always show. Page building fills this from the subject's topic scope; without readout.rule a page shows the shares inside each band but no comparison with 68%, 95%, 99.7%.
titlestringThe empirical rule: 68, 95, 99.7Card title.
viewstringsampleStarting view: 'sample' (histogram of the data with its bands and observed shares) or 'curve' (a normal curve with mean ± k sd lines and double-headed arrows labelled with the areas, like the classic slide).
allowViewSwitchbooleantrueShow the Sample / Curve switch in the title bar.
familystringnormalPopulation shape of the simulated sample: normal (bell), skewed (exponential, right tail), left-skewed, bimodal (two separated bells), uniform (flat) or heavy-tailed (t, 3 df). Ignored when `data` is given.
compareShapesstring[]["skewed", "bimodal"]Further shapes the learner can switch to (same names as `family`). [] hides the shape switch.
datanumber[](none)A data set to show instead of a simulated sample (at least 2 values). The shape switch then offers it first, labelled `dataLabel`.
dataLabelstringDataName of `data` in the shape switch.
nnumber500Size of the simulated sample (10 to 5000).
nSliderbooleantrueShow the n slider (simulated samples only); larger n keeps the earlier values and adds more.
seednumber | string1Seed of the simulated sample (same seed, same sample). 'New sample' moves on from it.
meannumber50 (simulated) / x̄ of dataPopulation mean of simulated samples; in the curve view, the centre of the curve.
sdnumber10 (simulated) / s of dataPopulation standard deviation of simulated samples; in the curve view, the spread of the curve.
showBandsnumber[][1, 2, 3]Which bands (k = 1, 2, 3) start shown; the learner can toggle each.
axisLabelsstringvalues (sample view) / sample (curve view)Tick labels at mean + k sd: 'values' (numbers), 'sample' (x̄ − 2s, ...), 'population' (μ − 2σ, ...), 'words' (mean −2s, as on the slide) or 'z' (−2, ..., 2). Narrow screens stagger or shorten them.
percentLabelsstringruleCurve view arrow labels: 'rule' (68%, 95%, 99.7%) or 'exact' (68.27%, 95.45%, 99.73%).
shadebooleantrueShade the nested bands.
showCurvebooleantrueSample view: overlay the normal curve with the sample's x̄ and s, scaled to the bins.
showTablebooleantrueShow the table of bands (interval, share inside, rule).
showPopulationbooleanfalseSample view: add a column with the population share within k sd for the chosen shape (e.g. 86.5% within 1 sd for the skewed shape).
showKSliderbooleanfalseAdd a k slider and a green band x̄ ± ks with its share and the normal area 2Φ(k) − 1.
knumber1.5Starting k of the slider band (0.25 to 4).
showChebyshevbooleanfalseAdd a column with Chebyshev's lower bound 1 − 1/k², which holds for every shape.
xLabelstring(none)Axis title ($...$ TeX allowed), e.g. 'check amount ($)'.
digitsnumberfrom the scale of the sdDecimal places of interval endpoints, x̄ and s.