Quantile Plot Explorer

A Q-Q (or P-P) plot of a sample against normal, exponential or uniform quantiles with a reference line: the learner switches samples and reference laws, draws fresh samples to see chance wiggle, drags points, and reads the plot correlation and Shapiro-Wilk W; a grid mode shows several shapes side by side with hidden answers.

Used in: Introduction to Statistics

Props

PropTypeDefaultDescription
titlestring"<Reference> Q-Q plot"Card title.
truthstring | {family, params} | {truth, label, location, scale, tag}"normal"Law the sample is drawn from. A named shape (normal, right-skewed, left-skewed, heavy-tailed, light-tailed, bimodal, normal-mixture, exponential, uniform, t3, gamma-shape-3, lognormal, u-shaped, discrete, outlier) or any distribution spec the sampling core accepts ("Exp(rate=2)", "t3", {family: "gamma", params: {shape: 2}}). The object form adds a picker/panel label, an affine change x = location + scale * draw, and a tag (e.g. "NOT NORMAL") written inside its panel.
truths(truth)[][truth]Samples the learner can switch between (Sample dropdown), or the panels of the grid layout. Each entry has the same forms as `truth`.
datanumber[]nullFixed data to plot (at least 2 values). Shown first as the sample "Data" (name it with dataLabel); `truths` may add drawn comparison samples.
dataLabelstring"Data"Name of the fixed data in the picker / panel title (plain text).
nnumber30Size of each drawn sample (3-500). Ignored for fixed data.
seednumber | string7Seed of the random samples; New sample draws the next stream.
referencestring"normal"Reference law whose quantiles go on the x-axis: normal (Phi^{-1}(p)), exponential (-ln(1-p)) or uniform (p), each standardized.
referencesstring[]["normal","exponential","uniform"]References the learner may switch between (toggle shown when 2 or more). ["normal"] hides the toggle.
plotstring"qq"qq: ordered data x_(i) against reference quantiles; pp: fitted cdf at x_(i) against p_i (reference line y = x).
linestring"quartile"Reference line on a Q-Q plot: quartile (R's qqline, through the data and reference quartiles), fit (least squares), origin (least squares through 0, e.g. exponential), identity (y = x) or none. origin falls back to fit when the reference is not exponential.
plottingPositionstring"(i-0.5)/n"Plotting positions p_i: (i-0.5)/n, i/(n+1), (i-0.375)/(n+0.25) (Blom) or ppoints (R's qqnorm: a = 3/8 for n <= 10, else 1/2).
layoutstring"single"single: one sample with picker, readouts and table; grid: every truth as a small panel side by side (the learner can switch with the One/All toggle).
columnsnumber3Grid columns from wide screens (2 or 3); 1 on phones.
hideLabelsbooleanfalseGrid: hide each panel's label and tag behind a Reveal button so learners judge the shapes first.
parameters{name, min, max, initial, step?}[][]Location / scale sliders (names mu|location and sigma|scale) applied to the drawn sample, x = mu + sigma * draw; the true line mu + sigma q is drawn dashed and the axes stay fixed.
showBandbooleanfalseStart with the pointwise 95% band (from the Beta(i, n-i+1) law of the i-th order statistic, scaled by the reference line) switched on.
showTablebooleanfalseStart with the table of i, x_(i), p_i and the reference quantile shown (n <= 100).
showCorrelationbooleantrueShow the plot correlation r of the points (q_i, x_(i)).
showWbooleanfalseShow the Shapiro-Wilk W and its p-value (Royston's approximation, as R and scipy).
logTogglebooleanfalseOffer a Take logs switch (positive data only) to plot ln x.
logbooleanfalseStart with logs taken (ln x; positive data only). Shows the Take logs switch.
editablebooleanfalseSingle Q-Q plot with n <= 40: each point can be dragged up or down to change that observation (make an outlier, bend a tail).
showNSliderbooleantrueShow the sample-size slider for drawn samples.
xLabelstring"Theoretical quantiles"x-axis title ($...$ TeX allowed).
yLabelstring"Sample quantiles"y-axis title ($...$ TeX allowed).
controlsstring[]all controls shownRegistry ids of the hideable readouts, toggles and legend words to show (see `controls` in this file); core ones always show. Absent = everything. Fitted per page by component_scopes.py, not by hand; e.g. the plot correlation r stays hidden before correlation is taught, and a fit line is called "fitted line" before least squares.