/    /  Statistics – Covariance

Statistics – Covariance:

The covariance of two variables and in a data set is a measure of the directional relationship between them. A positive covariance indicates a positive linear relationship between the variables which move together. A negative covariance indicates that the variables move inversely. Covariance is similar to variance except that we have two variables x and y.

Sample covariance, sxyCovariance 1 (i2tutorials.com)

Population covariance, σxy =Covariance 2 (i2tutorials.com)

For a scatter plot of two variables the covariance measures how close the scatter is to a line. Positive covariance corresponds to upward-sloping scatter plots. Negative covariance corresponds to downward-sloping scatter plots. Covariance is scale dependent and has units. Nonlinear dependencies have zero covariance. Independence implies zero covariance. The value for a perfect linear relationship depends on the data because covariance values are not standardized.

There is confusion in understanding terms covariance and correlation. Here are some of the differences:

The correlation coefficient is a function that uses covariance. The correlation coefficient is the covariance divided by the product of the respective standard deviations of the variables.

Covariance is a measure of a correlation while correlation is a scaled version of covariance.

Covariance can involve the relationship of two variables or data sets whereas correlation can involve the relationship of several variables.

Correlation values range from +1 to -1. But, covariance values can exceed this scale.

The Spearman correlation coefficient tells how close or far two variables are independent from each other. The covariance calculation tells you how much two variables tend to change together.

In Excel, we have the function COVAR (array 1, array 2) where arrays are the 2 different data sets.

Covariance 3(i2tutorials.com)