Skip to main content

Statistics and stories: the history of the tests

The z, t, chi-square, F and exact tests, and the people who made them

Each test in this course has an author, a date and a reason. Most authors had a practical problem. Gosset, a brewer, had only four samples of barley. Fisher, at an agricultural research station, had a field of potatoes. This page gives the history of the tests. Where the original data still exist, we do the original analysis again in R.

Year Who What Lecture
1710 John Arbuthnot First significance test: 82 years of London christenings L02
1733 Abraham de Moivre The normal curve, as an approximation to the binomial L02
1805–1810 Legendre, Gauss, Laplace Least squares, the normal law of error, the central limit theorem L04
1837 Siméon Denis Poisson The Poisson distribution, as a limit of the binomial L09–10 (planned)
1846 Adolphe Quetelet A normal curve for the chests of 5,738 soldiers –
1863–1876 Abbe, Helmert The distribution of a sum of squared normal errors (chi-square) L11 (planned)
1877–1888 Francis Galton Quincunx, regression, correlation L04, L06
1885 F. Y. Edgeworth “Significant” with its statistical meaning L02
1898 Ladislaus von Bortkiewicz Horse kicks and the “law of small numbers” L09–10 (planned)
1900 Karl Pearson The chi-square goodness-of-fit test L11 (planned)
1908 W. S. Gosset (“Student”) The small-sample test for a mean: Student’s distribution L02
1915 R. A. Fisher A full proof of Student’s distribution L02
1922 R. A. Fisher The correct degrees of freedom for contingency tables L11 (planned)
1923–1925 R. A. Fisher Analysis of variance, the z distribution, t, Statistical Methods for Research Workers L06
1928–1933 Neyman and E. S. Pearson Two types of error, and power L02
1932–1934 Mahalanobis, Snedecor Tables of the variance ratio, and the name F L06
1935 R. A. Fisher The Design of Experiments: the lady tasting tea, the exact test L11 (planned)
1938–1947 Welch, Satterthwaite The t-test for unequal variances (the R default) L03
1945–1947 Wilcoxon, Mann and Whitney Rank tests L03

1710: Arbuthnot and the first significance test

John Arbuthnot, by Godfrey Kneller (1723)
Public domain, Wikimedia Commons

John Arbuthnot was physician to Queen Anne. He used the London records of christenings from 1629 to 1710. In each of these 82 years, the parishes christened more boys than girls. Assume that the sex of each child is a fair coin toss. Then a “boy year” and a “girl year” have equal probability, and 82 boy years in a row have probability \((1/2)^{82}\). This is approximately 1 in \(4.8 \times 10^{24}\).

Arbuthnot published the result in Philosophical Transactions in 1710. The title was An Argument for Divine Providence, taken from the constant Regularity observ’d in the Births of both Sexes. He concluded that the excess of boys came from divine design.

His conclusion was theological, but we still use his logic. We assume a null hypothesis and calculate the probability of the data under it. If that probability is very small, we reject the hypothesis. Today we call his method a sign test.

Show code
ggplot(Arbuthnot, aes(Year, Ratio)) +
  geom_hline(yintercept = 1, linetype = "dashed", colour = "grey50") +
  geom_line(colour = "steelblue") + geom_point(colour = "steelblue", size = 1) +
  labs(y = "male / female christenings") +
  annotate("text", x = 1640, y = 1.005, label = "equal numbers", colour = "grey40", vjust = 0)
Figure 1: Arbuthnot’s data: the ratio of male to female christenings in London. The ratio is more than 1 in all 82 years.
binom.test(sum(Arbuthnot$Ratio > 1), nrow(Arbuthnot), alternative = "greater")$p.value
[1] 2.067952e-25

1733–1812: de Moivre, Gauss, Laplace and the normal curve

Abraham de Moivre
Public domain, Wikimedia Commons

Carl Friedrich Gauss, by C. A. Jensen (1840)
Public domain, Wikimedia Commons

The normal curve started as a shortcut for calculation. Abraham de Moivre was a French Protestant refugee in London. He taught mathematics and gave advice to gamblers.

