How this calculator works
Each cross-product combines the deviations of a paired x and y from their respective means. Same-sign deviations add positively; opposite signs add negatively. Divide the total by n for a whole population or by n - 1 for a sample estimate. Covariance has compound units, such as kilograms times metres, so its magnitude depends on the scales used.
Formula
Covpopulation = Σ((x - meanX)(y - meanY))/n; Covsample uses n - 1. With consistent summaries, Cov = r × SDx × SDy.
Worked example
For x = 1, 2, 3 and y = 2, 4, 4, the centred cross-products sum to 2. The sample covariance is 1 and the population covariance is 2/3.
Advertisement
Frequently asked questions
Why is covariance not limited to -1 and 1?
It retains the scales and units of both variables. Correlation divides out their standard deviations.
May one variable be constant?
Yes. Its deviations are zero, so covariance is zero. A corresponding correlation is undefined.
Which standard deviations should I enter?
Use standard deviations and correlation calculated from the same data with consistent sample or population conventions.