Skip to main content

Quartile

This function returns the quartiles of a data sample.

Syntax

quartile(Random_variable)

Description

It returns a vector of three components: the k-th component corresponds to the kk-th quartile.

statistics.quartile.calc.png

Options

Option

Description

Format

Default value

type

We can choose the method to calculate the quartiles. There are 11 different types. From 1 to 9 correspond to the quartile calculation methods described by Hyndman and Fan in their article Sample quantiles in statistical packages (1996). The numbering is the same as theirs. Type 10 takes the median for quartile 2, and the median of the corresponding half of the data set for quartiles 1 and 3. Does not include the median in the computation of the first and third quartiles if the number of elements is odd. Type 11 takes the median for quartile 2, and the median of the corresponding half of the data set for quartiles 1 and 3. Includes the median in the computation of the first and third quartiles if the number of elements is odd.

{type=8}

{type=11}