De Moivre needed binomial probabilities for large numbers of trials, and these sums were too long to calculate by hand. In a Latin pamphlet of 12 November 1733, he showed that a smooth curve approximates the binomial. We now call this curve the normal curve. An English version is in the second edition of his book The Doctrine of Chances (1738).

Astronomers then used the curve for errors of measurement. Adrien-Marie Legendre published the method of least squares in 1805, in an appendix to a book on the orbits of comets. In Theoria motus corporum coelestium (1809), Carl Friedrich Gauss gave the method a basis in probability. He showed that if measurement errors follow the curve \(e^{-h^2 x^2}\), least squares gives the most probable values. Gauss also said that he used least squares from 1795. Legendre did not accept this claim.

Gauss was already famous at this time. In 1801 the asteroid Ceres went behind the Sun, and astronomers lost it. His calculation of its orbit let them find Ceres again at the end of that year.

Pierre-Simon Laplace, by Paulin Guérin (1838)
Public domain, Wikimedia Commons

Pierre-Simon Laplace explained why the normal curve occurs so frequently. In a memoir of 1810, and again in Théorie analytique des probabilités (1812), he proved an early central limit theorem. The sum of many small independent errors is approximately normal, whatever the distribution of each error. Because of this theorem, statisticians of the next century compared almost any large-sample average with the normal curve.

Show code
tibble(k = 30:70, p = dbinom(k, 100, 0.5)) |>
  ggplot(aes(k, p)) + geom_col(fill = "grey75") +
  stat_function(fun = \(x) dnorm(x, 50, 5), colour = "firebrick", linewidth = 1) +
  labs(x = "number of heads in 100 tosses", y = "probability")
Figure 2: De Moivre’s approximation: the binomial distribution for 100 tosses of a fair coin, and a normal curve with the same mean and SD.

1835–1846: Quetelet’s average man

Adolphe Quetelet, by Joseph-Arnold Demannez
Public domain, Wikimedia Commons

Adolphe Quetelet was a Belgian astronomer. He applied the error curve of the astronomers to people. In Sur l’homme (1835) he described l’homme moyen, the “average man”. In his model, nature aims at an ideal man and misses by random errors.

His best-known example appeared in 1846. He used the chest circumferences of 5,738 Scottish soldiers, from a table in the Edinburgh Medical and Surgical Journal (1817). A normal curve fits these data well. Many scientists of the time took this example as proof that the “law of error” was a law of nature.

Show code
m <- weighted.mean(ChestSizes$chest, ChestSizes$count)
s <- sqrt(weighted.mean((ChestSizes$chest - m)^2, ChestSizes$count))
ggplot(ChestSizes, aes(chest, count)) + geom_col(fill = "grey75") +
  stat_function(fun = \(x) sum(ChestSizes$count) * dnorm(x, m, s), colour = "firebrick", linewidth = 1) +
  labs(x = "chest circumference (inches)", y = "number of soldiers",
       subtitle = sprintf("n = %s, mean = %.1f in, SD = %.1f in", format(sum(ChestSizes$count), big.mark = ","), m, s))
Figure 3: Quetelet’s Scottish soldiers: chest circumference (inches) and a fitted normal curve.

1837 and 1898: Poisson and the Prussian cavalry

Siméon Denis Poisson
Public domain, Wikimedia Commons

Ladislaus von Bortkiewicz
Public domain, Wikimedia Commons

Siméon Denis Poisson derived his distribution in 1837. The book is about the probability that a court gives a correct verdict. Its title is Recherches sur la probabilité des jugements en matière criminelle et en matière civile. The Poisson distribution is the limit of the binomial when the number of trials is large and the probability of each event is small. De Moivre gave almost the same limit in 1711. This is one more example of Stigler’s law of eponymy: no discovery has the name of its discoverer.

