Skip to main content

Covariance

Covariance measures whether two variables move together, positive when both tend to rise above their means simultaneously and negative when one rises as the other falls, though its size depends on the units of measurement.

Also known ascov

ByHoang TruongUpdated

See it move

Loading infographic...

A scatter chart with a fitted trend line plots advertising spend (€'000) on the horizontal axis against sales (€'000) on the vertical axis. The covariance between spend and sales is reported as 4, indicating a positive relationship: when spend is above its mean, sales tend also to be above their mean, so the data points cluster in the upper-right and lower-left quadrants around the two means.

Where it fits
TopicDescriptive StatisticsCoreSubjectData Analysis & StatisticsCore

The formula

LaTeX
Cov(X,Y)=i=1n(XiXˉ)(YiYˉ)n1\text{Cov}(X,Y) = \frac{\sum_{i=1}^{n}(X_i - \bar{X})(Y_i - \bar{Y})}{n - 1}

Variables

Individual observation of variable X ()
Individual observation of variable Y ()
Sample mean of X ()
Sample mean of Y ()
Number of paired observations ()

Sample covariance

Check yourself

PracticeCORE

An analyst observes four café outlets and records monthly advertising spend and sales revenue for each. The sum of the products of deviations from their respective means, Σ(xi − x̄)(yi − ȳ), equals 18. What is the sample covariance between advertising spend and sales?

Select an answer to check your understanding.
Covariance — How Two Variables Move Together