Descriptive Statistics
Topic - Descriptive statistics mathematically summarize the core properties of empirical data distributions. By formalizing central tendency, dispersion, and shape parameters, we translate large datasets into concise, actionable analytical metrics.
1. Measures of Central Tendency
Central tendency identifies the central location or expected balance point of a dataset.
The Arithmetic Mean
The arithmetic mean sums all observations and divides by sample size. It incorporates all mathematical information but is highly sensitive to extreme outliers.
The Median
The middle value when the data is sorted in monotonic order. It acts as a robust statistic that remains unaffected by heavy-tailed outliers.
The Mode
The value that appears with the highest empirical frequency. Unlike the mean and median, the mode can be evaluated on purely nominal categorical data.
2. Measures of Dispersion
Dispersion quantifies the degree of spread, scatter, or variability around the central tendency.
- Variance & Bessel's Correction
- Standard Deviation
- Interquartile Range (IQR)
The average squared mathematical deviation from the mean:
- Bessel's Correction (): Dividing by when evaluating a sample underestimates population variance because sample deviations are computed relative to rather than the true population mean . The factor yields an unbiased estimator ().
The square root of variance, returning the dispersion metric into the identical measurement units of the raw data:
The spread of the central 50% of ordered observations:
- Outlier Boundary (Tukey's Fences): Observations falling outside are mathematically classified as mild outliers.
3. Distribution Morphology (Shape)
Skewness (Third Standardized Moment)
Skewness measures the degree of directional asymmetry of a distribution around its mean:
Kurtosis (Fourth Standardized Moment)
Kurtosis quantifies the propensity of a distribution to generate extreme outliers (the heaviness of its tails):
- Mesokurtic (, Excess ): Gaussian / normal distribution profile.
- Leptokurtic (Excess ): Heavy tails and acute central peak; indicates frequent extreme outlier anomalies.
- Platykurtic (Excess ): Light tails and flat peak; fewer extreme deviations.
4. Implementation Lab
Analyze descriptive statistics programmatically using Python, NumPy, Pandas, and SciPy in this hands-on lab.
import numpy as np
import pandas as pd
from scipy import stats
# Generate simulated right-skewed distribution
np.random.seed(42)
sample = np.random.exponential(scale=10.0, size=1000)
# Central Tendency
mean_val = np.mean(sample)
median_val = np.median(sample)
# Dispersion (enforcing Bessel's correction with ddof=1)
sample_var = np.var(sample, ddof=1)
sample_std = np.std(sample, ddof=1)
iqr_val = stats.iqr(sample)
# Distribution Morphology
skew_val = stats.skew(sample)
kurt_val = stats.kurtosis(sample) # Fisher's definition: Normal = 0.0
print(f"Mean: {mean_val:.2f} | Median: {median_val:.2f}")
print(f"Variance: {sample_var:.2f} | Std Dev: {sample_std:.2f} | IQR: {iqr_val:.2f}")
print(f"Skewness: {skew_val:.2f} | Excess Kurtosis: {kurt_val:.2f}")
Key Takeaways
- Metric Robustness: Prefer the median and IQR when modeling heavy-tailed or skewed distributions, as the arithmetic mean and standard deviation are readily distorted by outliers.
- Unbiased Variance: Bessel's correction () is required for sample variance to prevent systematic underestimation of population variance.
- Tail Diagnostics: High positive excess kurtosis warns of fat tails, indicating that standard Gaussian assumptions may underestimate risk.
Next Section: Correlation and Covariance - quantifying directional and linear relationships between bivariate continuous variables.