Few people used the distribution until 1898. In that year Ladislaus von Bortkiewicz published Das Gesetz der kleinen Zahlen (The Law of Small Numbers). His best-known table gives the number of soldiers that horses kicked to death in the Prussian army from 1875 to 1894. Most analyses, and Fisher’s analysis, use the data for 10 army corps: 200 corps-years with 122 deaths. Each death is rare and independent of the others. These are the conditions for a Poisson distribution, and the Poisson fit is close.

deaths <- as.numeric(names(HorseKicks)); lambda <- sum(deaths * HorseKicks) / sum(HorseKicks)
rbind(observed = as.vector(HorseKicks), `Poisson (mean 0.61)` = round(200 * dpois(deaths, lambda), 1))
                     [,1] [,2] [,3] [,4] [,5]
observed            109.0 65.0 22.0  3.0  1.0
Poisson (mean 0.61) 108.7 66.3 20.2  4.1  0.6

1870s–1880s: Galton, the quincunx and regression

Francis Galton, c. 1890
Public domain, Wikimedia Commons

Galton’s quincunx, from Natural Inheritance (1889)
Public domain, Wikimedia Commons

Francis Galton was a half-cousin of Charles Darwin. In 1873 he built the quincunx, which we now also call a Galton board. Balls fall through rows of pins. At each pin a ball goes left or right at random. At the bottom, the balls make a bell shape.

The quincunx is a physical model of the result of de Moivre. Galton described it in 1877 and again in Natural Inheritance (1889).

Galton studied heredity. He compared the heights of parents with the heights of their adult children. Tall parents had tall children, but the children were less tall than their parents. Galton called this effect “regression towards mediocrity” (Journal of the Anthropological Institute, 1886).

We still use the word regression for linear models. In 1888 Galton defined the correlation coefficient (Proceedings of the Royal Society). Karl Pearson later gave it its modern product-moment form.

The name “normal” did not come from one person. Charles S. Peirce (1873), Wilhelm Lexis (1877) and Galton (1877) used it independently. Galton preferred the term “law of deviation”. Karl Pearson made “normal curve” the standard term.

Show code
ggplot(Galton, aes(parent, child)) + geom_count(colour = "steelblue", alpha = 0.6, show.legend = FALSE) +
  geom_abline(slope = 1, intercept = 0, linetype = "dashed") +
  geom_smooth(method = "lm", formula = y ~ x, se = FALSE, colour = "firebrick") +
  labs(x = "mid-parent height (inches)", y = "child height (inches)")
Figure 4: Galton’s family heights (928 adult children). The fitted line (red) is less steep than the line of equality (dashed). This is regression to the mean.

Before Student: large samples, probable errors and the z-test

In the nineteenth century, a test usually compared an observed difference with its standard error. The ratio then went to the normal curve. Today we call this a z-test. No one person invented it. It came from the error theory of Laplace and Gauss.

Authors usually gave the probable error, \(0.6745\,\sigma\), instead of the standard deviation. The probable error is half the width of the central 50% of a normal distribution. By convention, a deviation of approximately three probable errors showed a real effect. In 1885 Francis Ysidro Edgeworth used the word “significant” in this sense (“Methods of statistics”, Journal of the Statistical Society, Jubilee volume).

Later, Fisher gave the convention in the units that we use today. In Statistical Methods for Research Workers (1925) he wrote:

“The value for which P = .05, or 1 in 20, is 1.96 or nearly 2; it is convenient to take this point as a limit in judging whether a deviation is to be considered significant or not.”

He also wrote that three probable errors (\(3 \times 0.6745 = 2.02\)) is “effectively equivalent” to two standard errors. Thus the 5% level is a convenience from the probable-error period. No law of nature sets it.

The z-test has one assumption that became important. It uses the sample standard deviation as if it were the true standard deviation. For a large sample, the error from this assumption is small. For a sample of four or five observations, the error is large. Gosset studied this problem (see 1908, below).

1863–1922: the chi-square distribution and test

Friedrich Robert Helmert
Public domain, Wikimedia Commons

Karl Pearson, 1910
Public domain, Wikimedia Commons

In 1863 the physicist Ernst Abbe found the distribution of a sum of squared normal errors. The German geodesist Friedrich Robert Helmert found it again in 1875–1876, together with the distribution of the sample variance. Few statisticians knew these results. Karl Pearson found the distribution again in 1900.

