InterquartileRange
✖
InterquartileRange

gives the difference between the upper and lower quartiles for the elements in data.
uses the quantile definition specified by parameters a, b, c, d.
gives the difference between the upper and lower quartiles for the distribution dist.
Details




- InterquartileRange is also known as IQR.
- InterquartileRange is a robust measure of dispersion, which means it is not very sensitive to outliers.
- InterquartileRange[data] is given by
, where
is given by Quartiles[data]. »
- For MatrixQ data, the interquartile range is computed for each column vector with InterquartileRange[{{x1,y1,…},{x2,y2,…},…}], equivalent to {InterquartileRange[{x1,x2,…}],InterquartileRange[{y1,y2,…}]}. »
- For ArrayQ data, the interquartile range is equivalent to ArrayReduce[InterquartileRange,data,1]. »
- InterquartileRange[data,{{a,b},{c,d}}] uses the Quartiles definition specified by parameters a, b, c, d. »
- Common choices of parameters {{a,b},{c,d}} include:
-
{{0, 0}, {1, 0}} inverse empirical CDF {{0, 0}, {0, 1}} linear interpolation (California method) {{1/2, 0}, {0, 0}} element numbered closest to p n {{1/2, 0}, {0, 1}} linear interpolation (hydrologist method; default) {{0, 1}, {0, 1}} mean‐based estimate (Weibull method) {{1, -1}, {0, 1}} mode‐based estimate {{1/3, 1/3}, {0, 1}} median‐based estimate {{3/8, 1/4}, {0, 1}} normal distribution estimate - The default choice of parameters is {{1/2,0},{0,1}}. »
- The data can have the following additional forms and interpretations:
-
Association the values (the keys are ignored) » SparseArray as an array, equivalent to Normal[data] » QuantityArray quantities as an array » WeightedData based on the underlying EmpiricalDistribution » EventData based on the underlying SurvivalDistribution » TimeSeries, TemporalData, … vector or array of values (the time stamps ignored) » Image,Image3D RGB channel's values or grayscale intensity value » Audio amplitude values of all channels » DateObject, TimeObject list of dates or list of times » - InterquartileRange[dist] is given by
, where
is given by Quartiles[dist]. »
- For a random process proc, the interquartile range function can be computed for a slice distribution at time t, SliceDistribution[proc,t], as InterquartileRange[SliceDistribution[proc,t]]. »





Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Interquartile range for a list of exact numbers:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-cho

Interquartile range for a list of dates:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-t7ech


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-ziof1v

Interquartile range of a parametric distribution:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-b133z2

Scope (22)Survey of the scope of standard use cases
Basic Uses (8)
Exact input yields exact output:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-ug7y2


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-bcry2t

Approximate input yields approximate output:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-cg1nsz


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-dvod55

Compute results using other parametrizations:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-dl6aeg


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-b8keb3

Find the interquartile range for WeightedData:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-d0wc9z


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-f1vfw

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-qyv0h

Find the interquartile range for EventData:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-e67u14

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-or2nrz

Find the interquartile range for TemporalData:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-gx0rsr

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-f5ij1t

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-8e999

Find the interquartile range of TimeSeries:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-iqmjm1

The interquartile range depends only on the values:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-i4d98s

Find the interquartile range for data involving quantities:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-jopin9


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-e8c21s

Array Data (5)
InterquartileRange for a matrix gives columnwise ranges:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-eymwwi

Interquartile range for a tensor works across the first index:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-lw96ov


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-nknun


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-ma3v2m

When the input is an Association, InterquartileRange works on its values:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-cs7n5q


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-xmyxp8

SparseArray data can be used just like dense arrays:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-f5ekjj


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-c4gal2

Find interquartile range of a QuantityArray:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-lgwnaj


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-k03qc6

Image and Audio Data (2)
Channelwise interquartile range values of an RGB image:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-hfby9q

Interquartile range intensity value of a grayscale image:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-ue2gq5

Interquartile range amplitude of all channels:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-nq1jnz


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-bs38vd

