# Quartiles

Quartiles[list]

gives a list of the 1/4, 1/2 and 3/4 quantiles of the elements in list.

Quartiles[dist]

gives a list of the 1/4, 1/2 and 3/4 quantiles of the distribution dist.

# Details • Quartiles[list] is equivalent to Quantile[list,{1/4,1/2,3/4},{{1/2,0},{0,1}}]. »
• The second quartile is equivalent to Median[list]. »
• For even Length[list], the first quartile is equivalent to the median of the smallest elements in list.
• For odd Length[list], the first quartile is equivalent to the average of the median of the smallest elements and the median of the smallest elements in list.
• The third quartile is defined like the first, but with the largest rather than smallest elements.
• Quartiles[list,{{a,b},{c,d}}] uses the quantile definition specified by parameters a, b, c, d.

# Examples

open allclose all

## Basic Examples(2)

Quartiles for a list of exact numbers:

Quartiles of a parametric distribution:

## Scope(14)

### Data(11)

Exact input yields exact output:

Approximate input yields approximate output:

Quartiles for a matrix gives columnwise quartiles:

Works with large arrays:

SparseArray data can be used just like dense arrays:

Compute results using other parametrizations:

Find the quartiles of WeightedData:

Find the quartiles of EventData:

Find the quartiles of TemporalData:

Find the quartiles of TimeSeries:

The quartiles depend only on the values:

Find the quartiles for data involving quantities:

### Distributions and Processes(3)

Find the quartiles for a parametric distribution:

Quartiles for a derived distribution:

Data distribution:

Quartile function for a random process:

## Applications(4)

Quartiles divide a distribution in four equal probability sections:

Find a moving quartile envelope for a time series:

Data smoothed by moving median:

Moving envelope of first and third quartiles:

Find the quartiles for data representing the top oil-producing fields in 2001:

Compare with the minimum and maximum values for the data:

Plot the data with quartile lines:

Compute the quartiles for the heights of children in a class:

## Properties & Relations(6)

Quartiles are given by linearly interpolated Quantile values:

The second quartile is the Median:

InterquartileRange is the difference between the first and third quartiles:

QuartileDeviation is half the difference between the first and third quartiles:

QuartileSkewness is a skewness measure obtained from the quartiles:

BoxWhiskerChart shows the quartiles for data:

## Possible Issues(1)

Quartiles requires numeric values: 