# 2.13.1.18 rowquantiles

## Brief Information

Compute quantiles on worksheet rows

## Command Line Usage

 

1. rowquantiles irng:=col(1):col(5) 

2. rowquantiles irng:=Col(A):Col(F) median:=Col(G) 

## Variables

Display
Name
Variable
Name
I/O
and
Type
Default
Value
Description
Input irng

Input

Range

<active>

This variable specifies the range of input data for which quantiles will be calculated.

Minimum min

Output

vector

<new>

This variable specifies the output column for the minimum value of the data set.

1st Quartile(Q1) q1

Output

vector

<optional>

This variable specifies the output column for the 1st quartile, that is, the value in a dataset that demarcates the lowest 25% of the values in an ordered set.

Median median

Output

vector

<new>

This variable specifies the output column for the median or 2nd quartile, that is, the value in a dataset that demarcates the lowest 50% of the values in an ordered set.

3rd Quartile(Q3) q3

Output

vector

<optional>

This variable specifies the output column for the 3rd quartile, that is, the value in a dataset that demarcates the lowest 75% of the values in an ordered set.

Maximum max

Output

vector

<new>

This variable specifies the output column for the maximum value.

## Description

This function computes the quantiles for each row within a specific rectangular range.

quantiles are values from the data below which lie a given proportion of the data points in a given set. For example, 25% of data points in any set of data lay below the first quartile, and 50% of data points in a set lay below the second quartile, or median, and 75% of data in a set lay below the third quartile. When data is divided into 100 parts, percentiles can be calculated.

## Examples

Suppose you only want to investigate the general information about health status of the students, such as the minimum, median and maximum. You collected 40 students and recorded the name, gender, age, height and weight. (Import body_row.dat on \Samples\Statistics)

Operation:

1. Highlight the two rows of the data, which is the Hight and Weight row respectively.

2. Type rowquantiles in Command Window.

3. Click Enter.

Then you can obtain the minimum, median and maximum of the 40 students's height and weight. |

## Algorithm

Sort given data first. Denote the sorted data range as ,

1. The 1st quartile is computed as , where is the integer part, and is the fractional part of equation

2. The median, or 2nd quartile, is computed as , where is the integer part, and is the fractional part of equation

3. 3rd quartile is computed as , where is the integer part, and is the fractional part of equation

## References

David, H. A. 1981. Order Statistics. 2nd ed. Wiley, New York.

Tukey, J.W. Exploratory Data Analysis. Addison-Wesley, 1977.

## Related X-Functions

Keywords:minimum, maximum, median, q1, q3