For a sample, x, calculate the quantiles, q, corresponding to the cumulative probability values in p. All non-numeric values (NaNs) of x are ignored.
If x is a matrix, compute the quantiles for each column and return them in a matrix, such that the i-th row of q contains the p(i)th quantiles of each column of x.
If p is unspecified, return the quantiles for
[0.00 0.25 0.50 0.75 1.00].
The optional argument dim determines the dimension along which
the quantiles are calculated. If dim is omitted it defaults to
the first non-singleton dimension.
The methods available to calculate sample quantiles are the nine methods used by R (http://www.r-project.org/). The default value is METHOD = 5.
Discontinuous sample quantile methods 1, 2, and 3
Continuous sample quantile methods 4 through 9, where p(k) is the linear interpolation function respecting each methods’ representative cdf.
Hyndman and Fan (1996) recommend method 8. Maxima, S, and R (versions prior to 2.0.0) use 7 as their default. Minitab and SPSS use method 6. MATLAB uses method 5.
x = randi (1000, [10, 1]); # Create empirical data in range 1-1000 q = quantile (x, [0, 1]); # Return minimum, maximum of distribution q = quantile (x, [0.25 0.5 0.75]); # Return quartiles of distribution
See also: prctile.