statistics
Import it with :statistics, then call its constructs under that name.


@use:statistics#Constructs
statistics.normalThe normal density , drawn across four standard deviations either side of the mean.


muThe distribution's mean .
Default
0sigmaThe distribution's standard deviation .
Default
1colourThe curve's colour.
paintDefault
bluestatistics.standard-normalThe standard normal — the density every other normal is a shift and a stretch of. It is
normal with its parameters fixed, called the way you would call it yourself: inside the pack its own constructs are named without the pack prefix.

colourThe curve's colour.
paintDefault
bluestatistics.normal-areaA normal density with the probability between two points shaded, and the bounds marked on the axis. The curve it shades is named inside the template, so two uses in one graph never collide (D36) and the caller supplies no id.


muThe distribution's mean .
Default
0sigmaThe distribution's standard deviation .
Default
1fromThe shaded region's lower bound.
toThe shaded region's upper bound.
show-valuePrint the area on the shading itself, as a textbook diagram does. Off by default: the number is always available to prose through the call's id, and a figure that states it as well is a choice about that figure.
boolDefault
falsecolourThe curve, the shaded region and the two bound labels' colour.
paintDefault
bluestatistics.mean-markerA vertical line at the mean, labelled .


muThe mean the line is drawn at.
Default
0colourThe line's colour.
paintDefault
tealstatistics.deviation-markersVertical lines one standard deviation either side of the mean.


muThe distribution's mean.
Default
0sigmaThe distribution's standard deviation, one either side of the mean.
Default
1colourBoth lines' colour.
paintDefault
greystatistics.z-pointA point sitting on a normal curve, labelled with its z-score.
x and z are both supplied because a template cannot compute one from the other: substitution splices text and the value folds parse literals rather than evaluating arithmetic. Writing out is the honest form until the language grows expression abstraction.

xThe point's position along the axis.
zThe point's z-score, written out since a template cannot compute it from
x and mu.muThe curve's mean, for the height the point sits at.
Default
0sigmaThe curve's standard deviation, for the height the point sits at.
Default
1colourThe point's colour.
paintDefault
orangestatistics.uniformThe continuous uniform density on .


aThe support's lower bound.
Default
0bThe support's upper bound.
Default
1colourThe curve's colour.
paintDefault
tealstatistics.exponentialThe exponential density with rate .


lambdaThe distribution's rate .
Default
1toWhere the curve stops being drawn.
Also written:
domain-maxDefault
6colourThe curve's colour.
paintDefault
orangestatistics.laplaceThe Laplace density with location and scale .


muThe distribution's location .
Default
0bThe distribution's scale .
Default
1colourThe curve's colour.
paintDefault
purplestatistics.logisticThe logistic density with location and scale .


muThe distribution's location .
Default
0sThe distribution's scale .
Default
1colourThe curve's colour.
paintDefault
greenstatistics.cauchyThe Cauchy density with location and scale — heavy enough in the tails that it has no mean, which is why it is drawn ten scales wide.


centreThe distribution's location .
Also written:
x0Default
0gammaThe distribution's scale .
Default
1colourThe curve's colour.
paintDefault
redstatistics.tStudent's with degrees of freedom — the normal's heavier-tailed cousin, which is what a small sample's mean actually follows.


nuThe degrees of freedom .
Also written:
dfDefault
5toHow far either side of zero the curve is drawn.
Default
4colourThe curve's colour.
paintDefault
purplestatistics.chi-squaredThe chi-squared density with degrees of freedom. Drawn from just above zero: at the density is infinite for and the curve would have nowhere to start.


kThe degrees of freedom .
Also written:
dfDefault
3fromWhere the curve starts being drawn, just above zero.
Default
0.05toWhere the curve stops being drawn.
Default
15colourThe curve's colour.
paintDefault
greenstatistics.f-distributionThe density with and degrees of freedom — the ratio of two scaled chi-squareds, and so what a variance ratio follows.


d1The numerator's degrees of freedom .
Default
5d2The denominator's degrees of freedom .
Default
10fromWhere the curve starts being drawn, just above zero.
Default
0.05toWhere the curve stops being drawn.
Default
5colourThe curve's colour.
paintDefault
orangestatistics.gammaThe gamma density with shape and rate , — the exponential is shape , and the chi-squared shape at rate . Drawn from just above zero, as
chi-squared is: below shape the density is infinite at .