Pearson was a mathematician at University College London. He introduced the term standard deviation in a lecture in 1893 and in print in 1894. In 1901 he and W. F. R. Weldon started the journal Biometrika, with support from Galton. In 1900 Pearson published the chi-square goodness-of-fit test in the Philosophical Magazine. The title of the paper was “On the criterion that a given system of deviations from the probable in the case of a correlated system of variables is such that it can be reasonably supposed to have arisen from random sampling”.

\[ \chi^2 = \sum \frac{(\text{observed} - \text{expected})^2}{\text{expected}} \]

One of his examples used the dice of Weldon. Weldon threw 12 dice 26,306 times. For each throw, he counted the dice that showed a 5 or a 6. If the dice are fair, this count is binomial with \(n = 12\) and \(p = 1/3\). Our calculation below rejects this model. The dice gave 5s and 6s a little more frequently than fair dice give them.

counts <- as.vector(WeldonDice)                         # 0, 1, ..., 9, 10+ fives-or-sixes
p <- dbinom(0:12, 12, 1/3); p <- c(p[1:10], sum(p[11:13]))
chisq.test(counts, p = p)

    Chi-squared test for given probabilities

data:  counts
X-squared = 35.494, df = 10, p-value = 0.0001028

Pearson made one error. For a contingency table, he used the number of cells minus one as the degrees of freedom. In 1922 the young R. A. Fisher showed that an \(r \times c\) table has \((r-1)(c-1)\) degrees of freedom. His paper was “On the interpretation of χ² from contingency tables, and the calculation of P” (Journal of the Royal Statistical Society). Pearson did not accept the correction. The two men stayed enemies until Pearson died in 1936.

1908: Student’s t-test

William Sealy Gosset (“Student”)
Public domain, Wikimedia Commons

Guinness brewery gate, St James’s Gate, Dublin
Photo: Karlunun. CC0, Wikimedia Commons

William Sealy Gosset studied chemistry and mathematics at Oxford. In 1899 he started work at the Guinness brewery in Dublin. Guinness wanted to use science to make its beer. Gosset did experiments on barley, hops and yeast, often with only a few plots or a few batches. The large-sample methods of the time gave incorrect answers for these data. With four or five numbers, the sample standard deviation itself has a large error.

In 1906–07 Guinness sent Gosset to the laboratory of Karl Pearson in London. In 1908 Gosset published “The Probable Error of a Mean” (Biometrika, vol. 6) with the pen name “Student”. Guinness let its staff publish scientific work only if they did not give their names. A frequent story says that this rule came after an employee disclosed trade secrets. We know of no document that supports this story.

What Student did

Student used the statistic \(z = (\bar{x} - \mu)/s\). Here \(s\) is the sample SD with divisor \(n\). He found the distribution of \(z\) for samples from a normal population. He got its mathematical form partly from its moments, but he could not prove it. Thus he did a check by simulation.

He used the measurements of 3,000 criminals from W. R. Macdonell (Biometrika, 1902). He wrote the height and the left middle-finger length of each man on a card. Then he shuffled the cards and took 750 samples of 4. The code below does his experiment again with the same data.

Show code
heights <- rep(Macdonell$height, Macdonell$frequency)          # 3,000 men, as on Gosset's cards
mu <- mean(heights)
shuffled <- sample(heights)                                     # shuffle the cards
z <- sapply(split(shuffled, rep(1:750, each = 4)), function(x) {
  s <- sqrt(mean((x - mean(x))^2))                              # Student's divisor n
  (mean(x) - mu) / s
})
student_z <- function(z, n = 4) sqrt(n - 1) * dt(z * sqrt(n - 1), df = n - 1)   # since t = z * sqrt(n - 1)
ggplot(tibble(z = z[abs(z) < 4]), aes(z)) +
  geom_histogram(aes(y = after_stat(density)), binwidth = 0.2, fill = "grey75") +
  stat_function(fun = student_z, colour = "firebrick", linewidth = 1) +
  stat_function(fun = \(z) dnorm(z, 0, 1 / sqrt(4)), linetype = "dashed") +   # z if s were the true sigma
  labs(x = expression(z == (bar(x) - mu) / s), y = "density")
