Pearson’s formula: what the sums Σx, Σy, Σxy, Σx² and Σy² mean and how they fit the formula
Pearson’s correlation coefficient turns a cloud of dots into one number. For n pairs (x, y) it is r = (nΣxy − Σx·Σy) ÷ (√(nΣx² − (Σx)²) × √(nΣy² − (Σy)²)). The symbol Σ means “the sum of”. So Σx adds all the x-values, Σy adds all the y-values, Σxy multiplies the two numbers of each pair first and then adds the products, Σx² squares each x first and then adds, and Σy² does the same for y. Do not confuse Σx² with (Σx)²: in the first we square then add, in the second we add then square, and the results differ. Why these five sums? If x and y had no relation, the sum of the products would be close to Σx·Σy ÷ n. The numerator is n times the difference between the real sum of products and this “no relation” value: it is positive when large x go with large y, and negative when large x go with small y. Each root in the denominator measures how spread out one variable is; it is zero only when all its values are equal. Dividing by both spreads removes the units and keeps r between −1 and 1. The table below is the working for five pairs: the number of rehearsals of a school play (x) and the judges’ score out of 10 (y).
| Rehearsals x | Judges’ score y | xy | x² | y² |
|---|---|---|---|---|
| 1 | 3 | 3 | 1 | 9 |
| 2 | 4 | 8 | 4 | 16 |
| 3 | 4 | 12 | 9 | 16 |
| 4 | 6 | 24 | 16 | 36 |
| 5 | 8 | 40 | 25 | 64 |
| Σx = 15 | Σy = 25 | Σxy = 87 | Σx² = 55 | Σy² = 141 |
Write four pairs of small whole numbers (for example the number of pages read and the minutes spent on four evenings). Make the five columns, find the five sums and the numerator nΣxy − Σx·Σy. Is it positive or negative, and does that agree with the way the numbers move?