Covariance Calculator
Measures whether two variables move together, and in which direction.
Sample covariance (n − 1)
—
Share sends a link that reopens these numbers. Copy details pastes the full breakdown as a list.
Values read in each list —
Population covariance (n) —
Mean of X —
Mean of Y —
Reading this —
The formula
sample cov = Σ(x − x̄)(y − ȳ) ÷ (n − 1) population cov = Σ(x − x̄)(y − ȳ) ÷ n
In a spreadsheet, COVARIANCE.S and COVARIANCE.P are the two versions.
What to watch out for
Change the units of X from metres to centimetres and the covariance grows 100 times, though the relationship is the same.
Frequently Asked Questions
What is the difference between covariance and correlation?
Correlation is covariance divided by both standard deviations, which removes the units and puts it on a −1 to 1 scale.
What is a worked example?
For X = 1, 2, 3 and Y = 2, 4, 7, the sample covariance is 2.5.