Linear regression and Pearson correlation
Find the least squares line, the Pearson coefficient, and R² for pairs of numerical observations.
Calculate the result
Worked example
Problem
Find the least-squares line and the Pearson correlation coefficient for the pairs (1, 2), (2, 4), (3, 5), and (4, 7).
The fitted line is ŷ = 0.5 + 1.6x. The Pearson correlation coefficient is approximately 0.9923.
Find the centered moments
Calculate the slope and intercept
Compute Pearson
Common mistake
A strong linear correlation does not prove causality. Variation in x is needed for a unique slope, and variation in both variables is needed for Pearson.
