IQrange {MKmisc} | R Documentation |
computes interquartile range of the x
values.
IQrange(x, na.rm = FALSE, type = 7)
x |
a numeric vector. |
na.rm |
logical. Should missing values be removed? |
type |
an integer between 1 and 9 selecting one of nine quantile
algorithms; for more details see quantile . |
This function computes quartiles as IQR(x) = quantile(x,3/4) - quantile(x,1/4)
.
In contrast to IQR
the argument type
is added and
can be used to select between different algorithms for the computation
of quantiles. The default type = 7
corresponds to the setting used
in case of IQR
.
For normally N(m,1) distributed X, the expected value of
IQR(X)
is 2*qnorm(3/4) = 1.3490
, i.e., for a normal-consistent
estimate of the standard deviation, use IQR(x) / 1.349
.
Matthias Kohl Matthias.Kohl@stamats.de
Tukey, J. W. (1977). Exploratory Data Analysis. Reading: Addison-Wesley.
IQrange(rivers) ## identical to IQR(rivers) ## but, e.g. IQrange(rivers, type = 4) IQrange(rivers, type = 5)