# Lecture 4: Descriptive Statistics - Variability and Distribution Shape

## Statistics / Biostatistics

---

## Learning Objectives

By the end of this lecture, students will be able to:

1. Define and calculate range, interquartile range, variance, and standard deviation
2. Interpret the coefficient of variation
3. Describe the shape of a distribution using skewness and kurtosis
4. Apply the empirical rule (68-95-99.7) for approximately normal data
5. Use Chebyshev's theorem for non-normal data

---

## Lecture Content

### I. Why Variability Matters

Central tendency alone does not fully describe a dataset. Two datasets can share the same mean yet differ dramatically in their spreads. For example, two groups of patients might both have a mean systolic blood pressure of 130 mmHg, but in one group values range from 125 to 135 while in the other they span from 90 to 180. Variability (or dispersion) quantifies how spread out the data are. In clinical contexts, variability relates to the precision of measurements, the consistency of treatment effects, and the degree of patient heterogeneity.

### II. Range

The range is the simplest measure of spread, defined as the maximum value minus the minimum value. While it gives a quick, rough sense of data spread, it has important limitations. It is based on only two data points (the extremes), is highly sensitive to outliers, and tends to increase with sample size because larger samples are more likely to capture extreme values.

### III. Percentiles and the Interquartile Range (IQR)

A percentile is the value below which a given percentage of observations fall. The 25th percentile (Q1) is the first quartile, the 50th percentile (Q2) is the median, and the 75th percentile (Q3) is the third quartile. The **interquartile range (IQR)** is calculated as Q3 minus Q1 and captures the middle 50% of the data. Because it is not influenced by extreme values, the IQR is a robust measure of spread.

The IQR is preferred for skewed data, just as the median is preferred over the mean for such distributions. It also plays a central role in the construction of boxplots and in identifying potential outliers. A common rule defines potential outliers as values below Q1 - 1.5 * IQR or above Q3 + 1.5 * IQR.

<image>A boxplot anatomy diagram. The box spans from Q1 to Q3, with a line at the median (Q2). Whiskers extend to the smallest and largest values within 1.5 * IQR of the box edges. Points beyond the whiskers are plotted individually as potential outliers. Labels identify each component: lower whisker, Q1, median, Q3, upper whisker, IQR bracket, and outlier points. A second panel shows the same data as a histogram overlaid with the boxplot for comparison.</image>

### IV. Variance

The **population variance** (sigma-squared) is the average of the squared deviations from the population mean, calculated as sigma^2 = sum of (x_i - mu)^2 / N. The **sample variance** (s-squared) uses n-1 in the denominator instead of N, a correction known as Bessel's correction, making the formula s^2 = sum of (x_i - x-bar)^2 / (n - 1). Dividing by n-1 produces an unbiased estimate of the population variance. The units of variance are the square of the original units (for example, mmHg^2), which complicates direct interpretation, but variance is fundamental to many statistical methods including ANOVA and regression.

### V. Standard Deviation

The standard deviation is the positive square root of the variance. The population standard deviation is sigma = sqrt(sigma^2), and the sample standard deviation is s = sqrt(s^2). Because the standard deviation is expressed in the same units as the original data, it is far more interpretable than variance. It can be thought of as representing the "average" distance of data points from the mean and is the most commonly reported measure of variability for symmetric, continuous data.

As an example calculation, consider the data: 4, 8, 6, 5, 7. The mean is 6. The deviations from the mean are -2, 2, 0, -1, and 1, and their squares are 4, 4, 0, 1, and 1. The sum of squared deviations is 10, so the sample variance is 10 / 4 = 2.5, and the sample standard deviation is sqrt(2.5) = 1.58.

### VI. Coefficient of Variation (CV)

The coefficient of variation is the ratio of the standard deviation to the mean, expressed as a percentage: CV = (s / x-bar) * 100%. It allows comparison of variability between variables measured on different scales. For example, one might compare the variability of height (in centimeters) to the variability of weight (in kilograms) in the same sample using the CV. The CV is also used to assess measurement precision, such as laboratory assay reproducibility, where a CV below 10% is often considered acceptable.

<image>A comparison of two datasets with the same mean but different standard deviations. Panel A: A narrow, tall bell curve (low SD) representing precise measurements (e.g., automated lab assay). Panel B: A wide, flat bell curve (high SD) representing variable measurements (e.g., self-reported dietary intake). Both curves are centered on the same mean value. The CV for each is displayed below its curve.</image>

### VII. The Empirical Rule (68-95-99.7 Rule)

The empirical rule applies to data that are approximately normally distributed. It states that approximately 68% of data fall within one standard deviation of the mean (mu +/- 1 sigma), approximately 95% fall within two standard deviations (mu +/- 2 sigma), and approximately 99.7% fall within three standard deviations (mu +/- 3 sigma).

As a practical application, if the mean systolic blood pressure is 120 mmHg with a standard deviation of 10 mmHg, then about 95% of values lie between 100 and 140 mmHg. This rule is useful for quick estimation and for identifying values that are unusually far from the mean.

### VIII. Chebyshev's Theorem

While the empirical rule requires approximate normality, Chebyshev's theorem applies to any distribution regardless of shape. It states that at least (1 - 1/k^2) of the data lie within k standard deviations of the mean for any k greater than 1. For k = 2, at least 75% of data fall within two standard deviations, and for k = 3, at least 89% fall within three standard deviations. These bounds are less precise than the empirical rule but are valuable when normality cannot be assumed.

### IX. Skewness and Kurtosis

**Skewness** measures the asymmetry of a distribution. A skewness of zero indicates a symmetric distribution. Positive skewness (greater than zero) indicates a right-skewed distribution with a long right tail, which is common in medical data such as costs and length of stay. Negative skewness (less than zero) indicates a left-skewed distribution with a long left tail.

**Kurtosis** measures the "tailedness" of a distribution. A mesokurtic distribution (kurtosis approximately 3) has tail weight similar to the normal distribution. A leptokurtic distribution (kurtosis greater than 3) has heavier tails and a sharper peak, while a platykurtic distribution (kurtosis less than 3) has lighter tails and a flatter peak. Excess kurtosis, defined as kurtosis minus 3, sets the normal distribution at zero for easier comparison. Both skewness and kurtosis are useful for assessing whether data approximate a normal distribution.

<image>Three pairs of distribution curves. Panel A: A symmetric distribution with skewness = 0, labeled "Normal." Panel B: A right-skewed distribution with a long right tail, labeled "Positive skew," with an annotation showing clinical example (hospital length of stay). Panel C: A leptokurtic distribution (sharp peak, heavy tails) overlaid on a normal distribution for comparison, with both labeled. Each curve has its skewness and kurtosis values annotated.</image>

### X. Choosing the Right Summary Statistics

For symmetric, continuous data, report the mean and standard deviation. For skewed, continuous data, report the median and IQR. For ordinal data, report the median and IQR (or range). For nominal data, report frequencies and proportions (and the mode). Always visualize the data before deciding on summary statistics. In published papers, "Table 1" typically presents these summaries for each variable, organized by group.

---
