New: 6 free SQL practice datasets with 300+ questions — try the SQL Compiler →
Statistics

Descriptive Statistics Explained

Descriptive statistics explained: mean, median, mode, sample versus population variance, IQR and the coefficient of variation, with real computed numbers.

Upskly AI Team October 5, 2026 8 min read
Descriptive Statistics Explained

Descriptive statistics summarises a dataset without generalising beyond it: where the data is centred, and how spread out it is. Every number below was computed for real with Python’s statistics module, not estimated by eye, over a small shared dataset: 4, 8, 6, 5, 9, 3, 8, 7.

In this guide

Mean, median and mode

Three measures of central tendency
MeasureDatasetResultHow it is found
Mean4, 8, 6, 5, 9, 3, 8, 76.25Sum of all values (50) divided by the count (8)
Median4, 8, 6, 5, 9, 3, 8, 76.5Sorted: 3, 4, 5, 6, 7, 8, 8, 9; with an even count, average the two middle values, 6 and 7
Mode3, 7, 7, 7, 9, 2, 577 appears three times, more than any other value in that dataset

The mode only exists when a value genuinely repeats more often than the rest. A dataset where every value appears exactly once has no mode at all. Two values tied for the highest frequency makes a dataset bimodal; three or more tied values makes it multimodal. The mode is also the only one of the three that works on purely categorical data, like a favourite payment method, since the mean and median both need numeric or at least ordered values to mean anything.

Range, quartiles and IQR

The range of 4, 8, 6, 5, 9, 3, 8, 7 is the largest value minus the smallest: 9 – 3 = 6. Removing the smallest value, 3, changes the range to 9 – 4 = 5, which is exactly the range’s weakness: it depends solely on the two most extreme values and ignores how everything else is distributed.

Over a second dataset, 14, 18, 12, 20, 16, 11, 19, 13, 17, 15, the quartiles (inclusive method) give:

The spread of the middle 50 percent of this dataset
MeasureValue
Q1 (first quartile)13.25
Q3 (third quartile)17.75
IQR (Q3 – Q1)4.5

IQR is often preferred over the range because it only looks at the middle half of the sorted data, so a single extreme outlier at either end barely moves it, unlike the full range.

Sample versus population variance and standard deviation

Over the same first dataset, 4, 8, 6, 5, 9, 3, 8, 7, the two formulas give genuinely different numbers:

Same eight numbers, two divisors, two different answers
MeasureDivides byResult
Sample variancen – 1 = 74.50
Sample standard deviationn – 1 = 7 (then square root)2.12
Population variancen = 83.94
Population standard deviationn = 8 (then square root)1.98

Why n – 1, not n

Deviations are measured from the sample’s own mean, which slightly understates the true spread, so dividing by the full count n would systematically underestimate the population variance. Dividing by n – 1 instead, known as Bessel’s correction, makes the sample variance an unbiased estimator. The population formula, dividing by n, is only correct when the dataset genuinely already is the entire population, not just a sample drawn from it, which is the common case for almost all real analysis.

Standard deviation and variance measure the same thing, spread, but in different units: variance squares each deviation, which also squares the units, turning rupees into rupees squared, while taking the square root to get standard deviation returns the result to the data’s original units. This is also why the standard deviation, not the variance, is the one usually quoted alongside a mean.

How an outlier moves the mean and the median

Adding one large outlier, 50, to the small dataset 5, 7, 7, 10, 11 shows exactly why the median is often preferred when outliers are present:

One new value, two very different reactions
MeasureBefore (5, 7, 7, 10, 11)After adding 50Change
Mean8.0015.00+7.00
Median7.008.50+1.50

The mean adds every value together, so one extreme outlier drags it a long way; the median only depends on which value sits in the middle of the sorted order, so it barely moves. The same logic explains skew: a small dataset like 2, 3, 3, 4, 5, 50, where the mean sits well above the median, is right-skewed, with the large outlier pulling the mean up while the median stays anchored near the bulk of the data.

Weighted mean

