Chapter 2 · OpenStax Ch 2

Descriptive Statistics

Pictures and numbers that summarize the shape, center, and spread of a data set.

2.1 Histograms

A histogram sorts data into equal-width intervals called bins and draws a bar for each, as tall as the number of values inside. It is the quickest way to see the shape of a data set. The bars show where values pile up, where they thin out, and whether there is one hump or two.

The 80 commute times here never change. Drag the bin-width slider and watch the picture change anyway. Very narrow bins show every bump and look ragged. Wide bins look smooth but can hide the two groups of commuters entirely. Somewhere in between, the story is clearest. The frequency polygon joins the bar tops with a line, which makes comparing two histograms easier. When you read a histogram, always ask what bin width was used.

Reading: OpenStax Introductory Statistics, Sections 2.1, 2.2.

Try it

  1. The 80 commute times are fixed. Bin width starts at 5 minutes.
  2. Slide it down to 1. Every bump shows and Bins climbs. Some bumps are real and some are noise.
  3. Slide it up to 15. The picture smooths into a few wide bars that can hide two groups of commuters.
  4. Find the width where the shape is clearest, somewhere in between.
  5. Press Frequency polygon to join the bar tops with a line, which is easier to compare across histograms.

2.2 Center and location

Three numbers describe the “middle” of data, and they answer different questions. The mean \(\bar{x} = \frac{1}{n}\sum x_i\) is the balance point. If the dots were weights on a plank, the triangle is where it would balance. The median is the splitter, with half the dots on each side. The mode is the most common value, if any value repeats.

Drag one dot far to the right, or press the button. The mean chases it, because a far-away weight tips the plank. The median barely moves, because it only counts how many dots are on each side, not how far away they are. Values like this one are called outliers, and the median is resistant to them. For incomes and house prices, the median is usually the honest “typical” number.

Reading: OpenStax Introductory Statistics, Sections 2.3, 2.5.

Try it

  1. Nine points sit on the lane. Mean, Median and Mode describe them.
  2. Drag any point left or right, or focus it and use the arrow keys. All three readouts update.
  3. Press Push one point far out. The mean follows the outlier while the median barely moves.
  4. Drag two points onto the same value to make a mode.
  5. Reset returns the nine points.

2.3 Box plots and skewness

The quartiles cut sorted data into four equal parts. A quarter of the values lie below \(Q_1\), half below the median, and three quarters below \(Q_3\).1 A box plot draws a box from \(Q_1\) to \(Q_3\), a line at the median, and whiskers out to the smallest and largest values. The box width, \(Q_3 - Q_1\), is the interquartile range.

Slide the skew control. With the slider in the middle the data are symmetric and the mean sits on the median. Push it right and a tail of large values grows. The upper whisker stretches, and the mean is dragged above the median. That is a right-skewed distribution. Push it left for the mirror image. The gap between mean and median is a quick test for skew.

1 Quartiles on this site use the Weibull rule, position \((n+1)p\) in the sorted data. Reading: OpenStax Introductory Statistics, Sections 2.4, 2.6.

Try it

  1. Skew starts at 0 and the data are symmetric. Mean − median is near zero.
  2. Slide Skew right toward 1. A tail of large values grows and the upper whisker stretches.
  3. Watch Mean climb above Median. The tail pulls the mean, not the median.
  4. Slide left toward −1 for the mirror image, with the mean below the median.
  5. New draw takes a fresh sample at the same skew, so the same shape appears with different values.

2.4 Spread

Each stick is one value's deviation from the mean, \(x_i - \bar{x}\). Deviations always add to zero, so to measure spread we square them first. Press “Show squares”: each stick becomes a square whose area is the squared deviation. The variance is the average square.2 The standard deviation is its square root,

\[s = \sqrt{\frac{\sum (x_i - \bar{x})^2}{n - 1}}.\]

Taking the square root brings the number back to the original units, so \(s\) reads as a typical distance from the mean. Drag the dots apart and the squares grow fast. A point twice as far contributes four times as much. Press “Bunch up” and \(s\) shrinks. The mean does not care about spread. The standard deviation cares about nothing else.

2 The sample variance divides by \(n - 1\), not \(n\), because the mean was estimated from the same data. Reading: OpenStax Introductory Statistics, Section 2.7.

Try it

  1. Eight points sit on the lane, each with a stick to the mean.
  2. Drag one point away from the mean. Its stick lengthens and Sample SD rises.
  3. Press Show squares. Each squared deviation becomes a square. Sum of squared deviations is their total area.
  4. Press Spread out and then Bunch up. The squares grow and shrink faster than the sticks.
  5. Bunch the points onto one value and the SD reaches zero.

Why sample variance divides by n − 1

Transcript

Why sample variance divides by n − 1.

Three values from one population. Their mean is 40.3.

Deviations from the sample mean always add up to zero.

So the third deviation is fixed by the other two. Only two are free.

The sample mean sits closer to its own data than μ does. Dividing by n underestimates.

20,000 samples of three from a population with variance 100. Average of each formula.

n − 1 counts the free deviations. That is the whole correction.