shapeThe distribution's shape .
Also written:
alphaDefault
2rateThe distribution's rate , the reciprocal of its scale.
Default
1fromWhere the curve starts being drawn, just above zero.
Default
0.01toWhere the curve stops being drawn.
Default
10colourThe curve's colour.
paintDefault
tealstatistics.betaThe beta density on , — the conjugate prior for a probability, and the posterior it updates to. Drawn from just inside each end: below or the density is infinite there.


aThe first shape parameter — the prior's successes, plus one.
Default
2bThe second shape parameter — the prior's failures, plus one.
Default
5colourThe curve's colour.
paintDefault
purplestatistics.weibullThe Weibull distribution with shape and scale , as its density, its hazard or its survival function . The shape decides the hazard's direction: falling below , constant at (the exponential), rising above it. Drawn from just above zero: below shape the density and the hazard are infinite at .


shapeThe distribution's shape .
Also written:
kDefault
1.5scaleThe distribution's scale .
Also written:
lambdaDefault
1showWhich function of the distribution is drawn.
enumDefault
densityfromWhere the curve starts being drawn, just above zero.
Default
0.01toWhere the curve stops being drawn.
Default
3colourThe curve's colour.
paintDefault
orangestatistics.gompertzThe Gompertz law of mortality, a hazard growing exponentially with age, : drawn as its density, its hazard or its survival function . The defaults are a human lifetime in years.


bThe hazard at age zero, .
Default
0.0003cThe factor the hazard grows by each unit of age, , above .
Default
1.07showWhich function of the distribution is drawn.
enumDefault
densitytoWhere the curve stops being drawn.
Default
110colourThe curve's colour.
paintDefault
redstatistics.normal-cdfThe normal's cumulative distribution — the probability of landing at or below , which is the shaded area of
normal read off as a height.

muThe underlying normal's mean .
Default
0sigmaThe underlying normal's standard deviation .
Default
1colourThe curve's colour.
paintDefault
bluestatistics.exponential-cdfThe exponential's cumulative distribution, .


lambdaThe underlying exponential's rate .
Default
1toWhere the curve stops being drawn.
Default
6colourThe curve's colour.
paintDefault
orangestatistics.uniform-cdfThe uniform's cumulative distribution — the straight line every other CDF is measured against.


aThe underlying uniform's lower bound.
Default
0bThe underlying uniform's upper bound.
Default
1colourThe curve's colour.
paintDefault
tealstatistics.logistic-cdfThe logistic's cumulative distribution — the sigmoid, which is this and nothing more.


muThe underlying logistic's location .
Default
0sThe underlying logistic's scale .
Default
1colourThe curve's colour.
paintDefault
greenstatistics.cauchy-cdfThe Cauchy's cumulative distribution, in terms of .


centreThe underlying Cauchy's location .
Also written:
x0Default
0gammaThe underlying Cauchy's scale .
Default
1colourThe curve's colour.
paintDefault
redstatistics.normal-tailOne tail of a normal beyond a critical value — the rejection region of a one-sided test, shaded and marked.
side says which: upper shades above the critical value, lower below it.

atThe critical value the tail is shaded beyond.
sideWhich tail is shaded: above the critical value, or below it.
enumDefault
uppermuThe distribution's mean .
Default
0sigmaThe distribution's standard deviation .
Default
1labelThe critical value's axis label.
inlineDefault
$c$colourThe curve, the shaded tail and the axis label's colour.
paintDefault
redshow-valuePrint the area on the shading itself, as a textbook diagram does. Off by default: the number is always available to prose through the call's id, and a figure that states it as well is a choice about that figure.
boolDefault
falsestatistics.bernoulliThe Bernoulli mass function — one trial, drawn as the two outcomes it has. Like every discrete construct here it is a
lollipop rather than bars: a bar chart stands on a categorical axis, and the support of a distribution is a run of numbers, so the mass sits on a numeric axis like everything else on the plane. A stem claims nothing but the value it stands at, which is what says.

pThe probability of success.
Default
0.5wThe stems' line width.
listAlso written:
widthDefault
2sizeThe stems' dot size.
listDefault
6colourThe stems' colour.
listDefault
bluestatistics.binomialThe binomial mass function — one stem for each from to , generated from the parameters rather than written out. One
lollipop per rather than one holding every : a series is text the compiler reads in one piece, and generates ELEMENTS, so there is no way to fold a loop into an attribute. Each mass is written once either way, which is the part that matters. A stem in highlight and one outside it are two s, one colour each.

