Next Previous Up Contents
Next: tablename
Up: Processing Filters
Previous: sorthead

#### 6.1.33 `stats`

Usage:

       stats [-[no]parallel] [-qapprox|-qexact] [<item> ...]

Calculates statistics on the data in the table. This filter turns the table sideways, so that each row of the output corresponds to a column of the input. The columns of the output table contain statistical items such as mean, standard deviation etc corresponding to each column of the input table.

By default the output table contains columns for the following items:

- `Name`: Column name
- `Mean`: Average
- `StDev`: Population Standard deviation
- `Minimum`: Numeric minimum
- `Maximum`: Numeric maximum
- `NGood`: Number of non-blank cells

However, the output may be customised by supplying one or more `<item>` headings. These may be selected from the above as well as the following:

- `NBad`: Number of blank cells
- `Variance`: Population Variance
- `SampStDev`: Sample Standard Deviation
- `SampVariance`: Sample Variance
- `MedAbsDev`: Median Absolute Deviation
- `ScMedAbsDev`: Median Absolute Deviation * 1.4826
- `Skew`: Gamma 1 skewness measure
- `Kurtosis`: Gamma 2 peakedness measure
- `Sum`: Sum of values
- `MinPos`: Row index of numeric minimum
- `MaxPos`: Row index of numeric maximum
- `Cardinality`: Number of distinct values in column; values >100 ignored
- `Median`: Middle value in sequence
- `Quartile1`: First quartile
- `Quartile2`: Second quartile
- `Quartile3`: Third quartile

Additionally, the form "Q.nn" may be used to represent the quantile corresponding to the proportion 0.nn, e.g.:

- `Q.25`: First quartile
- `Q.625`: Fifth octile

Any parameters of the input table are propagated to the output one.

The `-qapprox` or `-qexact` flag controls how quantiles are calculated. With `-qexact` they are calculated exactly, but this requires memory usage scaling with the number of rows. If the `-qapprox` flag is supplied, an method is used which is typically slower and produces only approximate values, but which will work in fixed memory and so can be used for arbitrarily large tables. By default, exact calculation is used. These flags are ignored if neither quantiles nor the MAD are being calculated

The `-noparallel` flag may be supplied to inhibit multi-threaded statistics accumulation. Calculation is done in parallel by default if multi-threaded hardware is available, and it's usually faster.

Next Previous Up Contents
Next: tablename
Up: Processing Filters
Previous: sorthead

STILTS - Starlink Tables Infrastructure Library Tool Set
Starlink User Note256
STILTS web page: http://www.starlink.ac.uk/stilts/
Author email: m.b.taylor@bristol.ac.uk
Mailing list: topcat-user@jiscmail.ac.uk