Section 1.3

Describing Data

You've collected a pile of numbers. Before you analyze them, you need to summarize them: where is the middle of the data, and how spread out is it? Descriptive statistics is mostly about those two ideas, center and spread.

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.

The three are often close together, but not always. The playground below shows when they differ, and why.

🎮 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.

● Mean—
● Median—
Std. deviation—
Count—

Why the median resists outliers

The mean uses the actual value of every point, so one extreme number can pull it a long way. Drag a single dot out to 100 and the orange mean marker follows it across the line. The median depends only on position (which value is in the middle), so a lone extreme value barely moves it, and the teal median marker stays over the bulk of the data. (When you meet an outlier in real data, deciding what to do with it is a separate 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 closer to what most people would call "typical."

Measures of spread

Center alone is not enough: two datasets can share a mean but look completely different. Spread measures 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 is 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. Like the median, the quartiles depend only on the order of the values, so one extreme value cannot drag them either.

The smallest value, Q1, the median, Q3 and the largest value are the five-number summary, and a boxplot draws those five values. 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 see which numbers stay the same.

Min—
Q1—
Median—
Q3—
Max—
IQR—
Lower fence—
Upper fence—
Flagged—

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. Any value beyond a fence is drawn as its own point, and each whisker stops at the most extreme value still inside its fence. That is why the two whiskers are rarely the same length. Now drag the slowest time. Q1, Q3, the IQR and both fences stay the same all the way to 70 minutes, because none of them depends on how far out that value is. Only the flag and the right-hand whisker change. A flag means you should look at that row, not that you should delete it. Outliers: Detect, Investigate, Decide covers what to do next.

Quartiles: textbooks and software disagree. 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. That is what to do on paper, and it is what the picture above draws. Most software uses a different rule: R, Python and Excel interpolate between neighboring values, and SPSS's Frequencies menu uses a third rule. 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 accepted conventions. The mistake to avoid is mixing them within one answer. The descriptives calculator has a switch for all three, and every other chart on this site uses the R/Python method.

The order of the three centers tells you 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 pattern of a right-skewed batch: most finishers are bunched at the low end, and a long thin tail runs out to the winner's 71. Reverse that order and the skew is to the left. When all three are about the same, the shape is roughly symmetric. The mean moves furthest because it is the only one of the three that uses each value's actual size. So the gap between the mean and the median is a rough measure of how strong the skew is. You can also see the shape directly: §1.4 draws the histogram and shows how to read a boxplot.

Where the standard deviation comes from

A value's deviation is its distance 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, so their average is always zero as well. The standard fix is to square them, and the four steps below build the standard deviation 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.

Mean—
Sum of deviations—
Sum of squares—
Variance—
Std. deviation—

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. Adding up the squares gives a total called the sum of squares. It 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 are hard to interpret, while exam points are easy to picture.

Step 3 divides by n − 1 rather than n, which looks like a typo and isn't one. A sample's values are 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 with the same mean and standard deviation as those eight scores. The mean sets where the bell is centered. The standard deviation sets 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. The curve is steepest at the edges of that band, so with a little practice you can read a distribution's spread straight off its picture.

The standard deviation is the measure of spread you will use most. It comes back as soon as you standardize values into z-scores, and in almost every lesson after that. The formulas for the mean, the variance and the SD are the first three rows of the printable formula sheet.

To summarize your own numbers, paste them into the descriptives calculator. It computes center, spread and outlier flags, draws the histogram and boxplot, and drafts the APA sentence. If you're unsure which of those two charts belongs in your write-up, the chart chooser helps you decide 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. You will often have to choose between the mean and the median, and to recognize when outliers or skew make the mean misleading.

Want to work these out by hand first? Problem 2 in the practice problems computes a mean, a median and a standard deviation for a nine-day dataset with one very odd day in it. In problem 16 you build a five-number summary and a boxplot from fifteen sorted values, using textbook quartiles.

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 pulled toward extreme values because it uses every value's actual magnitude. The median depends only on which value is in the middle, so it stays closer to a "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 sensitive to outliers. 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 are more representative. The descriptives calculator computes both pairs so you can compare.