# Statistics calculator

Summarise a list of numbers: mean, median, mode, range, variance, standard deviation and quartiles.

- Endpoint: `POST https://setget.net/v1/tools/statistics` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `statistics`
- Page: https://setget.net/tools/statistics

## Inputs

- `numbers` (required, array): The numbers to summarise.

## Example

```json
{"input":{"numbers":[2,4,4,4,5,5,7,9]}}
```

Result:

```json
{"count":8,"sum":40,"mean":5,"median":4.5,"modes":[4],"min":2,"max":9,"range":7,"variance_population":4,"variance_sample":4.57142857143,"stdev_population":2,"stdev_sample":2.1380899353,"q1":4,"q3":5.5,"iqr":1.5}
```

**Sample or population standard deviation?** Use population when your numbers are the whole group. Use sample when they are a selection from a larger group: it divides by one less than the count, so it comes out a little larger.

**How are quartiles worked out?** By linear interpolation between the sorted values, the same method as QUARTILE.INC in spreadsheets. Other methods can give slightly different answers for small lists.

**Why is "modes" empty?** When every value appears only once there is no most common value.
