Correlation
Pearson's correlation
-
Positive
corresponds to a positive slope. -
Negative
corresponds to a negative slope. -
At
, all points lie on the fitted line. -
At
, the best line is the mean of . -
is unitless.
With one (numerical) predictor and an intercept,
where
In general, correlation is not the slope: the slope has units and changes when you change measurement units. Correlation is unitless. Swapping
R-squared: R² = r²
The fitted line minimizes the sum of squared vertical residuals. Compare that error with predicting the sample mean for everyone:
Correlation measures linear relations
A correlation near zero can be a poor summary of a striking nonlinear
pattern. In both examples below,
Large positive and negative x both give large y. The horizontal line misses the U-shaped relationship.
The peaks and troughs are perfectly predictable from x, but a straight line captures none of that structure.
The dashed lines are the least-squares straight lines. Their
The numbers are not mathematically meaningless: they correctly report almost no linear association. They become misleading when treated as measures of every kind of relationship. Always inspect the scatter plot. Zero correlation does not imply independence.
For more on fitting regression models, see Linear Models.