Descriptive statistics

Asking for Preferences
Here is a full summary of descriptive statistics.

Descriptive Statistics

Descriptive statistics summarize and describe the main features of a dataset. They do not allow you to draw conclusions beyond the data or make predictions - that is the job of inferential statistics. They simply organize and present data in a meaningful way.

1. Types of Data

Before applying any statistic, know your data type:
TypeDescriptionExample
NominalCategories with no orderBlood type, gender
OrdinalCategories with order, unequal intervalsPain scale (1-10), education level
IntervalEqual intervals, no true zeroTemperature (°C), IQ score
RatioEqual intervals + true zeroHeight, weight, income

2. Measures of Central Tendency

These describe the "center" or "typical value" of a dataset.

Mean (Arithmetic Average)

  • Formula: x̄ = Σx / n
  • Sum all values, divide by the count.
  • Best for: Interval/ratio data with no extreme outliers.
  • Weakness: Sensitive to outliers. One extreme value pulls the mean significantly.

Median

  • The middle value when data is sorted in order.
  • If n is even, the median = average of the two middle values.
  • Best for: Skewed distributions or ordinal data.
  • Strength: Not affected by outliers. (e.g., median house price is more meaningful than mean)

Mode

  • The most frequently occurring value.
  • A dataset can be unimodal, bimodal, or multimodal.
  • Best for: Nominal data (e.g., most common blood type).
  • Can be used for any data type.

Relationship Between Mean, Median, Mode

DistributionRelationship
Symmetric (normal)Mean = Median = Mode
Positively skewed (right)Mode < Median < Mean
Negatively skewed (left)Mean < Median < Mode

3. Measures of Dispersion (Spread)

These describe how spread out the data values are.

Range

  • Formula: Range = Max - Min
  • Simple but highly sensitive to outliers.

Interquartile Range (IQR)

  • Formula: IQR = Q3 - Q1
  • Covers the middle 50% of data.
  • Robust to outliers. Used in box plots.
  • Q1 = 25th percentile, Q3 = 75th percentile

