GUIquantile shows the necessary calculations to obtain $x_z$ quantile.


  • out=GUIquantile(x, z)example
  • out=GUIquantile(x, z,Name,Value)example



out =GUIquantile(x, z) Percentile "z" in an individual series.


out =GUIquantile(x, z, Name, Value) Computation of the median in presence of discrete data with frequencies.


expand all

  • Percentile "z" in an individual series.
  • In this case we find percentile 43, all frequencies are equal to 1.

    x=[2 10 5 9 13];

  • Computation of the median in presence of discrete data with frequencies.
  • X = Number of components of Italian families (source ISTAT).

    % freq = Number of families (in thousands).
    freq=[7910 6833 5116 4051 1088  303];

    Related Examples

    expand all

  • Computation of the median in presence of discrete data with frequencies and related plot.
  • (See page 14 of [CMR]) X = 133 students grades on a given exam freq = frequencies.

    freq=[12 10 4 8 7 19 22 8 9 13 10 8 3 ];
    % Find 83 percentile and show associated plot.

  • Example of computation of 40 per cent percentile in a frequency distribution (X is continuous).
  • % The following frequency distribution shows the amount (in thousands
    % of Euros) of advertising expenditure made in a given month by a series of
    % companies. (See page 15 of [CMR])
    X=[9  1787
    15  1310
    19  972
    25  2753
    35  4227
    50  2174
    100 920
    150  138
    300  54
    Inf  9];
    out = 
      struct with fields:
            data: [11×5 table]
        quantile: 23.2619
    Click here for the graphical output of this example (link to Ro.S.A. website)

    Input Arguments

    expand all

    x — vector of numeric data. Vector.

    Vector containing strictly numerical data.

    Note that if x is referred to a continuous variable x(1) represent the lower extreme of the first class, and the other values of x contain the upper extremes of the other classes.

    Data Types: double, ordered categorical

    z — requested probability. Scalar.

    Requested probabilities for which to compute the quantile, specified as a scalar.

    Data Types: double

    Name-Value Pair Arguments

    Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

    Example: 'freq',1:10 , 'DiscreteData',false , 'plots',true

    freq —frequencies.vector.

    Vector of the same length of x containing the frequencies (weights) associated to each value of x if x is discrete or vector with length (x)-1 if variable X is continuous. If freq is not supplied, it is assumed that all observations have the same (relative) frequency (weight).

    Example: 'freq',1:10

    Data Types: double

    DiscreteData —Discrete data or continuous data.boolean.

    If DiscreteData is true (default), we assume that the data in x come from a discrete variable.

    If DiscreteData is false, we assume that the data in x come from a continuous variable.

    Example: 'DiscreteData',false

    Data Types: boolean

    plots —show quantile graphically.boolean.

    If plots is true an additional plot which shows graphically how the quantile has been obtained using the linear interpolation is displayed on the screen. The default value of plots is false.

    Example: 'plots',true

    Data Types: boolean

    Output Arguments

    expand all

    out — description Structure

    detailed output to compute the index. struct.

    Value Description

    shows the value of the quantile which has been found.


    table with n+1 rows (where n is the length of x) containing what is shown in the GUI. Last row contains the totals. This field is present only if optional input freq is supplied.


    Cerioli, A., Milioli, M.A., Riani, M. (2016), "Esercizi di statistica (Quinta edizione)". [CMR]

    This page has been automatically generated by our routine publishFS