Computing methods

edit

Discrete Distributions

edit

For discrete distributions, there is no universal agreement on selecting the quartile values.[1]

Method 1

edit
  1. Use the median to divide the ordered data set into two halves.
    • If there is an odd number of data points in the original ordered data set, do not include the median (the central value in the ordered list) in either half.
    • If there is an even number of data points in the original ordered data set, split this data set exactly in half.
  2. The lower quartile value is the median of the lower half of the data. The upper quartile value is the median of the upper half of the data.

This rule is employed by the TI-83 calculator boxplot and "1-Var Stats" functions.

Method 2

edit
  1. Use the median to divide the ordered data set into two halves.
    • If there are an odd number of data points in the original ordered data set, include the median (the central value in the ordered list) in both halves.
    • If there are an even number of data points in the original ordered data set, split this data set exactly in half.
  2. The lower quartile value is the median of the lower half of the data. The upper quartile value is the median of the upper half of the data.

The values found by this method are also known as "Tukey's hinges";[2] see also midhinge.

Method 3

edit
  1. If there are even numbers of data points, then Method 3 is the same as either method above
  2. If there are (4n+1) data points, then the lower quartile is 25% of the nth data value plus 75% of the (n+1)th data value; the upper quartile is 75% of the (3n+1)th data point plus 25% of the (3n+2)th data point.
  3. If there are (4n+3) data points, then the lower quartile is 75% of the (n+1)th data value plus 25% of the (n+2)th data value; the upper quartile is 25% of the (3n+2)th data point plus 75% of the (3n+3)th data point.

Method 4

edit

If we have an ordered dataset  , we can interpolate between data points to find the  th empirical quantile if   is in the   quantile. If we denote the integer part of a number   by  , then the empirical quantile function is given by,

 ,

where   and  .[3]

To find the first, second, and third quartiles of the dataset we would evaluate  ,  , and   respectively.

Example 1

edit

Ordered Data Set: 6, 7, 15, 36, 39, 40, 41, 42, 43, 47, 49

Method 1 Method 2 Method 3
Q1 15 25.5 20.25
Q2 40 40 40
Q3 43 42.5 42.75

Example 2

edit

Ordered Data Set: 7, 15, 36, 39, 40, 41

As there are an even number of data points, all three methods give the same results.

Method 1 Method 2 Method 3
Q1 15 15 15
Q2 37.5 37.5 37.5
Q3 40 40 40

Continuous Probability Distributions

edit
 
Quartiles on a cumulative distribution function of a normal distribution

If we define a continuous probability distributions as   where   is a real valued random variable, its cumulative distribution function (CDF) is given by,

 .[4]

The CDF gives the probability that the random variable   is less than the value  . Therefore, the first quartile is the value of   when  , the second quartile is   when  , and the third quartile is   when  . The values of   can be found with the quantile function  where   for the first quartile,   for the second quartile, and   for the third quartile. The quantile function is the inverse of the cumulative distribution function if the cumulative distribution function is monotonically increasing.




  1. ^ Hyndman, Rob J; Fan, Yanan (November 1996). "Sample quantiles in statistical packages". American Statistician. 50 (4): 361–365. doi:10.2307/2684934. JSTOR 2684934.
  2. ^ Tukey, John Wilder (1977). Exploratory Data Analysis. ISBN 978-0-201-07616-5.
  3. ^ Dekking, F.M. (Frederik Michel), 1946- (2005). A modern introduction to probability and statistics : understanding why and how. Springer. ISBN 1-85233-896-2. OCLC 783259968.{{cite book}}: CS1 maint: multiple names: authors list (link) CS1 maint: numeric names: authors list (link)
  4. ^ Dekking, F.M. (Frederik Michel), 1946- (2005). A modern introduction to probability and statistics : understanding why and how. Springer. ISBN 1-85233-896-2. OCLC 783259968.{{cite book}}: CS1 maint: multiple names: authors list (link) CS1 maint: numeric names: authors list (link)