Variance (s² or σ²)

  • The average of the squared deviations from the mean.
  • Sample variance: s² = Σ(x - x̄)² / (n - 1)
  • Population variance: σ² = Σ(x - μ)² / N
  • Note: Dividing by (n-1) for sample variance corrects for bias (Bessel's correction).

Standard Deviation (SD)

  • Formula: s = √s² (square root of variance)
  • Returns to the original units of the data, making it more interpretable than variance.
  • Empirical Rule (Normal Distribution):
    • ~68% of data falls within ±1 SD of the mean
    • ~95% within ±2 SD
    • ~99.7% within ±3 SD

Coefficient of Variation (CV)

  • Formula: CV = (s / x̄) × 100%
  • Expresses SD as a percentage of the mean.
  • Useful for comparing spread across datasets with different units or scales.

4. Measures of Shape

Skewness

  • Describes the asymmetry of the distribution.
  • Positive (right) skew: Long tail to the right. Mean > Median.
  • Negative (left) skew: Long tail to the left. Mean < Median.
  • Skewness = 0 → perfectly symmetric.

Kurtosis

  • Describes the "peakedness" or tail weight of the distribution.
  • Leptokurtic (kurtosis > 3): Sharper peak, heavier tails.
  • Platykurtic (kurtosis < 3): Flatter peak, lighter tails.
  • Mesokurtic (kurtosis = 3): Normal distribution.
  • Excess kurtosis = kurtosis - 3 (so normal = 0).

5. The Five-Number Summary

A compact summary of a dataset's distribution:
  1. Minimum
  2. Q1 (25th percentile)
  3. Median (Q2, 50th percentile)
  4. Q3 (75th percentile)
  5. Maximum
This forms the basis of the box plot (box-and-whisker plot).

6. Data Visualization Methods

Chart TypeBest Used For
Frequency table / histogramDistribution of continuous data
Bar chartComparing categories (nominal/ordinal)
Box plotComparing spread and detecting outliers
Pie chartProportions of a whole (use sparingly)
Scatter plotRelationship between two continuous variables
Stem-and-leaf plotSmall datasets - shows distribution and raw values

Identifying Outliers

Using IQR method:
  • Lower fence: Q1 - 1.5 × IQR
  • Upper fence: Q3 + 1.5 × IQR
  • Any value outside these fences is considered an outlier.

7. Quick Reference - Which Statistic to Use?

GoalUse
Describe center of symmetric dataMean
Describe center of skewed dataMedian
Describe most common categoryMode
Describe spread, same units as dataStandard Deviation
Compare spread across different scalesCoefficient of Variation
Detect outliersIQR method
Summarize a distributionFive-number summary + box plot

Example

Dataset: 5, 7, 7, 9, 10, 12, 15
StatisticValue
Mean(5+7+7+9+10+12+15) / 7 = 9.29
Median9 (middle value)
Mode7 (appears twice)
Range15 - 5 = 10
Q17
Q312
IQR12 - 7 = 5
Variance (sample)11.57
SD3.40

That covers the full scope of descriptive statistics. Let me know if you want worked examples, practice problems, or a deeper dive into any specific section.

A short summary

Descriptive Statistics - Short Summary

Descriptive statistics summarize and describe a dataset without making predictions.

Central Tendency - where the data centers:
  • Mean - arithmetic average; sensitive to outliers
  • Median - middle value; better for skewed data
  • Mode - most frequent value
Spread/Dispersion - how spread out the data is:
  • Range - max minus min
  • IQR - middle 50% of data (Q3 - Q1); outlier-resistant
  • Standard Deviation - average distance from the mean; most commonly used
Shape:
  • Skewness - how asymmetric the distribution is (left or right tail)
  • Kurtosis - how peaked or flat the distribution is
Visualization: histograms, box plots, and bar charts are the standard tools for displaying descriptive data.

Key rule of thumb: Use the mean + SD for symmetric data, and the median + IQR for skewed data or when outliers are present.

Show me examples with real datasets

Running Command

python3 << 'EOF' import statistics import math # ── DATASET 1: NBA Player Heigh…

Here are the results with interpretation:

Dataset 1: NBA Player Heights (inches)

StatisticValue
Mean77.47 in
Median77.00 in
Mode75 in
Std Dev4.81 in
IQR7 (Q1=74, Q3=81)
CV6.2%
Skewness+0.291 (slight right skew)
OutliersNone
Interpretation:
  • Mean and median are very close (77.47 vs 77.00), meaning the distribution is nearly symmetric. Either is a fair summary.
  • SD of 4.81 inches is small relative to the mean (CV = 6.2%) - NBA players are a homogeneous group in height.
  • No outliers - heights are tightly clustered. A player at 69" (point guard) or 87" (center) is unusual but still within normal range.

Dataset 2: US Household Income ($000s)

StatisticValue
Mean$68,930
Median$51,000
Mode$28,000
Std Dev$55,740
IQR$37,000 (Q1=38k, Q3=75k)
CV80.9%
Skewness+0.965 (strong right skew)
Outliers$250,000
Interpretation:
  • The mean ($68,930) is much higher than the median ($51,000) - a classic sign of right skew. The $250k earner pulls the mean up.
  • The median is the better summary here. This is exactly why "median household income" is used in news and government reports, not the mean.
  • CV of 80.9% vs 6.2% for heights - income is far more variable as a population characteristic.
  • $250,000 is a confirmed outlier by the IQR method (upper fence = $130,500).

Key Takeaway from Comparing Both

HeightsIncomes
ShapeNear-symmetricStrongly right-skewed
Best center measureMeanMedian
Best spread measureSDIQR
OutliersNoneYes (high earner)
This shows concretely why one size does not fit all in descriptive statistics - the right tool depends entirely on the shape of your data.
This is a shared conversation. Sign in to Orris to start your own chat.