Student[Statistics] - Maple Programming Help

Home : Support : Online Help : Education : Student Packages : Statistics : Student/Statistics/InterquartileRange

Student[Statistics]

 InterquartileRange
 compute the interquartile range

 Calling Sequence InterquartileRange(A, numeric_option,output_option) InterquartileRange(M, numeric_option,output_option) InterquartileRange(X, numeric_option,output_option)

Parameters

 A - M - X - algebraic; random variable numeric_option - (optional) equation of the form numeric=value where value is true or false output_option - (optional) equation of the form output=x where x is value, plot, or both

Description

 • The InterquartileRange function computes the interquartile range of the specified random variable or data sample.
 • The first parameter can be a data sample (e.g., a Vector), a Matrix data sample, a random variable, or an algebraic expression involving random variables (see Student[Statistics][RandomVariable]).
 • If the option output is not included or is specified to be output=value, then the function will return the value of the interquartile range. If output=plot is specified, then the function will return a plot of the input data set and its interquartile range. If output=both is specified, then both the value and the plot of the interquartile range will be returned.

Computation

 • By default, all computations involving random variables are performed symbolically (see option numeric below).
 • The InterquartileRange function computes the interquartile range of the input data set by first computing the first and the third quartile of the data set according to the rule in Student[Statistics][Quartile], and then computing the difference between them as the final answer.
 • To always compute the interquartile range numerically, specify the numeric or numeric=true option.

Examples

 > $\mathrm{with}\left({\mathrm{Student}}_{\mathrm{Statistics}}\right):$

Compute the interquartile range of the exponential distribution with parameter 4. distribution with parameter 4.

 > $\mathrm{InterquartileRange}\left(\mathrm{ExponentialRandomVariable}\left(4\right)\right)$
 ${8}{}{\mathrm{ln}}{}\left({2}\right){+}{4}{}{\mathrm{ln}}{}\left(\frac{{3}}{{4}}\right)$ (1)

Use the output=plot option.

 > $\mathrm{InterquartileRange}\left(\mathrm{ExponentialRandomVariable}\left(4\right),\mathrm{output}=\mathrm{plot}\right)$ > $A≔⟨-1,\mathrm{Pi},\mathrm{ln}\left(32\right),51⟩$
 $\left[\begin{array}{c}-1\\ \mathrm{π}\\ 5{}\mathrm{ln}{}\left(2\right)\\ 51\end{array}\right]$ (2)
 > $\mathrm{InterquartileRange}\left(A\right)$
 ${5}{}{\mathrm{ln}}{}\left({2}\right){+}{1}$ (3)

Use numeric option.

 > $\mathrm{InterquartileRange}\left(A,\mathrm{numeric}\right)$
 ${4.46573590279973}$ (4)

Consider the following Matrix data sample.

 > $M≔\mathrm{Matrix}\left(\left[\left[3,16.0,\mathrm{Pi}\right],\left[4.0,17,18\right],\left[\frac{19}{6},\sqrt{5},-3\right],\left[2,88,-8\right],\left[4,1,0\right]\right]\right)$
 $\left[\begin{array}{ccc}3& 16.0& \mathrm{π}\\ 4.0& 17& 18\\ \frac{19}{6}& \sqrt{5}& -3\\ 2& 88& -8\\ 4& 1& 0\end{array}\right]$ (5)

We compute the interquartile range of each of the columns.

 > $\mathrm{InterquartileRange}\left(M\right)$
 $\left[\begin{array}{ccc}1.0& 17-\sqrt{5}& \mathrm{π}+3\end{array}\right]$ (6)

Use the output=both option.

 > $\mathrm{interquartilerange},\mathrm{graph}≔\mathrm{InterquartileRange}\left(M,\mathrm{output}=\mathrm{both}\right)$
 ${\mathrm{interquartilerange}}{,}{\mathrm{graph}}{≔}\left[\begin{array}{ccc}{1.}& {17}{-}\sqrt{{5}}& {\mathrm{\pi }}{+}{3}\end{array}\right]{,}{}$ (7)
 > $\mathrm{interquartilerange}$
 $\left[\begin{array}{ccc}1.0& 17-\sqrt{5}& \mathrm{π}+3\end{array}\right]$ (8)
 > $\mathrm{graph}$   > 

References

 Stuart, Alan, and Ord, Keith. Kendall's Advanced Theory of Statistics. 6th ed. London: Edward Arnold, 1998. Vol. 1: Distribution Theory.

Compatibility

 • The Student[Statistics][InterquartileRange] command was introduced in Maple 18.
 • For more information on Maple 18 changes, see Updates in Maple 18.