Descriptive Statistics › Visual Examples

Michael BrenndoerferUpdated December 25, 20258 min read
Machine Learning from ScratchAll chapters
Part 1 of 9Statistics 101
Chapter 2Descriptive Statistics › Visual Examples
Reading section 6 of 11 · Visual Examples · 8 minSection 6 of 11 · 8 min

Book contents

Section 6 of 11 · 8 min read

Descriptive Statistics › Visual ExamplesOne section · Sections in this chapter6 / 11 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Visualizing descriptive statistics makes these concepts clearer, helping us see patterns more easily. The following examples show how distributions can differ in their centers and spreads as well as in their overall shapes.

Example: Comparing Distributions with Different Properties

This visualization compares three distributions: a symmetric normal distribution, a right-skewed distribution, and a high-kurtosis distribution with heavy tails. Each plot includes reference lines showing the mean with a solid line and the median with a dashed line to illustrate how these measures respond to distributional shape.

Out[2]:
Visualization
Histogram of a symmetric normal distribution with nearly overlapping vertical lines for the mean and median.
A symmetric normal distribution keeps its mean and median nearly aligned at the center. The balanced shape has skewness near zero and moderate tails.
Histogram of a right-skewed distribution with a long tail to the right and the mean line positioned above the median.
A right-skewed distribution pulls the mean above the median as a small number of large values extend the right tail. This pattern is common in income, prices, and response times.
Histogram of a symmetric heavy-tailed distribution with observations extending far into both tails.
This heavy-tailed sample keeps its mean and median close while producing extreme observations on both sides. Its positive sample excess kurtosis reflects the strong contribution of those extremes.

Example: The 68-95-99.7 Rule

The empirical rule gives an easy way to understand standard deviation. Under a normal model, approximately 68% of probability lies within one population standard deviation of the mean, 95% within two, and 99.7% within three. Proportions in a finite random sample fluctuate around these population probabilities.

Out[3]:
Visualization
Normal distribution curve with nested blue, teal, and amber bands marking 68%, 95%, and 99.7% coverage within one, two, and three standard deviations of the mean.
Nested bands under a normal density show that about 68% of probability lies within one population standard deviation of the mean, 95% within two, and 99.7% within three. Probability beyond the outer band is correspondingly small.

Example: Box Plot Comparison

Box plots give a compact visual summary of distribution characteristics. This example compares the same three distributions using box plots to emphasize how the IQR captures central spread and the conventional fences flag potential outliers [11].

Out[4]:
Visualization
Three vertical box plots compare normal, right-skewed, and heavy-tailed samples. The skewed sample has upper potential outliers while the heavy-tailed sample has many potential outliers above and below the whiskers.
Box plots compress each distribution into its median, interquartile range, whiskers, and 1.5-IQR fliers. The normal sample is balanced, the right-skewed sample produces high-side potential outliers, and the heavy-tailed sample produces potential outliers in both directions.

Example: Measures of Spread Visualization

This example compares the range and IQR with standard deviation to show how each measure captures variability in data. It also shows how these measures behave when outliers are present.

Out[5]:
Visualization
Scatter plot of 100 observations with no points outside the 1.5-IQR fences, with horizontal lines marking the mean, one and two standard deviations, and a shaded interquartile range.
In a baseline sample with no 1.5-IQR potential outliers, the standard deviation bands and interquartile range describe the central spread.
Scatter plot after replacing two observations with low and high extremes, showing wider standard deviation bands while the shaded interquartile range changes much less.
Replacing two observations with low and high extremes expands the range and standard deviation while the interquartile range changes much less.