Statistics central tendency

From wikinotes

You may be interested in math operators.

Mode

The most common number in a dataset.
(like french a-la-mode).

       |   |
 frq   |   | |
       | | | |
       +--------
         0 1 2
        (value)

In the above chart, 1 is the most common number, so it is the mode.

Median

The 50% percentile of the dataset.
50% of the points are above, and 50% of the values are below.

1. order data from smallest to largest

# sort
7 2 13 5 1 11 3  #> 1 2 3 5 7 11 13

2. if the number is odd, use the value at the middle-most index.
if the value is even use the average of the two middle index values.

# [odd] position '4' is the middle-most index, so median is `5`
1 2 3 5 7 11 13

# [even] position 4/5 are the middle-most indexes, so median is `(5 + 7) / 2 == 6`
1 2 3 5 7 11 13 17

Mean

The mean is the average.