Describing data: location, spread, and shape
Mean, median, variance, quantiles and the box plot — what each summary captures and how each responds to an outlier.
Before modelling anything, you look at the data. Where is it centred? How far does it spread? Is it symmetric or skewed? A handful of numbers answers these questions, and the first job of statistics is knowing which number to trust when the data is messy.
Two different ideas of center
The mean is the balance point — the value that would make the data see-saw level. The median is the middle value — half the data below, half above. They agree on symmetric data and diverge on skewed data, and the difference is itself information.
Move the eight measurements below and watch the summaries update. Then add the outlier and see which numbers flinch.
Move the data — standard deviation vs the five-number summary
- mean
- 49.8
- median
- 49.5
- SD
- 5.2
- IQR
- 6.3
The box spans Q1 to Q3 with the median inside; the diamond is the mean. Push a point to 118 and the mean and SD jump while the median and IQR stay put — that is the robustness difference between the two families of summaries, and the reason a single outlier can move a variance-based statistic much more than a quantile.
Measures of location
The sample mean is the arithmetic average,
and it is the value that minimizes the sum of squared deviations. The median is the middle value once the data is sorted; for even it is the average of the two middle values. The mode is the most frequent value, useful for categorical data where means are meaningless.
The mean is sensitive to every observation because each one contributes. The median depends only on rank. One extreme value can drag the mean arbitrarily far while leaving the median untouched — the robustness distinction that the widget makes visible.
Measures of spread
Sample variance uses squared deviations from the mean:
and the sample standard deviation is . The (Bessel's correction) is there because the deviations are measured from the sample mean, which is itself estimated from the data; dividing by makes the estimator unbiased. Population variance, when you truly have the whole population, divides by .
Variance is in squared units, which is why standard deviation is usually the number you quote — it is in the same units as the data. The range (max − min) is the crudest spread measure and the most outlier-sensitive.
Quantiles and the box plot
A quantile is the inverse of the cumulative distribution: the -th quantile is the value below which a fraction of the data lies. The five-number summary is
and the interquartile range is a robust spread measure that ignores the outer quarter of the data on each side. The box plot draws the box from to , a line at the median, and whiskers out to the extremes (or to a fence at , with more distant points drawn as outliers).
Sample or population?
The formulas differ only in the denominator, but using the wrong one changes the answer and, more importantly, signals a conceptual error. If the numbers are a sample drawn from a larger population and you want to estimate that population's variance, divide by . If they literally are the entire population, divide by . In machine learning, sample statistics almost always mean (or a library default you should check).
Illustrative vs real
The widget uses eight clean, roughly symmetric measurements. Real datasets have missing values, repeated values, heavy skew and multiple modes, and no single number summarizes them. The box plot is also a simplification — it hides multimodality entirely, so always look at the actual distribution before trusting a summary.
Check yourself
Eduspheria wiki · Mathematics for AI, Statistics
0 / 5 answered
Where next: correlation — how two variables move together.