Math formulas

Statistics formulas

Describe a data set with measures of centre and spread: mean, median, mode, range, variance and standard deviation.

Formulas and calculators

Mean, median, variance and standard deviation

Paste a list of numbers to get the count, sum, mean, median, mode, range, and both the population and the sample variance and standard deviation.

x̄ = Σxᵢ / n; σ² = Σ(xᵢ − x̄)² / n; s² = Σ(xᵢ − x̄)² / (n − 1)

Calculated quantities

xᵢ - observations · n - count · x̄ - arithmetic mean · Me - median · Mo - mode · R - range · σ² - population variance · σ - population standard deviation · s² - sample variance · s - sample standard deviation

Open formula

How to choose the right formula

Mean, median, variance and standard deviation

x̄ = Σxᵢ / n; σ² = Σ(xᵢ − x̄)² / n; s² = Σ(xᵢ − x̄)² / (n − 1)
When to use it
The mean, median and mode describe where the data lie, while the variance and the standard deviation describe how far the values spread around the mean: a full population divides the squared deviations by n, a sample divides them by n − 1.
Calculated quantities
xᵢ - observations (1) · n - count (1) · x̄ - arithmetic mean (1) · Me - median (1) · Mo - mode (1) · R - range (1) · σ² - population variance (1) · σ - population standard deviation (1) · s² - sample variance (1) · s - sample standard deviation (1)
Worked example: Standard deviation of a whole population
Eight measurements form the complete data set: 2, 4, 4, 4, 5, 5, 7, 9. Calculate the population standard deviation.
Open formula

What to check before calculating

Assumptions and conditions

  • All values describe one feature measured in the same unit; the data set must contain at least one value.
  • The divisor n applies when the numbers are the whole population, and the divisor n − 1 when they are a sample used to estimate a larger population.
  • The sample variance does not exist for a single observation, because the divisor n − 1 would be zero.
  • The mean, median, mode, range and standard deviation keep the unit of the data, while the variance is expressed in that unit squared.
  • The mode does not exist when no value repeats, and it is ambiguous when several values share the highest frequency.
  • The median is read from the sorted data, so the order in which the values are entered does not change any result.

Common mistakes

  • Dividing by n for sample data or by n − 1 for a whole population; the divisor decides whether the result is σ² or s².
  • Reading the median without sorting the data first.
  • Reporting the variance in the unit of the data instead of that unit squared.
  • Assuming that the mode always exists and is unique.
  • Rounding the mean before the deviations are calculated, which distorts the variance.
  • Confusing the standard deviation with the range or with the mean absolute deviation.