Figure 5: Gosset’s 1908 experiment, done again: 750 random samples of 4 from the heights of 3,000 criminals. The histogram of z agrees with Student’s curve (red). It does not agree with the normal curve that a large-sample z-test assumes (dashed).

Student’s curve has thicker tails than the normal curve. If you use \(s\) as if it were the true \(\sigma\) (the dashed curve), a small-sample result looks more significant than it is.

Student’s example: the sleep data

The R sleep dataset is the worked example of Student. The data came from a 1905 paper by Arthur Cushny and Alvin Peebles in the Journal of Physiology. They gave two sleep drugs to patients and recorded the hours of extra sleep. Student analysed the ten paired differences.

Student also gave the drugs incorrect names. He called them D- and L-hyoscyamine, but the two columns are L-hyoscyamine and L-hyoscine, two different compounds. The R help page repeats this error.

with(sleep, t.test(extra[group == 2], extra[group == 1], paired = TRUE))

    Paired t-test

data:  extra[group == 2] and extra[group == 1]
t = 4.0621, df = 9, p-value = 0.002833
alternative hypothesis: true mean difference is not equal to 0
95 percent confidence interval:
 0.7001142 2.4598858
sample estimates:
mean difference 
           1.58 

In 1907 Gosset also wrote a Biometrika paper on the error when you count yeast cells with a haemacytometer. In it he derived the Poisson distribution himself, without reference to Poisson.

From z to t

In 1912 Ronald Fisher was 22 and a new Cambridge graduate. He sent Gosset a full proof of the distribution, with the geometry of \(n\)-dimensional space. Fisher published the proof in 1915, in his Biometrika paper on the distribution of the correlation coefficient. Fisher then wrote the statistic of Student in a new form:

\[ t = z\sqrt{n-1} = \frac{\bar{x} - \mu}{s/\sqrt{n}}, \quad s \text{ with divisor } n-1. \]

This form agrees with the Fisher concept of degrees of freedom. With it, one table serves the one-sample, paired and two-sample tests, and the tests for regression coefficients. The letter t first appeared in print in 1925. It is in two papers in the journal Metron, “Applications of Student’s distribution” by Fisher and the new tables of Student. It is also in Statistical Methods for Research Workers by Fisher.

Gosset was modest about his tables. In the early 1920s he sent Fisher a copy and wrote that Fisher was “the only man that’s ever likely to use them!”

Gosset stayed a brewer for all of his life. In 1935 he became Head Brewer of the new Guinness brewery at Park Royal, London. In 1937 he became Head Brewer of all Guinness. He died on 16 October 1937.

Unequal variances

The two-sample test of Student assumes that the two groups have the same variance. W.-V. Behrens described the general problem in 1929, and Fisher discussed it in 1935. B. L. Welch (Biometrika, 1938 and 1947) and F. E. Satterthwaite (Biometrics Bulletin, 1946) gave an approximate solution with fractional degrees of freedom. The R function t.test() uses this solution by default. Thus its output says “Welch Two Sample t-test”.

1918–1934: Fisher, Rothamsted and the F-test

Ronald Aylmer Fisher, 1913
Public domain, Wikimedia Commons

George W. Snedecor
Public domain, Wikimedia Commons

Fisher introduced the word variance in 1918. His paper showed that Mendelian genetics can explain the continuous variation that Galton measured. In 1919 Fisher started work at Rothamsted Experimental Station, an agricultural research station north of London. His first task was to analyse decades of crop records.

At Rothamsted he developed the analysis of variance. The method divides the total variation in yield into parts for fertilisers, varieties and blocks, plus a residual. Then it compares each part with the residual. The first ANOVA tables appeared in 1923. One of them was in a study by Fisher and Winifred Mackenzie on the response of potato varieties to manure.

To compare two variances, Fisher used

