percentile#

swordfish.function.percentile()#

If X is a vector, return the given percentile of X. The calculation ignores null values.

If X is a matrix, conduct the aforementioned calculation within each column of X. The result is a vector

If X is a table, conduct the aforementioned calculation within each column of X. The result is a table.

Parameters:
  • X (Constant) – A vector, a matrix or a table.

  • percent (Constant) – An integer or a floating number between 0 and 100.

  • interpolation (Constant, optional) –

    A string indicating the interpolation method to use if the specified percentile is between two elements in X (assuming the \(i^{th}\) and \((i+1)^{th}\) element in the sorted X). It can take the following values: ‘linear’, ‘lower’, ‘higher’, ‘nearest’, ‘midpoint’.

    The default value of interpolation is ‘linear’.