Lists

### 14.5.1 Lists

The functions described here can be used if a statistics series is contained in a list. See Section 14.5.2 for statistics on matrices and Section 20 for more general statistics.

Let L be a list.

- mean(L) computes the arithmetic mean of a list.
- stddev(L) computes the standard deviation of a population, for the population L.
- stddevp(L) computes an unbiased estimate of the standard deviation of the population for the sample L. The following relation holds:

  stddevp(L)2= |
  size(L)·stddev(L)2
  size(L)−1

- variance(L) computes the variance of L, which is the square of stddevp(L).
- median(L) computes the median of L.
- quantile(L,d) computes the deciles of L, where d is the decile.
- quartiles(L) returns a list consisting of the minimum, the first quartile, the median, the third quartile and the maximum of L.
- boxwhisker(L) draws the whisker box of a statistics series stored in L.

#### Examples

mean([3,4,2])

3 |  |  |  |  |  |  |  |  |  |

stddev([3,4,2])

√ |
6
3

stddevp([3,4,2])

1 |  |  |  |  |  |  |  |  |  |

variance([3,4,2])

2
3

median([0,1,3,4,2,5,6])

3.0 |  |  |  |  |  |  |  |  |  |

To obtain the first quartile:

quantile([0,1,3,4,2,5,6],0.25)

1.0 |  |  |  |  |  |  |  |  |  |

To obtain the median:

quantile([0,1,3,4,2,5,6],0.5)

3.0 |  |  |  |  |  |  |  |  |  |

To obtain the third quantile:

quantile([0,1,3,4,2,5,6],0.75)

5.0 |  |  |  |  |  |  |  |  |  |

quartiles([0,1,3,4,2,5,6])

⎡ ⎢ ⎢ ⎢ ⎢ ⎢ ⎣ |
0.0
1.0
3.0
5.0
6.0
| ⎤ ⎥ ⎥ ⎥ ⎥ ⎥ ⎦

boxwhisker([0,1,3,4,2,5,6])