Descriptive Statistics Variance & SD Grouped Data 40 min read November 1, 2026
BY: Statistics Fundamentals Team
Reviewed By: Minsa A (Senior Statistics Editor)

Measures of Dispersion: Range, Variance, Standard Deviation & More

Measures of dispersion, also called measures of variability or spread, describe how far apart data values are from each other and from the center of a distribution. The most common measures are the range, interquartile range (IQR), mean deviation, variance, standard deviation, and coefficient of variation. Together with measures of central tendency, they give a complete picture of any dataset.

Range ↓ IQR ↓ Mean Deviation ↓ Variance ↓ Standard Deviation ↓ Coeff. of Variation ↓ Grouped Data ↓ When to Use ↓ Python & Excel ↓

📊 Dispersion Calculator

Enter comma-separated numbers to calculate all major measures of dispersion instantly.

What Are Measures of Dispersion?

Measures of central tendency tell you where data clusters, but they leave out half the story. Two datasets can have the same mean yet look nothing alike:

The Core Problem

Dataset A: {98, 99, 100, 101, 102} — Mean = 100

Dataset B: {1, 50, 100, 150, 199} — Mean = 100

✓ Same mean. Completely different spread. You need a measure of dispersion to tell these datasets apart — the mean alone cannot do it.

Dispersion is also called variability, spread, or scatter. The larger the dispersion measure, the more spread out the data values are. A dispersion of zero means every value is identical.

Absolute vs. Relative Measures of Dispersion

All dispersion measures fall into one of two categories. Absolute measures are expressed in the same units as the raw data and describe the actual scatter of values. Relative measures are dimensionless ratios that allow fair comparison across datasets with different units or different means.

FeatureAbsolute MeasuresRelative Measures
UnitsSame as original dataNo units (dimensionless)
Use caseSingle dataset descriptionComparing two or more datasets
ExamplesRange, IQR, SD, VarianceCV, Coefficient of QD
SensitivityDepends on units and scaleScale-independent

Range — Definition, Formula, and Examples

The range is the simplest measure of dispersion: the difference between the maximum and minimum values in a dataset. You can calculate it in seconds, which makes it a useful first look at any data — but it tells you nothing about what happens between the extremes.

Range — Ungrouped Data
Range = Xmax − Xmin
Range — Grouped Data
Range = Upper boundary of highest class − Lower boundary of lowest class
Worked Example — Ungrouped

Dataset: {23, 56, 45, 65, 59, 55, 62, 54, 85, 25}

1

Find maximum: 85

2

Find minimum: 23

3

Range = 85 − 23 = 62

✓ Range = 62. This single number hides all the variation in between — note how it takes just two data points to compute it.

For grouped data with classes 10–20, 20–30, 30–40, 40–50: Range = 50 − 10 = 40.

Coefficient of Range (Relative Measure)

Coefficient of Range
Coefficient of Range = (Xmax − Xmin) / (Xmax + Xmin)

Advantages and Disadvantages of Range

AdvantagesDisadvantages
Simplest and fastest to calculateUses only 2 values — ignores everything in between
Easy for anyone to understandExtremely sensitive to outliers
Good for quick quality-control checksCannot be calculated for open-ended distributions
Detects data entry errors immediatelyGets larger as sample size grows (not stable)
⚠️
Do not rely on range alone

Never use range as your only dispersion measure for serious analysis. A single unusual value completely redefines it. Always follow up with IQR or standard deviation. The dedicated range page covers additional edge cases.

Interquartile Range (IQR) and Quartile Deviation

The interquartile range measures the spread of the middle 50% of data — the range between the first quartile (Q1) and the third quartile (Q3). Because it ignores both tails, it resists the influence of outliers and is the natural partner to the median.

How to Find Q1, Q2, and Q3

Quartiles divide ordered data into four equal parts. Their positions are:

  • Q1 (25th percentile): position (n+1)/4
  • Q2 (50th percentile, median): position (n+1)/2
  • Q3 (75th percentile): position 3(n+1)/4

When a position falls between two values, interpolate by averaging the two surrounding values. For a deeper walkthrough of how percentiles relate to quartiles, see percentiles.

Worked Example — Finding Q1, Q2, Q3

Dataset (n = 10): {3, 7, 8, 12, 14, 18, 21, 25, 29, 35}

1

Data is already sorted. n = 10.

2

Q1 position: (10+1)/4 = 2.75. Interpolate between 2nd (7) and 3rd (8) values: Q1 = 7 + 0.75(8−7) = 7.75

3

Q2 position: (10+1)/2 = 5.5. Average of 5th (14) and 6th (18): Q2 = (14+18)/2 = 16

4

Q3 position: 3(10+1)/4 = 8.25. Interpolate between 8th (25) and 9th (29): Q3 = 25 + 0.25(29−25) = 26

5

IQR = Q3 − Q1 = 26 − 7.75 = 18.25

✓ IQR = 18.25. Use the IQR calculator to verify any dataset. The five-number summary calculator extends this to Min, Q1, Q2, Q3, Max.

IQR Formula
IQR = Q3 − Q1

Quartile Deviation (Semi-IQR)

Quartile Deviation
QD = (Q3 − Q1) / 2

