Login
📚 Mostly Harmless Statistics
Chapters ▾

Chapter 10: Chi-Square Tests

A χ2 -distribution (chi-square, pronounced “ki-square”) is another special type of distribution for a continuous random variable. The sampling distribution for a variance and standard deviation follows a chi-square distribution.

# Figure 10-1: the chi-square family for df = 2, 4, 10, 30
curve(dchisq(x, 2), 0, 50, ylim = c(0, 0.5), xlab = "chi-square", ylab = "density")
curve(dchisq(x, 4),  add = TRUE, col = 2)
curve(dchisq(x, 10), add = TRUE, col = 3)
curve(dchisq(x, 30), add = TRUE, col = 4)   # mean = df, so the peak walks right
legend("topright", c("df=2", "df=4", "df=10", "df=30"), col = 1:4, lwd = 1)
# Every curve starts at zero and is skewed right. Raise a df above 50 and re-run:
# the skew disappears and the curve becomes normal, exactly as property 4 says.

Properties of the χ2 -distribution density curve:

Adapted from Mostly Harmless Statistics by Rachel Webb (Portland State University), hosted on LibreTexts (stats.libretexts.org) and licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.