WOLFRAM

gives the difference between the upper and lower quartiles for the elements in data.

InterquartileRange[data,{{a,b},{c,d}}]

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

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Interquartile range for a list of exact numbers:

Out[1]=1

Interquartile range for a list of dates:

Out[1]=1
Out[2]=2

Interquartile range of a parametric distribution:

Out[1]=1

Scope  (22)Survey of the scope of standard use cases

Basic Uses  (8)

Exact input yields exact output:

Out[1]=1
Out[2]=2

Approximate input yields approximate output:

Out[1]=1
Out[2]=2

Compute results using other parametrizations:

Out[1]=1
Out[2]=2

Find the interquartile range for WeightedData:

Out[1]=1
Out[3]=3

Find the interquartile range for EventData:

Out[2]=2

Find the interquartile range for TemporalData:

Out[3]=3

Find the interquartile range of TimeSeries:

Out[1]=1

The interquartile range depends only on the values:

Out[2]=2

Find the interquartile range for data involving quantities:

Out[1]=1
Out[2]=2

Array Data  (5)

InterquartileRange for a matrix gives columnwise ranges:

Out[1]=1

Interquartile range for a tensor works across the first index:

Out[2]=2

Works with large arrays:

Out[1]=1
Out[2]=2

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

Out[1]=1
Out[2]=2

SparseArray data can be used just like dense arrays:

Out[1]=1
Out[2]=2

Find interquartile range of a QuantityArray:

Out[1]=1
Out[2]=2

Image and Audio Data  (2)

Channelwise interquartile range values of an RGB image:

Out[1]=1

Interquartile range intensity value of a grayscale image:

Out[2]=2

Interquartile range amplitude of all channels:

Out[1]=1
Out[2]=2

Date and Time  (4)

Compute interquartile range of dates:

Out[2]=2
Out[3]=3
Out[4]=4

Compute the weighted interquartile range of dates:

Out[1]=1
Out[3]=3

Compare the simple interquartile range:

Out[4]=4
Out[5]=5

Compute the interquartile range of dates given in different calendars:

Out[1]=1
Out[2]=2
Out[3]=3

Compute the interquartile range of times:

Out[1]=1
Out[2]=2

List of times with different time zone specifications:

Out[3]=3
Out[4]=4

Distributions and Processes  (3)

Find the interquartile range for a parametric distribution:

Out[1]=1

Interquartile range for a derived distribution:

Out[1]=1

Data distribution:

Out[3]=3

Interquartile range for a time slice of a random process:

Out[1]=1

Applications  (6)Sample problems that can be solved with this function

InterquartileRange indicates the spread of values:

Out[2]=2

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

Generate a random sample:

Find the interquartile range of the data:

Out[3]=3

Compare with the interquartile range of the distribution:

Out[4]=4
Out[5]=5

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

Out[3]=3

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

Out[2]=2
Out[3]=3

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

Choose a few slice times:

Plot of the interquartile range for the selected times:

Out[4]=4

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

Out[2]=2
Out[3]=3

Plot the interquartile range respective of the median:

Out[4]=4

Properties & Relations  (4)Properties of the function, and connections to other functions

InterquartileRange is the difference of linearly interpolated Quantile values:

Out[3]=3
Out[2]=2

InterquartileRange is the difference between the first and third quartiles:

Out[2]=2
Out[3]=3

QuartileDeviation is half the interquartile range:

Out[2]=2
Out[3]=3

BoxWhiskerChart shows the interquartile range for data:

Out[1]=1

Possible Issues  (1)Common pitfalls and unexpected behavior

InterquartileRange requires numeric values in data:

Out[1]=1

The symbolic closed form may exist for some distributions:

Out[2]=2

Neat Examples  (1)Surprising or curious use cases

The distribution of InterquartileRange estimates for 20, 100, and 300 samples:

Out[1]=1
Out[2]=2
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).

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 ]}

@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 ]}

@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 ]}