Correlation vs covariance
5 min read
Short answer
Covariance measures how two variables vary together, but its size depends on the units. Correlation rescales it: , which always lies between and . Correlation near means a strong linear relationship; near 0 means little linear relationship.
Reading correlation
is a perfect increasing line, a perfect decreasing line, and means no linear association. Squared, is the fraction of variation in one variable explained by a linear fit to the other.
What it cannot tell you
Correlation does not mean causation, can be produced by a third hidden factor, is thrown off by outliers, and misses curved relationships. Always look at a scatter plot as well as the number.
Worked example
For the data and , compute the sample covariance and correlation.
, . Deviations: : ; : .
, , .
Sample covariance . A very strong positive linear relationship.
Try it yourself
If the covariance of and is 12, and , what is the correlation?
Show the answer
, a strong positive linear relationship.
Keep going with practice
Covariance and correlation connect Vidi's probability lessons to the symmetric matrices of its linear algebra lessons.