qqplot(x, y; kwargs...)
Draw a Q-Q plot, comparing quantiles of two distributions.
y must be a list of samples, i.e.,
x can be
a list of samples,
an abstract distribution, e.g.
a distribution type, e.g.
In the last case, the distribution type is fitted to the data
qqline (defaults to
:none) determines how to compute a fit line for the Q-Q plot. Possible values are the following.
:identitydraws the identity line.
:fitcomputes a least squares line fit of the quantile pairs.
:fitrobustcomputes the line that passes through the first and third quartiles of the distributions.
:noneomits drawing the line.
qqline = :identity is useful to see if
y follow the same distribution, whereas
qqline = :fit and
qqline = :fitrobust are useful to see if the distribution of
y can be obtained from the distribution of
x via an affine transformation.
Graphical attributes are
colorto control color of both line and markers (if
markercoloris not specified)
qqplot(Normal(0,1), y), i.e., draw a Q-Q plot of
y against the standard normal distribution. See
qqplot for more details.
ys follow the same distribution.
using CairoMakie xs = randn(100) ys = randn(100) qqplot(xs, ys, qqline = :identity)
ys is normally distributed.
using CairoMakie ys = 2 .* randn(100) .+ 3 qqnorm(ys, qqline = :fitrobust)