Also called the semi-interquartile range, this tells you the typical distance from the median to either quartile. The relative version for cross-dataset comparison:

Coefficient of Quartile Deviation
Coeff. of QD = (Q3 − Q1) / (Q3 + Q1)

Five-Number Summary and Box Plots

The five-number summary {Min, Q1, Q2, Q3, Max} is the natural extension of quartiles. In a box plot, the box spans Q1 to Q3 (the IQR), and the whiskers extend to the minimum and maximum non-outlier values. Any point beyond 1.5 × IQR from Q1 or Q3 is typically flagged as a potential outlier.

Advantages and Disadvantages of IQR

AdvantagesDisadvantages
Not affected by extreme outliersIgnores data outside the middle 50%
Best choice for skewed distributionsLess algebraically tractable than SD
Works for ordinal dataDoes not use all data values
Natural partner to the medianLess informative for symmetric data

See the full interquartile range page for additional examples, including the IQR method for outlier detection.

Mean Deviation — Definition, Formula, and Examples

Mean deviation (also called mean absolute deviation or MAD) is the arithmetic mean of the absolute differences between each data point and a central value — usually the mean or the median. It is more intuitive than variance because it stays in the original units and avoids squared values.

Why Absolute Values?

Without absolute values, positive and negative deviations cancel exactly. For any dataset, the deviations from the mean always sum to zero. The absolute value keeps the sign from destroying the information.

Mean Deviation About the Mean (Ungrouped Data)

Mean Deviation — About the Mean
M.D.(x̄) = Σ|xᵢ − x̄| / n
Worked Example — Mean Deviation

Dataset: {2, 4, 6, 8, 10}

1

Mean: (2+4+6+8+10)/5 = 30/5 = 6

2

Absolute deviations: |2−6|=4, |4−6|=2, |6−6|=0, |8−6|=2, |10−6|=4

3

Sum of |deviations|: 4+2+0+2+4 = 12

4

M.D. = 12/5 = 2.4

✓ Mean Deviation = 2.4. On average, each value deviates 2.4 units from the mean of 6.

Mean Deviation About the Median

Mean Deviation — About the Median
M.D.(Median) = Σ|xᵢ − Median| / n

Mean deviation is minimized when calculated about the median. This is why some analysts prefer this version — the median minimizes the sum of absolute deviations, making M.D.(Median) the smallest possible value for any central reference point you choose.

Mean Deviation for Grouped Data

Mean Deviation — Grouped Data
M.D.(x̄) = Σfᵢ|xᵢ − x̄| / Σfᵢ
xᵢ = class midpoint fᵢ = class frequency x̄ = weighted mean from grouped data

MAD vs. Standard Deviation — Why Statistics Prefers SD

FeatureMean Absolute DeviationStandard Deviation
FormulaAverage of |deviations|√(Average of squared deviations)
Weight on outliersEqual weight (linear)Greater weight (squaring amplifies)
UnitsSame as dataSame as data
Mathematical tractabilityPoor (not differentiable at zero)Excellent (calculus-friendly)
Use in further statisticsRarelyConstant (ANOVA, regression, t-tests)
RobustnessMore robust to outliersLess robust

Standard deviation is preferred over MAD not because it is more intuitive, but because squared deviations have superior mathematical properties. They are differentiable, additive across independent groups, and they link directly to the variance used in every major statistical test.

Variance — Definition, Formula, and Examples

Variance is the average of the squared deviations from the mean. Squaring solves the sign cancellation problem (negative and positive deviations no longer cancel) while maintaining the algebraic properties that make further statistical work possible. For a standalone treatment, see the variance page.

Population Variance

Population Variance
σ² = Σ(xᵢ − μ)² / N
μ = population mean N = population size

