Returns a quantile-based four-number summary of the input data
fournum(x, na.rm = TRUE, ...)
a vector of length four containing the median, the quartile deviation,
the Galton-Bowley measure and the Moors measure. However,
if x
does not contain at least 8 values (after removing NA
s),
rep(NA,4)
is returned.
a numeric vector, maybe including NA
s and +/-Inf
's.
At least 8 not-NA
values are required.
It works with objects which can be coerced to vector.
logical;
if TRUE
, all NA
and NaN
s are dropped,
before the statistics are computed.
optional arguments passed to quantile
Adelchi Azzalini
Function quantile
is used to compute 7 octiles of x
,
that is, quantiles of level (1:7)/8
, denoted oct[1:7]
,
and derive four summary quantities:
the median, which corresponds to oct[4]
,
the ‘(coefficient of) quartile deviation’
or semi-interquantile range: (oct[6] - oct[2])/2
;
the Galton-Bowley measure of asymmetry, that is, skewness:
(oct[6] - 2 * oct[4] + oct[2])/(oct[6] - oct[2])
;
the Moors measure of kurtosis:
(oct[7] - oct[5] + oct[3] - oct[1])/(oct[6] - oct[2])
The term ‘coefficient of quartile deviation’ is adopted from the Encyclopedia of Statistical Sciences; see the references below. What is called Galton-Bowley measure here is often named ‘Bowley's measure’, but some sources attribute it to Francis Galton. For the Moors measure, see Moors (1988).
‘Quartile deviation, coefficient of’, in: Encyclopedia of Statistical Sciences, 2nd edition (2006). Editors: Samuel Kotz (Editor-in-Chief), Campbell B. Read, N. Balakrishnan, Brani Vidakovic. Volume 10, p.6743.
‘Skewness, Bowleys's measures of’, in: Encyclopedia of Statistical Sciences, 2nd edition (2006). Editors: Samuel Kotz (Editor-in-Chief), Campbell B. Read, N. Balakrishnan, Brani Vidakovic. Volume 12, p.7771-7773.
Moors, J.J.A. (1988). A quantile alternative for kurtosis. Source: Journal of the Royal Statistical Society. Series D (The Statistician), Vol. 37, pp. 25-32