Skip to content

Mathematics and Statistics · Ch 14 — Correlation

Karl Pearson's Coefficient of Correlation

3

Karl Pearson's Coefficient of Correlation

A scatter diagram shows direction but not an exact strength. Karl Pearson's coefficient of correlation, denoted rr (or rxyr_{xy}), measures the degree of linear correlation between two variables by a single number. For nn pairs (xi,yi)(x_i, y_i) with means xˉ\bar x and yˉ\bar y, it is defined as the ratio of the covariance of xx and yy to the product of their standard deviations:

r=Cov⁡(x,y)σx σy,Cov⁡(x,y)=1n∑(xi−xˉ)(yi−yˉ).r = \frac{\operatorname{Cov}(x, y)}{\sigma_x\, \sigma_y}, \qquad \operatorname{Cov}(x, y) = \frac{1}{n}\sum (x_i - \bar x)(y_i - \bar y).

Writing this out in full (the 1n\tfrac1n factors cancel), the working formulae are:

r=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2 ∑(yi−yˉ)2(deviations from the mean)r = \frac{\sum (x_i - \bar x)(y_i - \bar y)}{\sqrt{\sum (x_i - \bar x)^2}\ \sqrt{\sum (y_i - \bar y)^2}} \qquad\text{(deviations from the mean)}

and, expanded so it can be used straight from the raw totals,

r=n∑xy−∑x∑yn∑x2−(∑x)2 n∑y2−(∑y)2.r = \frac{n\sum xy - \sum x \sum y}{\sqrt{n\sum x^2 - (\sum x)^2}\ \sqrt{n\sum y^2 - (\sum y)^2}}.

The two formulae are algebraically identical; use the deviation form when the means are whole numbers and the raw-total form otherwise.

Properties of rr (each worth knowing for theory questions):

  1. rr lies between −1-1 and +1+1, i.e. −1≤r≤+1-1 \le r \le +1. It can never exceed these limits; a computed value outside this range signals an arithmetic error.
  2. Sign shows direction: r>0r > 0 means positive correlation, r<0r < 0 negative, r=0r = 0 no linear correlation.
  3. rr is a pure number — it has no unit and does not depend on the units of measurement (rupees, kg, cm all give the same rr). …
Definition 1Karl Pearson's coefficient ($r$)

A measure of the degree of linear correlation between two variables, equal to Cov⁡(x,y)σxσy\dfrac{\operatorname{Cov}(x,y)}{\sigma_x \sigma_y}; it always l …

Definition 2Covariance

The average of the products of paired deviations, Cov⁡(x,y)=1n∑(xi−xˉ)(yi−yˉ)\operatorname{Cov}(x,y) = \dfrac1n \sum (x_i - \bar x)(y_i - \bar y); its sign gives the dir …