Describing Data
You've collected a pile of numbers. Before you can do anything clever with them, you need to summarize them: where does the data sit, and how spread out is it? Those two ideas, center and spread, are the heart of descriptive statistics.
Measures of center
"Center" means a single typical value that stands in for the whole batch. There are three common ones:
- The mean is the everyday average: add everything up, divide by how many there are. It's the balance point of the data.
- The median: line the values up smallest to largest and take the one in the middle. Half the data is below it, half above.
- The mode is the value that shows up most often.
They often land close together, but not always. The playground below shows exactly when, and why, they part ways.
🎮 Mean vs. Median Playground
Drag any dot along the line. Add a few, then drag one far to the right to make an outlier, and watch which marker chases it.
Why the median shrugs off outliers
The mean uses the actual value of every point, so one extreme number can yank it a long way — drag a single dot out to 100 and the orange mean marker follows it across the line. The median only cares about position (which value sits in the middle), so a lone extreme barely budges it. The teal median marker stays parked over the bulk of the data. (And when you meet an outlier in real data, deciding what to do with it is its own skill. See Outliers: Detect, Investigate, Decide.)
Rule of thumb: when data is roughly symmetric, mean and median agree; report the mean. When it's skewed or has outliers (incomes, reaction times, house prices), the median is the more honest summary of "typical."
Measures of spread
Center isn't the whole story: two datasets can share a mean but look completely different. Spread captures how tightly the values cluster:
- The range is biggest minus smallest. Simple, but driven entirely by the two extremes.
- The interquartile range is the width of the middle half of the data, so it ignores both tails on purpose. The next section builds it.
- The standard deviation is, roughly, the typical distance of a value from the mean. Small SD means the data huddles near the center; large SD means it's spread wide.
Quartiles, the five-number summary and the 1.5 × IQR rule
The median cuts a sorted batch in half. Cut each half in half again and you have the quartiles. Q1 sits a quarter of the way up the sorted values, Q3 three quarters of the way up, and the gap between them is the interquartile range. Both quartiles are positions rather than magnitudes, so a runaway value can no more drag them than it can drag the median.
The smallest value, Q1, the median, Q3 and the largest value are the five-number summary, and they are exactly what a boxplot draws. The step-through below builds one on eleven students' task times, in the order you would work it on paper.
🎯 The Five-Number Summary, Step by Step
Eleven students, and how long each took over the same task. Step through the five buttons to build the summary the textbook way: split the sorted times at the median, then take the median of each half. Then drag the slowest student further out and watch what refuses to move.
Steps 4 and 5 are the 1.5 × IQR rule. Measure one and a half interquartile ranges below Q1 and the same distance above Q3; those two marks are the fences, and any value beyond them gets drawn as its own point instead of being swallowed by a whisker. The whiskers reach only as far as the most extreme value still inside a fence, which is why the two are rarely the same length. Now drag the slowest time and notice what stays put. Q1, Q3, the IQR and both fences hold still all the way to 70 minutes, because not one of them reads how far out that value has gone. Only the flag and the right-hand whisker respond. A flag is a prompt rather than a verdict: it means look at this row, not delete it, and Outliers: Detect, Investigate, Decide takes the question from there.
Which halves? Two answers, and your exam wants one of them. The textbook method cuts the sorted list at the median and takes the median of each piece. Where n is odd, the middle value belongs to neither piece and sits the round out. That is what to do on paper, and it is what the picture above draws. Software mostly disagrees: R, Python and Excel interpolate between neighboring values, and SPSS's Frequencies menu applies a third rule again. On the eighteen contest totals below, the textbook method gives Q1 = 26 and Q3 = 39, R and Python give 26.25 and 38.25, and SPSS gives 26 and 40.75. All three are defensible and none is a blunder; the only real mistake is mixing them inside one answer. The descriptives calculator carries a switch for all three, and every other picture on this site is drawn the R/Python way.
Lined up together, the three centers say which way a batch leans. Eighteen finishing totals from a competitive eating contest have a mean of 34.39, a median of 28.75 and a mode of 26. Mean above median above mode is the signature of a right-skewed batch: most finishers bunch up low, and a long thin tail runs off toward the winner's 71. Reverse that order and the skew is to the left. When all three land in more or less the same place, the shape is roughly symmetric. The mean travels furthest because it is the only one of the three that reads a value's actual size, so the gap between mean and median is itself a rough measure of how hard the tail is pulling. Better than inferring the shape is seeing it, which is §1.4's job: it draws the histogram and works through reading a boxplot.
Where the standard deviation comes from
A value's deviation is how far it sits from the mean, with a sign attached: above the mean is positive, below is negative. That is where the name comes from. Add all the deviations up, though, and the total is always zero, because the mean is the balance point of the data. Averaging them directly gets you nowhere. Squaring is the standard way around that, and the four steps below build the rest of the number from there.
📏 Standard Deviation, Step by Step
Eight exam scores, and one number for how spread out they are. Step through the four buttons to build it, then pull the scores apart with the slider: the number grows, and so does the bell curve underneath.
Read those four steps left to right and you have the formula. Squaring gets rid of the minus signs, and it makes a score twice as far from the mean count four times as heavily. The squares are then added into a total that statisticians call the sum of squares, which turns up in almost every test later in this course. Dividing gives the average square, better known as the variance. The square root undoes the squaring and brings the answer back to the units you started in: squared exam points mean nothing to anyone, while exam points are something you can picture.
Step 3 divides by n − 1 rather than n, which looks like a typo and isn't one. A sample's values sit a little closer to their own mean than to the population's, so dividing by n would report a spread slightly narrower than the truth. The smaller divisor pushes the answer back up by the right amount, and once you have a few hundred values the correction is too small to see.
Below the squares is the normal curve that fits those eight scores, with the same mean and the same standard deviation. The mean fixes where the bell sits. The standard deviation fixes how wide it is, and nothing else about the shape can change: pull the scores apart and the bell spreads and flattens, keeping the same area underneath. The shaded band marks one SD either side of the mean, which is exactly where the curve falls most steeply, so with a little practice you can read a distribution's spread straight off its picture.
Standard deviation is the workhorse of the two; it shows up again the moment we standardize values into z-scores and everywhere after. If you would rather see the arithmetic than the animation, the mean, the variance and the SD are the first three rows of the printable formula sheet.
Got numbers of your own? Paste them into the descriptives calculator, which computes center, spread, and outlier flags, draws the histogram and boxplot, and even drafts the APA sentence for you. If you're unsure which of those two pictures belongs in your write-up, the chart chooser decides it in a couple of clicks.
Why it matters: "center and spread" is the vocabulary you'll use to describe every dataset for the rest of the course. Choosing the right summary, and knowing when the mean is lying to you, is a real, practical skill.
Want to work these out by hand before trusting a calculator with them? Problem 2 in the practice problems takes a mean, a median and a standard deviation over a nine-day dataset with one very odd day in it, and problem 16 builds a five-number summary and a boxplot from fifteen sorted values, textbook quartiles and all.
Common questions
When should I use the median instead of the mean?
Use the median when the data is skewed or contains outliers — incomes, house prices, reaction times. The mean gets dragged toward extreme values because it uses every value's actual magnitude; the median only cares about what's in the middle, so it stays a more honest "typical value." For roughly symmetric data the two agree, and the mean is standard.
Why does the sample standard deviation divide by n − 1 instead of n?
A sample's values are, on average, slightly closer to their own sample mean than to the true population mean, so dividing by n would systematically underestimate the population's spread. Dividing by n − 1 (Bessel's correction) inflates the result just enough to fix that bias. With large samples the difference becomes negligible.
Should I report the mean with the SD, or the median with the IQR?
Pair the center with its matching spread. The mean and SD belong together (both use every value's magnitude, so both are outlier-sensitive), and the median pairs with the interquartile range, the span of the middle 50% of the data, built from quartiles just like the median. For roughly symmetric data, mean (SD) is the standard report and what t-tests work with; for skewed or outlier-prone data, median and IQR give the honest picture. Our descriptives calculator computes both pairs so you can compare.