Date and Time (4)
Compute interquartile range of dates:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-b1smxx

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-pa4nmn


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-uok1il


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-baj2x3

Compute the weighted interquartile range of dates:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-c98kbd


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-8c1had

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-t71b2h

Compare the simple interquartile range:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-w3hn8w


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-3rxtf0

Compute the interquartile range of dates given in different calendars:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-wbzcuv


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-9ius88


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-qe5gbw

Compute the interquartile range of times:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-et9bla


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-ztsexm

List of times with different time zone specifications:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-mrqghz


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-1d7sk5

Distributions and Processes (3)
Find the interquartile range for a parametric distribution:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-hbq28j

Interquartile range for a derived distribution:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-rgc72x


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-215ry

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-fq5ptk

Interquartile range for a time slice of a random process:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-c4ojmv

Applications (6)Sample problems that can be solved with this function
InterquartileRange indicates the spread of values:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-cmvg05

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-b7qo6

InterquartileRange can be used as a check for agreement between data and a distribution:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-6i89hv

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-yyz1hn
Find the interquartile range of the data:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-pfpq4z

Compare with the interquartile range of the distribution:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-6v20t1


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-upwvgd

Identify periods of high volatility in stock data using an annual moving interquartile range:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-0tl2ek

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-kfgcti

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-bef0x

Find the interquartile ranges for the girth, height, and volume of timber, respectively, in 31 felled black cherry trees:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-iy7bhd

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-o0jkg


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-mo39rs


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-cgixp7

Compute InterquartileRange for slices of a collection of paths of a random process:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-8se1zg

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-52xxug

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-iakfqb
Plot of the interquartile range for the selected times:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-5u9dct

Find the interquartile range of the heights for the children in a class:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-cevfij

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-fllmtw


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-celepo

Plot the interquartile range respective of the median:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-g98mgx

Properties & Relations (4)Properties of the function, and connections to other functions
InterquartileRange is the difference of linearly interpolated Quantile values:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-chohu9

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-cuwfxn


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-kqldeg

InterquartileRange is the difference between the first and third quartiles:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-d8ys7g

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-ikpxf8


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-fs2ypr

QuartileDeviation is half the interquartile range:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-b8uymf

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-h8t71a


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-n0cv2

BoxWhiskerChart shows the interquartile range for data:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-i5d4c7

Possible Issues (1)Common pitfalls and unexpected behavior
InterquartileRange requires numeric values in data:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-g88


The symbolic closed form may exist for some distributions:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-hsjsiw

Neat Examples (1)Surprising or curious use cases
The distribution of InterquartileRange estimates for 20, 100, and 300 samples:

https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-b3v7m9


https://wolfram.com/xid/0jvlvbinvb11tvdiso0a-8raem

Wolfram Research (2007), InterquartileRange, Wolfram Language function, https://reference.wolfram.com/language/ref/InterquartileRange.html (updated 2024).
Text
Wolfram Research (2007), InterquartileRange, Wolfram Language function, https://reference.wolfram.com/language/ref/InterquartileRange.html (updated 2024).
Wolfram Research (2007), InterquartileRange, Wolfram Language function, https://reference.wolfram.com/language/ref/InterquartileRange.html (updated 2024).
CMS
Wolfram Language. 2007. "InterquartileRange." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/InterquartileRange.html.
Wolfram Language. 2007. "InterquartileRange." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/InterquartileRange.html.
APA
Wolfram Language. (2007). InterquartileRange. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/InterquartileRange.html
Wolfram Language. (2007). InterquartileRange. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/InterquartileRange.html
BibTeX
@misc{reference.wolfram_2025_interquartilerange, author="Wolfram Research", title="{InterquartileRange}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/InterquartileRange.html}", note=[Accessed: 19-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_interquartilerange, organization={Wolfram Research}, title={InterquartileRange}, year={2024}, url={https://reference.wolfram.com/language/ref/InterquartileRange.html}, note=[Accessed: 19-June-2025
]}