\[ z = \tfrac{1}{2} \ln \frac{s_1^2}{s_2^2}. \]

He gave the distribution of \(z\) in a paper at the International Congress of Mathematicians in Toronto in 1924 (printed in 1928). His book Statistical Methods for Research Workers (1925) gave these methods and tables to scientists who did experiments. The book had 14 editions.

The logarithm in \(z\) made the mathematics easier, but it made the tables harder to use. Prasanta Chandra Mahalanobis founded the Indian Statistical Institute in Kolkata in 1931. In 1932 he published tables of the variance ratio itself. In 1934 George W. Snedecor, director of the Statistical Laboratory at Iowa State College, did the same in a booklet that many people used. Snedecor called the ratio F, in honour of Fisher:

\[ F = \frac{s_1^2}{s_2^2} = e^{2z}. \]

Fisher preferred his own \(z\). The new letter did not please him, although Snedecor intended it as a compliment. The letter F stayed in use.

The F-test and the t-test have a close relation. For two groups, the ANOVA F statistic is equal to the square of the equal-variance t statistic.

tt <- t.test(extra ~ group, data = sleep, var.equal = TRUE)       # the two groups as independent samples
ft <- anova(lm(extra ~ group, data = sleep))
c(t_squared = unname(tt$statistic^2), F = ft$`F value`[1])
t_squared         F 
 3.462627  3.462627 

1935: the lady tasting tea

The book The Design of Experiments (1935) by Fisher starts with a lady. She says that she can identify the cups where the milk went in first. Fisher designs a test.

The lady gets eight cups in random order, four of each type. She must find the four milk-first cups. If she only guesses, each choice of four cups has the same probability. Then the probability that she finds all four is \(1/\binom{8}{4} = 1/70 \approx 0.014\).

This is Fisher’s exact test. Frank Yates (1934) and J. O. Irwin (1935) published the same test independently. Fisher did not give the name of the lady. Later accounts say that she was Muriel Bristol, an algae biologist at Rothamsted. The story that she identified all the cups correctly comes from later anecdotes, not from Fisher.

The principles of the book are more important than the tea: randomisation, replication and blocking. Randomisation makes the reference distribution of the test valid.

tea <- matrix(c(4, 0, 0, 4), 2, dimnames = list(poured = c("milk first", "tea first"),
                                                guessed = c("milk first", "tea first")))
fisher.test(tea, alternative = "greater")$p.value
[1] 0.01428571

1928–1933: Neyman and Pearson, two types of error

Jerzy Neyman
Photo: Konrad Jacobs, MFO. CC BY-SA 2.0 de, Wikimedia Commons

A significance test of Fisher has one hypothesis and gives one number, the P-value. Jerzy Neyman, a Polish mathematician, and Egon Pearson, the son of Karl Pearson, asked a different question: which test is the best? In papers in Biometrika (1928) and the Philosophical Transactions of the Royal Society (1933), they added an alternative hypothesis. They also defined two types of mistake. An error of the first kind (now Type I) rejects a true null hypothesis. An error of the second kind (Type II) accepts a false null hypothesis.

The power of a test is the probability that it rejects a false null hypothesis. The Neyman–Pearson lemma shows that the likelihood ratio gives the most powerful test. Fisher did not accept this framework. He compared it to acceptance procedures in industry, not to scientific inference. The argument between Fisher and Neyman continued until Fisher died in 1962. Modern practice uses parts of both: the P-values of Fisher, and the fixed \(\alpha = 0.05\), power and sample-size calculations of Neyman and Pearson.

1945–1947: tests without the normal distribution

Frank Wilcoxon was a chemist at the American Cyanamid company. He wanted a fast test that did not assume a normal distribution. In “Individual comparisons by ranking methods” (Biometrics Bulletin, 1945), he replaced the data with their ranks. This gave the rank-sum and signed-rank tests. In 1947 Henry Mann and Donald Whitney extended the rank-sum test to samples of different sizes (Annals of Mathematical Statistics). See the animated Wilcoxon rank-sum test.

Sources and further reading