Biostatistics Study NotesFrom concepts and derivations to interpretation

CHAPTER 07 · TOPIC 02

Pearson Correlation

Measure linear association between two quantitative variables and connect Pearson’s r with the regression slope, R², t tests, and F tests.

On this page
  1. Calculating Pearson? r
  2. Checks before Using Pearson? r
  3. Relationship to the Regression Slope
  4. r², R², explained variation
  5. Test for population correlation ρ=0
  6. Why correlation tests and regression F tests agree

The Pearson product-moment correlation coefficient, r, expresses the direction and strength of a linear relationship between two quantitative variables on a unit-independent scale from -1 to 1.

Calculating Pearson? r#

r=(XiXˉ)(YiYˉ)(XiXˉ)2(YiYˉ)2r=\frac{\sum(X_i-\bar X)(Y_i-\bar Y)}{\sqrt{\sum(X_i-\bar X)^2}\sqrt{\sum(Y_i-\bar Y)^2}}
Expression by covariancer=sXYsXsYr=\frac{s_{XY}}{s_Xs_Y}
range1r1-1\le r\le1

A positive value indicates that the variables tend to move in the same direction, whereas a negative value indicates opposite directions. The closer |r| is to 1, the more closely the observations follow a straight line. r=0 only indicates that there is no linear relationship; it does not negate the curvilinear relationship.

Checks before Using Pearson? r#

  • Both variables are quantitative
  • The scatterplot shows an approximately linear relationship
  • Observations are independent
  • Outliers and mixtures of groups do not dominate r
  • Bivariate normality or reasonable large sample approximation in inference

Relationship to the Regression Slope#

b1=rsYsXb_1=r\frac{s_Y}{s_X}

r is scale invariant, but the slope has Y units/X units. Even if the signs are the same, the same r does not necessarily mean the same real effect.

r², R², explained variation#

simple regressionr2=R2=SSRSSTr^2=R^2=\frac{SS_R}{SS_T}
percentage100r2%100r^2\%

In a simple regression with an intercept, r² is the proportion of the total variation in Y that the linear model explains. r itself is not interpreted as a percentage.

Test for population correlation ρ=0#

two-sided hypothesisH0:ρ=0,H1:ρ0H_0:\rho=0,\qquad H_1:\rho\ne0
t-statistict=rn21r2t=\frac{r\sqrt{n-2}}{\sqrt{1-r^2}}
degrees of freedomdf=n2df=n-2

Why correlation tests and regression F tests agree#

relationship to sums of squaresr2=SSRSSTr^2=\frac{SS_R}{SS_T}
t squaredt2=r2(n2)1r2t^2=\frac{r^2(n-2)}{1-r^2}
conversion to Ft2=SSR/1SSE/(n2)=Ft^2=\frac{SS_R/1}{SS_E/(n-2)}=F