Descriptive Statistics

Summarise and visualise data before analysing it. Learn mean, median and mode, range, variance and standard deviation, percentiles, quartiles and IQR, outliers, skewness and kurtosis, histograms, box plots, scatter plots and probability plots.

Test results, sensor logs and production measurements are only useful once summarised. Descriptive statistics reveal the centre, spread and shape of data and flag outliers that could indicate faults.

An analogy

Descriptive statistics are like a quick health check-up for data: a few vital signs (mean, spread, shape) tell you whether something looks unusual.

Centre

Mean uses all values but is pulled by outliers; median is robust; mode is the most frequent value. For skewed data (repair times, incomes) report the median.

Spread

Range is simple but sensitive to extremes; standard deviation is standard (use n − 1 for samples); IQR is robust. Box plots show median, quartiles and outliers at a glance.

Shape and plots

Histograms show distribution shape; skewness measures asymmetry; kurtosis tail weight. Normal probability plots test normality (points on a line). Scatter plots show relationships.

Data quality

Check units, missing values, sensor dropouts and outliers before analysis. Investigate outliers rather than deleting them automatically — they may be the most important data.

Formulas

Worked example: Shaft diameters

Given: 12.1, 11.8, 12.4, 12.0, 11.9, 12.3, 12.2, 11.7, 12.0, 12.6 mm

Find: Mean, median, s.

Answer: 12.10, 12.05, 0.279 mm

Worked example: Outlier check

Given: Q₁ = 11.9, Q₃ = 12.3

Find: Fences.

Answer: No outliers (12.6 is within)

Summaries, confidence interval, t-test and Cpk (Python)

import statistics as st
from math import sqrt

# Shaft diameters (mm) from a production sample
d = [12.1, 11.8, 12.4, 12.0, 11.9, 12.3, 12.2, 11.7, 12.0, 12.6]
n, mean, s = len(d), st.mean(d), st.stdev(d)
t95 = 2.262                                   # t(0.975, df = 9)
half = t95 * s / sqrt(n)
print(f"n = {n}, mean = {mean:.3f}, median = {st.median(d):.3f}, s = {s:.4f}")
print(f"95% CI for the mean: {mean - half:.3f} .. {mean + half:.3f} mm")

# One-sample t statistic against the nominal 12.0 mm
t = (mean - 12.0) / (s / sqrt(n))
print(f"t = {t:.3f}  (|t| < 2.262 -> no significant shift at 5%)")

# Process capability with spec 11.2 .. 12.8 mm
cpk = min(12.8 - mean, mean - 11.2) / (3 * s)
print(f"Cpk = {cpk:.3f}")
# n = 10, mean = 12.100, median = 12.050, s = 0.2789
# 95% CI for the mean: 11.901 .. 12.299 mm
# t = 1.134  (|t| < 2.262 -> no significant shift at 5%)
# Cpk = 0.837

The whole statistics workflow of this module in a few lines: describe, estimate with a confidence interval, test a hypothesis, and judge capability against specifications.

Common mistakes

Applications

Key takeaways

Going further