Sample Variance (Bessel's Correction)

Sample Variance
s² = Σ(xᵢ − x̄)² / (n−1)
x̄ = sample mean n = sample size n−1 = degrees of freedom

Why n−1 Instead of n? — Bessel's Correction Fully Explained

The Intuition Behind n−1

The problem with dividing by n: The sample mean x̄ is calculated from the same data as the deviations. Because x̄ is by definition the value that minimizes the sum of squared deviations from the sample, using it instead of the unknown true population mean μ causes the sum of squared deviations to be systematically smaller than it would be if you knew μ. The sample clusters around its own mean more tightly than around the population mean.

The fix: Dividing by n−1 instead of n makes the sample variance slightly larger, which exactly compensates for this systematic underestimation. The result, s², is an unbiased estimator of σ² — meaning that across many samples, the average of s² equals σ².

Why n−1 specifically? One degree of freedom is consumed by the constraint that the deviations must sum to zero once x̄ is known. With n deviations forced to sum to zero, only n−1 can vary freely. The remaining one is determined by the others.

Practical rule: Data from an entire population → divide by N. Data from a sample estimating a population → divide by n−1.

Worked Example — Population vs. Sample Variance

Dataset: {4, 7, 13, 16} (n = 4, Mean = 10)

1

Squared deviations: (4−10)² = 36, (7−10)² = 9, (13−10)² = 9, (16−10)² = 36

2

Sum of squared deviations: 36+9+9+36 = 90

3

Population variance (÷ N=4): 90/4 = 22.5

4

Sample variance (÷ n−1=3): 90/3 = 30

✓ The sample variance (30) is larger than the population variance (22.5). This difference is what Bessel's correction accounts for.

Variance for Grouped Data

Variance — Grouped Data (Direct Method)
σ² = Σfᵢ(xᵢ − x̄)² / Σfᵢ
xᵢ = class midpoint fᵢ = class frequency

Step-Deviation Method for Grouped Data

When class widths are equal, this shortcut saves significant arithmetic. Define a coded variable uᵢ for each class:

Step-Deviation Method — Variance
uᵢ = (xᵢ − A) / h
σ² = h² × [ (Σfᵢuᵢ²/Σfᵢ) − (Σfᵢuᵢ/Σfᵢ)² ]
A = assumed mean (choose a convenient midpoint) h = class width

The Problem with Squared Units

Variance is expressed in squared units. If your data is in metres, variance is in metres². A variance of 9 m² does not mean "9 metres of spread" — it means the squared average deviation is 9 m². This is why the standard deviation, which takes the square root and restores the original units, is what gets reported in most practical contexts. Variance remains essential inside formulas for ANOVA, regression, and related methods — see ANOVA.

Properties of Variance

  • Non-negative: σ² ≥ 0 always. If σ² = 0, every value in the dataset is identical.
  • Adding a constant: Var(X + c) = Var(X). Shifting all values by the same amount does not change variance.
  • Multiplying by a constant: Var(cX) = c² × Var(X). Scaling by c multiplies variance by c².
  • Independent samples: Var(X + Y) = Var(X) + Var(Y) when X and Y are independent.

When Variance > SD and When SD > Variance

ℹ️
A common misconception: SD is always smaller than variance

This is false. If σ² = 4 → σ = 2 (SD < variance). If σ² = 0.25 → σ = 0.5 (SD > variance). If σ² = 1 → σ = 1 (equal). The relationship depends entirely on the scale of the data, not on any mathematical rule.

Standard Deviation — Definition, Formula, and Examples

Standard deviation is the positive square root of variance. It restores the measure of dispersion to the original units of the data, making it directly interpretable. It is the most widely used measure of spread for continuous, approximately symmetric data. For a standalone treatment, see the standard deviation page.

Population Standard Deviation

Population Standard Deviation
σ = √[ Σ(xᵢ − μ)² / N ]

Sample Standard Deviation

Sample Standard Deviation
s = √[ Σ(xᵢ − x̄)² / (n−1) ]

Step-by-Step Calculation (6 Steps)

Worked Example — 8 Data Points

Dataset: {12, 14, 15, 16, 18, 19, 20, 22}

1

Find the mean: (12+14+15+16+18+19+20+22)/8 = 136/8 = 17

2

Deviations from mean (xᵢ − 17): −5, −3, −2, −1, +1, +2, +3, +5

3

Squared deviations: 25, 9, 4, 1, 1, 4, 9, 25

4

Sum of squared deviations: 25+9+4+1+1+4+9+25 = 78

5

Sample variance: s² = 78 / (8−1) = 78/7 ≈ 11.14

6

Sample SD: s = √11.14 ≈ 3.34

✓ s ≈ 3.34. This means individual values in the dataset typically deviate about 3.34 units from the mean of 17.

Standard Deviation for Grouped Data

SD — Grouped Data (Direct Method)
σ = √[ Σfᵢ(xᵢ − x̄)² / Σfᵢ ]
SD — Grouped Data (Step-Deviation Method)
σ = h × √[ (Σfᵢuᵢ²/Σfᵢ) − (Σfᵢuᵢ/Σfᵢ)² ]
uᵢ = (xᵢ − A) / h A = assumed mean h = class width

Standard Deviation and the Empirical Rule

For data that follows a normal distribution, the empirical rule tells you exactly how much of the data falls within each band of standard deviations:

Distance from Mean% of Data Covered (Normal Distribution)
μ ± 1σ68.27%
μ ± 2σ95.45%
μ ± 3σ99.73%

Standard Deviation vs. Standard Error — Full Comparison

Confusing these two is one of the most common errors in published research. They answer different questions entirely.

Standard Deviation (SD)Standard Error (SEM)
What it measuresSpread of individual data valuesPrecision of the sample mean
Formulas = √[Σ(x−x̄)²/(n−1)]SEM = s / √n
Effect of larger nRelatively stableDecreases (more precise)
When to reportDescribing spread in the dataConstructing confidence intervals
Common misuseUsing SEM to appear less variableTreating as a data descriptor

See standard deviation vs. standard error and the standard error page for further detail.

Properties of Standard Deviation

  • Always ≥ 0; equals zero only when all values are identical.
  • Uses every data point in its calculation.
  • Same units as the original data (unlike variance).
  • Adding a constant c to every value leaves σ unchanged.
  • Multiplying every value by a constant c multiplies σ by |c|.
  • It is not an unbiased estimator of σ (unlike s² for σ²), though the bias is negligible for large n.

Advantages and Disadvantages of Standard Deviation

AdvantagesDisadvantages
Uses all data valuesSensitive to outliers (squaring amplifies them)
Same units as dataLess appropriate for skewed distributions
Foundation for t-tests, ANOVA, regressionMore complex to compute than range or IQR
Can be combined across groups (pooled SD)Requires interval or ratio-level data

Coefficient of Variation (CV)

The coefficient of variation is the only dispersion measure that is truly dimensionless. By expressing standard deviation as a percentage of the mean, it lets you compare variability across datasets that have different units or very different means — something no absolute measure can do. See the standalone coefficient of variation page for worked examples.

Coefficient of Variation
CV = (σ / μ) × 100% [population]
CV = (s / x̄) × 100% [sample]
Classic CV Example — Two Factories

Comparing wage consistency across two factories

1

Factory A: Mean wage = ₹400, SD = ₹40 → CV = (40/400) × 100 = 10%

2

Factory B: Mean wage = ₹500, SD = ₹75 → CV = (75/500) × 100 = 15%

✓ Factory B has both higher mean wages and higher absolute SD — but its wages are more variable relative to the mean. Factory A (CV = 10%) has a more uniform pay structure. Without CV, this comparison would be impossible because the means differ.

When to Use CV

  • Comparing variability of datasets with different units (e.g., heights in cm vs. weights in kg)
  • Comparing datasets with very different means (e.g., salaries in two countries)
  • Investment analysis: comparing risk per unit of return across assets

When NOT to Use CV

  • When the mean is zero or near-zero (CV becomes infinite or meaningless)
  • When data is on an interval scale without a true zero (e.g., temperature in Celsius — a 0°C mean does not mean "no temperature")
  • When data contains negative values
⚠️
CV requires a ratio scale

CV is only meaningful when the data has a true zero point. Celsius temperature, arbitrary index scores, and similar interval-scale data should not have a CV calculated on them.

All Formulas at a Glance

The tables below consolidate every formula covered on this page for quick reference.

Absolute Measures

MeasureUngrouped FormulaGrouped FormulaUnits
RangeXmax − XminUpper − Lower class boundarySame as data
IQRQ3 − Q1Q3 − Q1Same as data
Quartile Deviation(Q3 − Q1) / 2(Q3 − Q1) / 2Same as data
Mean Deviation (mean)Σ|xᵢ − x̄| / nΣfᵢ|xᵢ − x̄| / ΣfᵢSame as data
Mean Deviation (median)Σ|xᵢ − Med| / nΣfᵢ|xᵢ − Med| / ΣfᵢSame as data
Population VarianceΣ(xᵢ − μ)² / NΣfᵢ(xᵢ − μ)² / NData²
Sample VarianceΣ(xᵢ − x̄)² / (n−1)Σfᵢ(xᵢ − x̄)² / (Σfᵢ−1)Data²
Population SD√(σ²)√(σ²)Same as data
Sample SD√(s²)√(s²)Same as data

Relative Measures

MeasureFormulaPrimary Use
Coefficient of Range(Xmax − Xmin) / (Xmax + Xmin)Compare range across datasets
Coefficient of QD(Q3 − Q1) / (Q3 + Q1)Compare IQR-based spread
Coefficient of MDM.D. / Mean (or Median)Compare mean deviation
Coefficient of Variation(SD / Mean) × 100%Cross-dataset comparison — most important

Complete Grouped Data Example

This section works through one frequency distribution and calculates Range, Mean Deviation, Variance, and Standard Deviation using both the direct method and the step-deviation method. Each formula produces an estimate because individual values are collapsed into class intervals.

Frequency Distribution

Class IntervalFrequency (f)Midpoint (x)fx|x − x̄|f|x − x̄|(x − x̄)²f(x − x̄)²
10–205157519953611805
20–3082520097281648
30–401235420112112
40–5094540511991211089
50–60655330211264412646
Total40—1430—404—6200
1

Range = 60 − 10 = 50

2

Mean (x̄) = Σfx / Σf = 1430 / 40 = 34

3

Mean Deviation = Σf|x − x̄| / Σf = 404 / 40 = 10.1

4

Variance (Direct) = Σf(x − x̄)² / Σf = 6200 / 40 = 155

5

Standard Deviation = √155 ≈ 12.45

Step-Deviation Method (A = 35, h = 10)

Classfxu = (x−35)/10fufu²
10–20515−2−1020
20–30825−1−88
30–401235000
40–50945199
50–6065521224
Total40——361
6

x̄ = A + h(Σfu/Σf) = 35 + 10(3/40) = 35 + 0.75 = 35.75 — note: small rounding difference from grouped mean of 34 due to interval assumptions

7

σ = h × √[(Σfu²/Σf) − (Σfu/Σf)²] = 10 × √[(61/40) − (3/40)²] = 10 × √[1.525 − 0.005625] = 10 × √1.5194 ≈ 10 × 1.233 ≈ 12.33

✓ Both methods give approximately the same SD (≈12.33–12.45), confirming the calculation. Minor differences arise from rounding during the mean computation in the direct method.

Chebyshev's Theorem — Dispersion Without Assuming Normality

The empirical rule (68–95–99.7) applies only to normal distributions. For data that is skewed, heavy-tailed, or simply unknown in shape, Chebyshev's theorem provides a guaranteed minimum bound that holds for any distribution with a finite mean and variance.

Chebyshev's Theorem
P(|X − μ| < kσ) ≥ 1 − 1/k²
k = number of standard deviations from the mean (k > 1)
k (Std. Devs.)Normal Distribution (Empirical Rule)Any Distribution (Chebyshev)
k = 168.27%No guarantee
k = 295.45%At least 75%
k = 399.73%At least 88.9%
k = 499.99%At least 93.75%

If you know your data is not normally distributed, use Chebyshev's bounds to make conservative probability statements without assuming any specific distribution shape. Try the Chebyshev's Theorem calculator to apply these bounds to your own data.

Which Measure of Dispersion Should You Use?

The right choice depends on three things: the type of data, whether the distribution is symmetric or skewed, and whether outliers are present. This table handles all three simultaneously.

Data TypeDistributionOutliers?Best MeasureWhy
OrdinalAnyAnyIQR or RangeSD requires interval/ratio data
NominalAnyAnyNone meaningfulDispersion is not applicable
Interval/RatioSymmetric, no outliersNoStandard DeviationUses all data; algebraically tractable
Interval/RatioSkewedYesIQRRobust to extreme values
Interval/RatioAnyExtremeIQR or MADMost resistant to outlier influence
Different units or meansAnyAnyCoefficient of VariationOnly unit-free comparison
Quick overviewAnyUnknownRangeInstant, but limited

The Key Rule: SD vs. IQR

✅
Two natural pairings to remember

SD + Mean → symmetric data, normal distribution, no serious outliers. Both are sensitive to all values, so they share the same conditions.

IQR + Median → skewed data, heavy-tailed distributions, when outliers are present. Both are robust to extremes, so they belong together.

When All Measures Disagree

When range, IQR, and SD paint different pictures, graph your data first. A large range combined with a small IQR tells you outliers are the story — report IQR as primary. When SD is noticeably larger than IQR/1.35, the data is right-skewed and IQR should lead. When SD ≈ IQR/1.35, the distribution is approximately normal and either measure is valid. See the histogram and skewness and kurtosis pages for visual diagnostic tools.

How Outliers Affect Each Measure

MeasureSensitivity to OutliersReason
RangeExtremeUses only max and min — one outlier completely redefines it
VarianceHighSquaring amplifies the effect of extreme values
Standard DeviationHighDirect root of variance — same amplification
Mean DeviationModerateTakes absolute value, not squares — linear in deviations
IQRLowUses only Q1 and Q3 — the tails are excluded
Quartile DeviationLowDerived from IQR — same robustness
Worked Example — Outlier Impact

Dataset without outlier: {12, 14, 15, 16, 18, 19, 20}

1

Range = 20 − 12 = 8 | Q1 = 13, Q3 = 19.5, IQR = 6.5 | SD ≈ 2.87

Dataset with outlier: {12, 14, 15, 16, 18, 19, 20, 100}

2

Range = 100 − 12 = 88 (+1000% change) | Q1 = 13.25, Q3 = 19.75, IQR ≈ 6.5 (unchanged) | SD ≈ 28.3 (+886% change)

✓ A single outlier (100) increases the range by 1000% and the SD by nearly 900%, while the IQR stays almost identical. This is exactly why IQR is preferred when outliers may be present.

For a systematic approach to identifying and handling outliers, see the outliers page.

Calculating Measures of Dispersion in Python and Excel

Python

Python — NumPy, SciPy, statistics module
import numpy as np
from scipy import stats
import statistics

data = [12, 14, 15, 16, 18, 19, 20, 22]

# Range
data_range = np.max(data) - np.min(data)
print(f"Range: {data_range}")                 # 10

# IQR and Quartile Deviation
q1 = np.percentile(data, 25)
q3 = np.percentile(data, 75)
iqr = q3 - q1
qd  = iqr / 2
print(f"Q1={q1}, Q3={q3}, IQR={iqr}, QD={qd}")

# Mean Absolute Deviation
mean = np.mean(data)
mad  = np.mean(np.abs(data - mean))
print(f"Mean Absolute Deviation: {mad:.4f}")

# Population Variance and SD (divides by n)
pop_var = np.var(data)
pop_sd  = np.std(data)
print(f"Population Variance: {pop_var:.4f}")
print(f"Population SD: {pop_sd:.4f}")

# Sample Variance and SD (Bessel's correction: ddof=1)
samp_var = np.var(data, ddof=1)
samp_sd  = np.std(data, ddof=1)
print(f"Sample Variance: {samp_var:.4f}")
print(f"Sample SD: {samp_sd:.4f}")

# statistics module (always uses n-1)
print(f"statistics.variance: {statistics.variance(data):.4f}")
print(f"statistics.stdev:    {statistics.stdev(data):.4f}")

# Coefficient of Variation
cv = (samp_sd / mean) * 100
print(f"CV: {cv:.2f}%")

# Standard Error of the Mean
sem = samp_sd / np.sqrt(len(data))
print(f"Standard Error: {sem:.4f}")
🚨
Critical Python gotcha

np.var() and np.std() divide by n by default (population formulas). For sample calculations, always pass ddof=1. Forgetting this is the most common source of incorrect variance calculations in Python data science workflows.

Excel

MeasureExcel FunctionNotes
Range=MAX(A1:A10) - MIN(A1:A10)No built-in RANGE function
Q1=QUARTILE.INC(A1:A10, 1)INC uses inclusive interpolation
Q3=QUARTILE.INC(A1:A10, 3)
IQR=QUARTILE.INC(A1:A10,3)-QUARTILE.INC(A1:A10,1)No built-in IQR function
Mean Absolute Deviation=AVEDEV(A1:A10)Built-in function
Population Variance=VAR.P(A1:A10)Divides by N
Sample Variance=VAR.S(A1:A10)Divides by n−1
Population SD=STDEV.P(A1:A10)Divides by N
Sample SD=STDEV.S(A1:A10)Divides by n−1 — use this by default
Coefficient of Variation=STDEV.S(A1:A10)/AVERAGE(A1:A10)*100Result is a percentage
Standard Error=STDEV.S(A1:A10)/SQRT(COUNT(A1:A10))

For more on statistical computing, see standard deviation vs. variance for a deeper comparison, or use the descriptive statistics calculator for an all-in-one tool.

Central Tendency and Dispersion — You Always Need Both

Central TendencyDispersion
What it tells youWhere data centersHow far data spreads from the center
Main measuresMean, Median, ModeRange, IQR, SD, Variance, CV
What it missesThe spread of valuesThe center of values
TogetherA complete description of a distribution

The natural pairings reflect shared assumptions about scale and robustness:

Central Tendency MeasureBest Paired WithWhy
MeanStandard DeviationBoth use all values; both optimal for symmetric data
MedianIQRBoth resistant to outliers; both optimal for skewed data
ModeFrequency / relative frequencyMode used for categorical; spread expressed as frequencies

Measures of Dispersion in Real Life

📈

Finance & Investment Risk

Standard deviation is the standard measure of investment risk. Higher SD means more return variability. The coefficient of variation compares risk per unit of return across assets with different average returns.

🏭

Manufacturing Quality Control

Statistical Process Control uses SD to set control limits at Mean ± 3σ. Six Sigma defines quality as processes running within ±6σ from the target — measuring defect rates through dispersion.

🏥

Healthcare & Clinical Research

IQR is standard for clinical outcomes that are not normally distributed — lab values, survival times, ordinal patient-reported scales. SD is reported when outcomes are approximately normal.

🎓

Education & Test Analysis

SD tells educators how consistent student performance is. Low SD across an exam means students performed similarly; high SD signals significant variation in preparation. Z-scores use both mean and SD.

🌡️

Meteorology

SD of daily temperatures measures climate consistency. Two cities with the same average temperature but different SDs have entirely different climates — think San Francisco vs. Denver.

⚽

Sports Analytics

IQR of player performance statistics resists the influence of outlier game performances that can distort SD. CV compares scoring consistency across sports with different average scoring volumes.

Common Mistakes and Misconceptions

1
Using n instead of n−1 for sample variance

The single most common error. Always use n−1 (Bessel's correction) when working with a sample. In Python, always pass ddof=1 to np.var() and np.std().

2
Confusing standard deviation with standard error

SD describes data spread; SEM = s/√n describes the precision of the mean estimate. These are not interchangeable. Using SEM to describe data makes the data look less variable than it is.

3
Believing SD is always smaller than variance

False. When variance < 1, SD > variance. The relationship depends entirely on the scale of measurement, not on any mathematical ordering rule.

4
Using range as the primary dispersion measure

Range is only a rough first indicator. One extreme value completely redefines it. Always follow up with IQR or SD for any substantive analysis.

5
Reporting SD for skewed data

SD assumes symmetric distribution for meaningful interpretation. For skewed data (income, reaction times, clinical biomarkers), report IQR and pair it with the median.

6
Using CV when the mean is near zero

When the mean approaches zero, CV approaches infinity and loses all interpretive meaning. Never calculate CV for data centered near zero or for interval-scale data without a true zero.

7
Using class boundaries instead of class midpoints for grouped data

In grouped data calculations, each class is represented by its midpoint — (lower + upper) / 2. Using class limits directly gives incorrect results for mean, MD, variance, and SD.

8
Applying the empirical rule (68–95–99.7) to non-normal data

The empirical rule applies only to normal distributions. For data of unknown or non-normal shape, use Chebyshev's theorem, which makes no distributional assumption.

9
Interpreting variance units directly

If height is in cm, variance is in cm². Saying "variance = 25 cm" is a unit error. Variance is always in squared units of the original measurement.

10
Assuming low SD means the data is normally distributed

Low SD means data is tightly clustered around the mean. It says nothing about the shape of the distribution. A bimodal dataset can have a small SD.

11
Thinking mean deviation is minimized about the mean

Mean deviation is minimized when calculated about the median, not the mean. The mean minimizes the sum of squared deviations (variance), not the sum of absolute deviations.

12
Calculating IQR as Q3 − Q2 or Q2 − Q1

IQR = Q3 − Q1. The full interquartile span from 25th to 75th percentile. Half the IQR is the quartile deviation (semi-IQR), not the IQR itself.

13
Treating population and sample formulas as interchangeable

If you collected data from a subset of a population to estimate population parameters, always use n−1. Using N when you have a sample produces a biased (too-small) variance estimate.

Frequently Asked Questions

What are measures of dispersion?

Measures of dispersion describe how far apart data values are from each other and from the center of a distribution. The most common measures are the range, IQR, mean deviation, variance, standard deviation, and coefficient of variation. Together with measures of central tendency, they give a complete picture of any dataset.

What are the main types of measures of dispersion?

Dispersion measures split into two types. Absolute measures — range, IQR, quartile deviation, mean deviation, variance, standard deviation — are in the same units as the raw data. Relative measures — coefficient of range, coefficient of QD, coefficient of MD, coefficient of variation — are dimensionless ratios used to compare datasets with different units or different means.

What is the range in statistics?

The range is the difference between the maximum and minimum values in a dataset: Range = Xmax − Xmin. It is the simplest measure of spread, calculated from just two values. Its main weakness is extreme sensitivity to outliers — a single unusual value can completely change it.

What is the interquartile range (IQR)?

The IQR is the difference between the third quartile (Q3, 75th percentile) and the first quartile (Q1, 25th percentile): IQR = Q3 − Q1. It measures the spread of the middle 50% of the data and is robust to outliers because it ignores both tails of the distribution.

What is variance in statistics?

Variance is the average of the squared deviations from the mean. Population variance: σ² = Σ(xᵢ − μ)²/N. Sample variance: s² = Σ(xᵢ − x̄)²/(n−1). Because deviations are squared, variance is in squared units — a variance of 25 cm² for height data means the squared average deviation is 25 cm², not 25 cm. Taking the square root gives the standard deviation.

What is standard deviation?

Standard deviation is the positive square root of variance. It returns the measure to the original units of the data, making it directly interpretable. For a sample: s = √[Σ(xᵢ − x̄)²/(n−1)]. It is the most widely used dispersion measure for symmetric, continuous data without serious outliers.

Why do we divide by n−1 for sample variance?

Dividing by n−1 (Bessel's correction) compensates for a systematic bias. Because the sample mean x̄ is computed from the same data as the deviations, the sum of squared deviations around x̄ is always smaller than it would be around the true (unknown) population mean μ. Dividing by n−1 instead of n makes the result larger, exactly offsetting this underestimation, so that s² is an unbiased estimator of σ². One degree of freedom is lost because the n deviations must sum to zero once x̄ is known.

What is Bessel's correction?

Bessel's correction is the practice of dividing by n−1 rather than n when computing sample variance or sample standard deviation. It corrects for the fact that calculating deviations around the sample mean (rather than the unknown population mean) systematically underestimates the true spread of the population. The correction makes s² an unbiased estimator of σ².

What is the difference between population and sample standard deviation?

Population SD (σ) divides by N and is used when you have data on every member of the population. Sample SD (s) divides by n−1 and is used when you have a subset of the population and want to estimate the population parameter. In practice, most real-world data is a sample, so n−1 is appropriate. In Python, np.std(data, ddof=1) gives sample SD; np.std(data) gives population SD.

What does a high standard deviation mean?

A high standard deviation means individual data points are spread widely around the mean — the dataset shows high variability. In finance this represents high risk; in manufacturing it means the process is inconsistent; in education it signals that students performed very differently from one another. "High" is always relative to the scale of the data.

Can standard deviation be negative?

No. Standard deviation is the positive square root of variance, and variance is a sum of squared terms (all non-negative), so it is always ≥ 0. SD = 0 only when all values in the dataset are identical. Negative SD is mathematically impossible.

Can variance be greater than standard deviation?

Yes — it depends entirely on the scale of the data. If σ² = 4, then σ = 2 (variance > SD). If σ² = 0.25, then σ = 0.5 (SD > variance). If σ² = 1, both are equal. There is no universal ordering between variance and standard deviation.

What is the difference between standard deviation and standard error?

Standard deviation (SD) measures the spread of individual data values around the sample mean — it describes variability in the data. Standard error of the mean (SEM = s/√n) measures how accurately the sample mean estimates the population mean — it describes precision of the mean estimate. SEM decreases as sample size grows; SD does not. Reporting SEM instead of SD makes data appear less variable, which is a common error in published research.

When should I use IQR instead of standard deviation?

Use IQR when data is skewed (income, house prices, survival times), when outliers are present and should not dominate the analysis, when data is measured on an ordinal scale, or when reporting alongside the median. Standard deviation works best for symmetric distributions on an interval or ratio scale without serious outliers. IQR and median form a natural pair; SD and mean form another.

What is the coefficient of variation and when should I use it?

CV = (SD / Mean) × 100%. It is a dimensionless ratio expressing variability relative to the mean. Use it when comparing two datasets with different units (e.g., comparing height variability in cm with weight variability in kg) or when datasets have very different means. Do not use CV when the mean is near zero or when data is on an interval scale without a true zero point.

What is Chebyshev's theorem?

Chebyshev's theorem states that for any distribution with finite mean and variance, at least 1 − 1/k² of values fall within k standard deviations of the mean (for any k > 1). For example, at least 75% of values fall within 2 SD of the mean, and at least 88.9% within 3 SD. Unlike the empirical rule, this holds for any distribution shape — not just normal distributions.

Which measure of dispersion is least affected by outliers?

The IQR (interquartile range) and quartile deviation are the most resistant to outliers because they use only the middle 50% of data — Q1 and Q3. Extreme values in the tails do not affect these measures. Mean absolute deviation has moderate resistance. Standard deviation and variance are sensitive to outliers because squaring amplifies extreme deviations. The range is the most sensitive of all, since a single extreme value redefines it completely.

What happens to standard deviation when you add a constant to all values?

Adding (or subtracting) a constant c to every value in a dataset does not change the standard deviation. SD measures spread relative to the mean, and shifting all values by the same amount shifts the mean by the same amount, leaving all deviations unchanged. Formally: σ(X + c) = σ(X). Variance is similarly unchanged.

What happens to standard deviation when you multiply all values by a constant?

Multiplying every value by a constant c multiplies the standard deviation by |c|. Formally: σ(cX) = |c| × σ(X). This makes sense because multiplying data by c stretches all deviations by the same factor c. Variance is multiplied by c² because σ² scales as the square of c.

How do you calculate variance for grouped data?

For grouped data, use class midpoints as representative values. First calculate the weighted mean: x̄ = Σfᵢxᵢ / Σfᵢ. Then apply: σ² = Σfᵢ(xᵢ − x̄)² / Σfᵢ. The step-deviation method simplifies this when class widths are equal: compute uᵢ = (xᵢ − A)/h for each class, then σ² = h² × [(Σfᵢuᵢ²/Σfᵢ) − (Σfᵢuᵢ/Σfᵢ)²]. Both methods give the same result. See the complete worked example in the Grouped Data section above.

What is mean absolute deviation and how is it different from standard deviation?

Mean absolute deviation (MAD) is the average of the absolute differences between each data point and the mean: MAD = Σ|xᵢ − x̄| / n. Like SD, it measures spread in the original units. SD uses squared deviations instead, which amplifies the effect of outliers but gives SD superior mathematical properties — differentiability, additivity across independent groups, and direct connections to variance used in t-tests, ANOVA, and regression. MAD is more intuitive and more robust to outliers; SD is more useful for further statistical analysis.

What dispersion measure goes with the mean?

Standard deviation is the natural partner to the mean. Both use all data values in their calculation, both are sensitive to outliers in the same way, and both are optimal for symmetric, approximately normal distributions. When you report the mean, report SD alongside it.

What dispersion measure goes with the median?

The IQR (interquartile range) is the natural partner to the median. Both are resistant to outliers, both describe the middle of the distribution, and both are appropriate for skewed data. When you report the median, report IQR alongside it.

How do you calculate IQR in Excel?

Excel has no built-in IQR function. Calculate it as: =QUARTILE.INC(A1:A10,3) - QUARTILE.INC(A1:A10,1). QUARTILE.INC uses inclusive interpolation between the actual data values. Alternatively, use the online IQR calculator.

How do you calculate the coefficient of variation in Python?

Using NumPy: cv = (np.std(data, ddof=1) / np.mean(data)) * 100. Always use ddof=1 for the sample standard deviation. SciPy also provides scipy.stats.variation(data) which returns the ratio (without multiplying by 100).

What is the step-deviation method?

The step-deviation method simplifies variance and SD calculations for grouped data when class widths are equal. Instead of computing deviations from the actual mean, you define coded values uᵢ = (xᵢ − A)/h, where A is a convenient assumed mean and h is the class width. The formulas are: σ² = h² × [(Σfᵢuᵢ²/Σfᵢ) − (Σfᵢuᵢ/Σfᵢ)²] and σ = h × √[(Σfᵢuᵢ²/Σfᵢ) − (Σfᵢuᵢ/Σfᵢ)²]. The coded values are small integers (−2, −1, 0, 1, 2...), making the arithmetic far easier than the direct method.

Key Takeaways

✓

Two datasets can have identical means but completely different spreads — dispersion measures are needed to tell the full story.

✓

Range is simplest but uses only two values and is highly sensitive to outliers. Use for a quick first look only.

✓

IQR (Q3 − Q1) measures the spread of the middle 50% of data and is resistant to outliers. Pair it with the median.

✓

Mean deviation averages absolute deviations; minimized when calculated about the median. Intuitive but algebraically limited.

✓

Variance averages squared deviations. Uses all values. Expressed in squared units — hard to interpret directly.

✓

Standard deviation is the square root of variance. Same units as data. Most widely used measure for symmetric, continuous data.

✓

Sample variance divides by n−1 (Bessel's correction) to give an unbiased estimate of population variance.

✓

Coefficient of Variation (SD/Mean × 100%) is the only unit-free measure. Use it to compare datasets with different units or scales.

✓

Symmetric data without outliers → use SD + Mean. Skewed data or outliers present → use IQR + Median.

✓

Variance can exceed SD (when variance > 1) or be less than it (when variance < 1). There is no fixed ordering between them.

✓

SD ≠ standard error. SD describes data spread; SEM = s/√n describes precision of the sample mean.

✓

Chebyshev's theorem guarantees ≥75% of values fall within 2 SD of the mean for any distribution — use it when data is not normal.

✓

For grouped data, use class midpoints as representative values. All grouped formulas produce estimates, not exact values.

✓

The step-deviation method simplifies grouped data SD when class widths are equal — small coded values replace large raw deviations.