IQrange {MKmisc}R Documentation

The Interquartile Range

Description

computes interquartile range of the x values.

Usage

IQrange(x, na.rm = FALSE, type = 7)

Arguments

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.

Details

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.

Author(s)

Matthias Kohl Matthias.Kohl@stamats.de

References

Tukey, J. W. (1977). Exploratory Data Analysis. Reading: Addison-Wesley.

See Also

quantile, IQR.

Examples

IQrange(rivers)

## identical to
IQR(rivers)

## but, e.g.
IQrange(rivers, type = 4)
IQrange(rivers, type = 5)

[Package MKmisc version 0.3 Index]