Variance, standard deviation, and IQR of grouped data

MathematicsStatisticsAges 17–18

Use with my class

Two samples with the same mean but different spread are grouped and plotted overlapping each other. Drag each sample's σ slider to watch the histogram flatten out or bunch up; the simulation computes the range, quartiles Q₁ and Q₃, the interquartile range, variance, and standard deviation using the grouped-data formulas, then compares the two samples.

Lesson: Range, interquartile range, variance, and standard deviation of grouped data

What it shows

Two samples can share the same mean and still differ greatly in spread. For grouped data, each class is represented by its midpoint: the variance adds the frequency-weighted squared deviations of the midpoints from the mean and divides by n − 1 for the sample variance s² (or by n for the population form σ²), and the standard deviation is its square root, measured in the same units as the data. The quartiles Q₁ and Q₃ are found by interpolation inside the classes that contain them, and the interquartile range Q₃ − Q₁ covers the middle half of the data. The range depends only on the two extreme classes, so a few unusual values can change it a lot.

How to use

Keep the Common mean of both samples fixed, set Standard deviation of sample A (σ₁) small and Standard deviation of sample B (σ₂) large, and compare the overlapping histograms and the x̄ ± s brackets. Click Show Q₁, Q₃ to add the quartile brackets and read the statistics table. Change Class width h to see how grouping shifts the computed values slightly, and click New sample to see which statistics vary most from one sample to the next.

Parameters you can change

  • Sample size n 30–500
  • Common mean of both samples 30–70
  • Population SD used to generate sample A (σ₁) 2–25
  • Population SD used to generate sample B (σ₂) 2–25
  • Class width h 5–20

Questions to explore

  1. Two classes have the same mean test score. Which statistic shows which class performed more consistently, and how?
  2. Why is the interquartile range less affected by a few extreme values than the range?
  3. If the data are marks out of 100, what are the units of the variance and of the standard deviation?