A weighted mean lets some values count more than others, based on assigned weights, rather than treating every value equally. A student scoring 70 on a quiz worth 20 percent, 85 on a project worth 30 percent, and 90 on an exam worth 50 percent has a weighted average of:

70*0.2 + 85*0.3 + 90*0.5  =  14 + 25.5 + 45  =  84.50

Coefficient of variation

The coefficient of variation rescales the standard deviation by the mean, usually shown as a percentage, which makes it possible to compare variability across datasets measured on very different scales. Over a dataset of daily sales, 40, 45, 42, 48, 50, the sample standard deviation divided by the mean, times 100, gives a coefficient of variation of 9.2 percent.

The five-number summary, and trimmed means

The five-number summary, minimum, Q1, median, Q3 and maximum, describes a dataset’s full spread and centre in one compact set of numbers, and is also exactly what a boxplot is drawn from. A trimmed mean takes a related but different approach to outliers: it discards a set percentage of the most extreme values from each end of the sorted data before averaging the rest, reducing the influence of outliers without going as far as the median.

Common mistakes

  • Using the population formula on a sample. The n divisor is only correct when the data genuinely is the entire population; the n – 1 sample formula is the right default otherwise.
  • Reporting variance where standard deviation was meant. Variance is in squared units, which rarely has an intuitive meaning on its own.
  • Trusting the mean on a skewed dataset. A single large outlier can shift the mean far more than the median.
  • Averaging categorical data. Nominal categories like colours have no numeric value, so a mean has no meaningful interpretation; the mode is the measure that actually applies.
  • Comparing raw standard deviations across differently scaled datasets. The coefficient of variation, not the raw standard deviation, is the fair comparison.

Cheat sheet

Quick answers
QuestionAnswer
Which average is most pulled by outliers?The mean
Which average works on categorical data?The mode
What does a dataset with no repeats have?No mode
What divisor does sample variance use?n – 1 (Bessel's correction)
What divisor does population variance use?n
What is IQR?Q3 minus Q1, the spread of the middle 50 percent
What lets some values count more than others?A weighted mean
What makes variability comparable across scales?The coefficient of variation
What are the five numbers in a five-number summary?Minimum, Q1, median, Q3, maximum

Try it yourself

Quick check

A dataset of exam scores is 60, 62, 61, 63, 300 (the last one is a data-entry typo that should have been 30). Without fixing the typo yet, which measure, the mean or the median, still gives a reasonable sense of the other four students’ real performance, and why?

Show answer

The median. Sorted, the data is 60, 61, 62, 63, 300, and the median is 62, right in line with the other four genuine scores. The mean, (60+61+62+63+300)/5 = 109.2, is dragged far above every individual score by the one bad data point, which is exactly the situation the median is resistant to and the mean is not.

Frequently asked questions

What is the difference between mean, median and mode?

The mean is the sum of all values divided by the count. The median is the middle value once the data is sorted. The mode is the value that occurs most often. All three measure central tendency, but react very differently to outliers and work on different types of data.

What is the difference between sample variance and population variance?

Sample variance divides the sum of squared deviations by n – 1 (Bessel’s correction), which keeps it an unbiased estimator of the population’s true variance. Population variance divides by n, and is only correct when the dataset already is the entire population, not a sample from it.

Why is the median preferred over the mean for skewed data?

The mean sums every value, so a single extreme outlier can pull it a long way. The median only depends on which value sits in the middle of the sorted order, so it barely reacts to one extreme value.

What is the interquartile range (IQR)?

IQR is the third quartile minus the first quartile, Q3 – Q1, measuring the spread of the middle 50 percent of the data. It is less sensitive to outliers than the full range, which only looks at the minimum and maximum.

What is a weighted mean?

A weighted mean is an average where some values count more toward the result than others, based on assigned weights, such as a final grade combining a quiz, a project and an exam at different percentages.

What does the coefficient of variation measure?

The coefficient of variation is the standard deviation divided by the mean, usually expressed as a percentage, which measures relative variability and makes it possible to compare spread across datasets on very different scales.

Test yourself

Timed questions on Descriptive Statistics, with an explanation for every answer.

Take the Quiz
Upskly AI Team
Learning made simple
Scroll to Top