Calculates the covariance as Σ(x − x̄)(y − ȳ) ÷ count. A positive value means y tends to be large when x is large; a negative value means the opposite. List the same number of x and y values.
Covariance measures whether two variables move together. Multiply each pair of deviations from the means and average the results.
The sign is what carries the meaning.
With = 1, 2, 3, 4, 5 and = 2, 4, 5, 4, 5, the means are and . The products of the deviations are:
The positive result says that tends to rise with .
The size of a covariance means very little on its own. Its units are the units of times the units of , so switching from centimetres to millimetres multiplies it by ten without changing the relationship at all.
To measure the strength of the relationship, divide the covariance by both standard deviations to cancel the units. That gives the correlation coefficient. In practice, covariance is best seen as the raw material from which correlation is built.