\Header{IQR}{The Interquartile Range}
\keyword{univar}{IQR}
\keyword{robust}{IQR}
\keyword{distribution}{IQR}
\begin{Description}\relax
computes interquartile range of the \code{x} values.
\end{Description}
\begin{Usage}
\begin{verbatim}
IQR(x, na.rm = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a numeric vector.
\item[\code{na.rm}] logical. Should missing values be removed?
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Note that this function computes the quartiles using the
\code{\Link{quantile}} function rather than following
Tukey's recommendations,
i.e., \code{IQR(x) = quantile(x,3/4) - quantile(x,1/4)}.

For normally \eqn{N(m,1)}{} distributed \eqn{X}{}, the expected value of
\code{IQR(X)} is \code{2*qnorm(3/4) = 1.3490}, i.e., for a normal-consistent
estimate of the standard deviation, use \code{IQR(x) / 1.349}.
\end{Details}
\begin{References}\relax
Tukey, J. W. (1977).
\emph{Exploratory Data Analysis.}
Reading: Addison-Wesley.
\end{References}
\begin{SeeAlso}\relax
\code{\Link{fivenum}}, \code{\Link{mad}} which is more robust,
\code{\Link{range}}, \code{\Link{quantile}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
data(rivers)
IQR(rivers)
\end{ExampleCode}
\end{Examples}

