DEV Community

Michael Lip
Michael Lip

Posted on • Originally published at zovo.one

Why Most People Get Descriptive Statistics Wrong (And How to Fix It)

I review pull requests that include statistical summaries at least a few times a month. The most common mistake is not a wrong formula. It is using the wrong formula in the right place. Specifically, confusing population standard deviation with sample standard deviation.

If that distinction sounds trivial, it is not. It changes your results, and the downstream decisions built on those results, in ways that compound as your data grows.

The core measures and when they mislead

Descriptive statistics boil down to a few categories: central tendency (mean, median, mode), spread (range, variance, standard deviation), and distribution shape (skewness, kurtosis). Most people can calculate a mean. The problems start with spread.

Mean vs. median. The mean of [1, 2, 3, 4, 100] is 22. The median is 3. If you are summarizing user response times and one outlier spiked to 100 seconds because of a cold cache, the mean tells a story that does not match reality. Median is robust to outliers. Mean is not. Yet I see mean used as the default summary statistic in dashboards everywhere.

Sample vs. population standard deviation. If you measured the height of every person in a room, you have the population. Use N in the denominator. If you measured 30 people to estimate the heights of everyone in a city, you have a sample. Use N-1. The N-1 correction (Bessel's correction) accounts for the fact that a sample underestimates variability. On small samples, this matters a lot. On a sample of 5, the difference between dividing by 5 vs. 4 is a 25% change in variance.

Population variance: sum((xi - mean)^2) / N
Sample variance:     sum((xi - mean)^2) / (N - 1)
Enter fullscreen mode Exit fullscreen mode

Range is almost useless. Range tells you the gap between your minimum and maximum. It is entirely determined by two data points and ignores everything in between. Interquartile range (Q3 - Q1) is almost always more informative because it describes the spread of the middle 50% of your data.

Practical examples where this matters

A/B testing. You run a test with 500 users per variant. Variant B has a 3.2% conversion rate vs. Variant A at 2.8%. Is that significant? You need the standard error of the proportion, which depends on variance. Use the wrong denominator and you will either ship a change that was noise, or kill a winner.

Performance monitoring. Your API has a mean response time of 45ms. Great. But the 95th percentile is 1,200ms. The standard deviation is 380ms. That mean is masking a bimodal distribution: most requests are fast, but a meaningful chunk is terrible. Percentiles and standard deviation together tell the real story.

Financial modeling. You are estimating the expected return of a portfolio based on 10 years of monthly returns. That is 120 samples from a much larger theoretical population. Sample standard deviation. If you treat it as population standard deviation, you are underestimating risk.

Skewness and kurtosis: the measures nobody checks

Skewness tells you whether your distribution leans left or right. A skewness of 0 means symmetric (like a normal distribution). Positive skewness means a long right tail (common in income data, response times, and file sizes). Negative skewness means a long left tail.

Kurtosis tells you about the tails. High kurtosis means more extreme values than a normal distribution would predict. Financial returns have high kurtosis, which is why "once in a century" market crashes happen every decade.

These measures matter because most statistical tests assume normality. If your data is heavily skewed or has high kurtosis, tests like the t-test become unreliable. Checking skewness and kurtosis before running further analysis is a two-second sanity check that prevents bad conclusions.

Doing this by hand is error-prone

Even with a spreadsheet, computing a full descriptive statistics summary is tedious and easy to mess up. You need mean, median, mode, range, IQR, variance, standard deviation (both types), skewness, kurtosis, and ideally a histogram or frequency distribution.

I built a statistics calculator at zovo.one/free-tools/statistics-calculator that takes a dataset and computes all of these in one pass. Paste your numbers, get the full summary. It is especially useful when you need a quick sanity check on data before committing to a more complex analysis.

The goal is never to skip understanding the math. It is to stop making mistakes in the math that you already understand.

I'm Michael Lip. I build free developer tools at zovo.one. 500+ tools, all private, all free.

Top comments (0)