Mathematics.

summary statistics

Descriptive Statistics

Statistics30 minDifficulty3 out of 10

You should know: expectation

Overview

A descriptive statistic is a summary statistic that quantitatively describes or summarizes features from a collection of information, while descriptive statistics is the process of using and analyzing those statistics. Descriptive statistics is distinguished from inferential statistics by its aim to summarize a sample, rather than use the data to learn about the population that the sample of data is thought to represent — it generally is not developed on the basis of probability theory. Even when a data analysis draws its main conclusions using inferential statistics, descriptive statistics are almost always presented alongside it, e.g. a table giving sample size, average age, and other characteristics.

Intuition

Given a spreadsheet of 10,000 numbers, nobody wants to read every single one. Descriptive statistics condense a dataset down to a handful of numbers that capture its essential shape: where is it centered (mean, median), how spread out is it (variance, standard deviation, range), and what does its distribution look like (skewness, quartiles). The goal is purely to describe the data you actually have — not to guess something about a larger population it might have come from (that's inferential statistics' job).

Interactive Graph

A distribution's mean and spread

Loading visualization…

Formal Definition

Definition

For a sample x₁, x₂, ..., xₙ, the key descriptive statistics are:

xˉ=1ni=1nxi\bar{x} = \frac{1}{n}\sum_{i=1}^n x_i

The arithmetic average of the data

Sample mean
s2=1n1i=1n(xixˉ)2s^2 = \frac{1}{n-1}\sum_{i=1}^n (x_i - \bar{x})^2

Uses n−1 (Bessel's correction) so s² is an unbiased estimator of the population variance

Sample variance
s=s2s = \sqrt{s^2}

Same units as the original data, unlike variance

Sample standard deviation
Median={x((n+1)/2)n odd12(x(n/2)+x(n/2+1))n even\text{Median} = \begin{cases} x_{((n+1)/2)} & n \text{ odd} \\ \tfrac{1}{2}\left(x_{(n/2)} + x_{(n/2+1)}\right) & n \text{ even}\end{cases}

Sorted data's middle value(s)

Notation

NotationMeaning
xˉ\bar{x}Sample mean
ssSample standard deviation
s2s^2Sample variance
IQR=Q3Q1\text{IQR} = Q_3 - Q_1Interquartile range — spread of the middle 50% of data

Properties

Mean minimizes squared deviation

xˉ=argminci(xic)2\bar{x} = \arg\min_c \sum_i (x_i - c)^2

Median minimizes absolute deviation

median=argmincixic\text{median} = \arg\min_c \sum_i |x_i - c|

Sensitivity to outliers

The mean is sensitive to extreme values; the median is robust to them\text{The mean is sensitive to extreme values; the median is robust to them}

Standard deviation shares units with the data

s is in the same units as xi, while s2 is in squared unitss \text{ is in the same units as } x_i, \text{ while } s^2 \text{ is in squared units}

Applications

Data preprocessing and exploratory data analysis (EDA) in machine learning pipelines rely on descriptive statistics to detect outliers, skew, and scale before modeling.

Worked Examples

  1. Mean: sum divided by n=5.

    xˉ=2+4+4+6+95=255=5\bar{x} = \frac{2+4+4+6+9}{5} = \frac{25}{5} = 5
  2. Median: middle value of the sorted data {2,4,4,6,9}.

    median=4\text{median} = 4
  3. Sample variance uses n−1 = 4 in the denominator.

    s2=(25)2+(45)2+(45)2+(65)2+(95)24=9+1+1+1+164=284=7s^2 = \frac{(2-5)^2+(4-5)^2+(4-5)^2+(6-5)^2+(9-5)^2}{4} = \frac{9+1+1+1+16}{4} = \frac{28}{4}=7
  4. Standard deviation is the square root of variance.

    s=72.646s = \sqrt{7} \approx 2.646

Answer: Mean = 5, median = 4, sample standard deviation ≈ 2.646.

Practice Problems

Difficulty 3/10

Find the mean and median of {1, 3, 3, 6, 7, 8, 9}.

Difficulty 4/10

A dataset has one extreme outlier added to it. Which statistic changes the LEAST?

Difficulty 5/10

Five concrete cube strengths (MPa) are 30, 32, 33, 35, 60 (the last from a testing error). Compute the mean and median, and say which better represents typical strength.

Difficulty 6/10

A concrete supplier reports mean strength 40 MPa with standard deviation 4 MPa. Compute the coefficient of variation and explain what it tells a quality engineer.

Common Mistakes

Common Mistake

Using the mean to summarize heavily skewed data (like income).

A few extremely high values pull the mean upward, misrepresenting a 'typical' value. The median is usually a better measure of center for skewed distributions.

Common Mistake

Dividing by n instead of n−1 when computing a sample variance.

Dividing by n gives a biased (too-small) estimate of the population variance. Bessel's correction (dividing by n−1) makes the sample variance an unbiased estimator.

Quiz

Which measure of center is most robust to outliers?
Standard deviation measures:
The coefficient of variation (SD/mean) is useful because it:

Summary

  • Descriptive statistics summarize a dataset's center (mean, median), spread (variance, standard deviation, IQR), and shape.
  • Sample mean x̄ = (1/n)Σxᵢ; sample variance uses Bessel's correction: s² = (1/(n−1))Σ(xᵢ−x̄)².
  • The median is robust to outliers; the mean is not.
  • Descriptive statistics summarize the sample itself and make no claims about a broader population — that is the job of inferential statistics.
  • IQR = Q3 − Q1 captures the spread of the middle 50% of data and is commonly used to detect outliers.

References