nThe number of trials.
Default
10pThe probability of success on each trial.
Default
0.5wThe stems' line width.
listAlso written:
widthDefault
2sizeThe stems' dot size.
listDefault
6colourThe stems' colour.
listDefault
bluehighlightThe values of drawn in
highlight-colour — a tail, or a test's rejection region: ..2 for , 8.. for . The default holds no .Default
..<0highlight-colourThe highlighted stems' colour.
listDefault
redstatistics.poissonThe Poisson mass function . The support is infinite, so
to says where to stop drawing — far enough out that the tail is invisible, not so far that the stems vanish.

lambdaThe distribution's rate .
Default
3toThe highest a stem is drawn for, far enough out that the tail is invisible.
Default
12wThe stems' line width.
listAlso written:
widthDefault
2sizeThe stems' dot size.
listDefault
6colourThe stems' colour.
listDefault
tealhighlightThe values of drawn in
highlight-colour, as binomial takes them.Default
..<0highlight-colourThe highlighted stems' colour.
listDefault
redstatistics.geometricThe geometric mass function — the trial on which the first success arrives, counted from .


pThe probability of success on each trial.
Default
0.35toThe highest a stem is drawn for.
Default
12wThe stems' line width.
listAlso written:
widthDefault
2sizeThe stems' dot size.
listDefault
6colourThe stems' colour.
listDefault
purplehighlightThe values of drawn in
highlight-colour, as binomial takes them.Default
..<0highlight-colourThe highlighted stems' colour.
listDefault
redstatistics.hypergeometricThe hypergeometric mass function — the successes in draws without replacement from items, of them successes. A stem for every from to :
choose is outside its range, so a the population cannot supply stands at zero rather than needing bounds the template could not compute.

populationThe population's size .
Default
20successesThe successes in the population, .
Default
7drawsThe draws taken, .
Default
8wThe stems' line width.
listAlso written:
widthDefault
2sizeThe stems' dot size.
listDefault
6colourThe stems' colour.
listDefault
greenhighlightThe values of drawn in
highlight-colour, as binomial takes them.Default
..<0highlight-colourThe highlighted stems' colour.
listDefault
redstatistics.negative-binomialThe negative binomial mass function — the trial on which the th success arrives, counted as
geometric counts it. The geometric is .

rThe successes waited for, .
Default
3pThe probability of success on each trial.
Default
0.4toThe highest a stem is drawn for.
Default
20wThe stems' line width.
listAlso written:
widthDefault
2sizeThe stems' dot size.
listDefault
6colourThe stems' colour.
listDefault
orangehighlightThe values of drawn in
highlight-colour, as binomial takes them.Default
..<0highlight-colourThe highlighted stems' colour.
listDefault
redstatistics.effect-stripA strip of effects by group: one dot per comparison, a row per outcome, each row swarmed so a dense row reads as dense, and every dot coloured by which side of the baseline it fell on. The baseline is ruled across the plot and each side is named in a band behind the dots. The picture of a set of paired studies — organic against conventional, treatment against control — where what matters is how many land on each side and how far.
values and groups are two columns of one long-format dataset: a row per comparison, its effect in one column and what it measured in the other. The groups go up the y axis as names, so the graph needs no y format: line.

valuesThe effect of each comparison, one per row — a dataset column bound whole.
groupsWhat each comparison measured, one name per row, in the same order as
values.baselineNo difference: where the plot is ruled and where the colours change sides.
Default
0fromThe low end of the band behind the readings below the baseline.
toThe high end of the band behind the readings at or above the baseline.
bandThe share of each row's room the swarm and its box take — one band for both, so a column of tied readings shrinks to stay inside the box.
Default
0.6below-labelWhat a reading below the baseline means, written in its band.
inlineDefault
above-labelWhat a reading at or above the baseline means, written in its band.
inlineDefault
baseline-labelThe baseline's own name, written on the axis where it is ruled.
inlineDefault
belowThe dots below the baseline, and the band below it.
paintDefault
purpleaboveThe dots at or above the baseline, and the band above it.
paintDefault
pinkbox-colourThe boxes' colour, when
boxes draws them.listDefault
greyboxesDraw each row's box over its swarm. The box shares the swarm's place, so it lands on the dots it summarises and leaves its outliers to them.
boolDefault
false