IQR: The Interquartile Range

Description Usage Arguments Details References See Also Examples

Description

computes interquartile range of the x values.

Usage

1
IQR(x, na.rm = FALSE, type = 7)

Arguments

x

a numeric vector.

na.rm

logical. Should missing values be removed?

type

an integer selecting one of the many quantile algorithms, see quantile.

Details

Note that this function computes the quartiles using the quantile function rather than following Tukey's recommendations, i.e., IQR(x) = quantile(x, 3/4) - quantile(x, 1/4).

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.

References

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

See Also

fivenum, mad which is more robust, range, quantile.

Examples

1

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.