The covariance is a numerical quantity that measures the degree of interdependence between two variables. Whenever the change in one variable affects a change in another variable then we say that the two variables are covariates. Some examples of correlated variables are demand and supply, IQ score and marks in exam, income and expenditure, etc.

**We can have two different types of Covariance**:

- Positive Covariance – Whenever the increase in value of one variable leads to increase in the value of the other variable or if the decrease in one variable leads to decrease in the other variable, then we say the two variables have positive covariance. An example of this is income and expenditure because as the income increases so does the expenditure and if the income decreases so does the expenditure.
- Negative Covariance – Whenever the increase in value of one variable leads to decrease in the value of the other variable, then we say the two variables have negative covariance. An example of this is price and supply because as the supply increases the price decreases.

If the covariance is 0 then it means that there is no linear relationship between the two variables under study. This means that the two variables are not affected by each other.

**Formula for Covariance**:

The covariance between two variables X and Y can be calculated using the formula:

**Example of Calculating Covariance:**

Suppose you are given the following data about two variables X and Y. Calculate the covariance between them.

X | Y |

1 | 3 |

4 | 4 |

5 | 8 |

6 | 13 |

**Solution**: We first calculate the means and x̄ and ȳ as required in the above formula,

x̄ = 1+4+5+7/4 = 16/4 = 4

ȳ = 3+4+8+13 = 28/4 = 7

X | Y | (x-x̄) | (y- ȳ) | (x-x̄)(y- ȳ) |

1 | 3 | -3 | -4 | 12 |

4 | 4 | 0 | -3 | 0 |

5 | 8 | 1 | 1 | 1 |

6 | 13 | 2 | 6 | 12 |

∑(x-x̄)(y- ȳ)= 25 |

So, Covariance = ∑(x-x̄)(y- ȳ)/n = 25/4 = 6.25 and hence we conclude that the two variables are have positive covariance.

**Covariance vs Variance**:

The concepts of covariance and variance are different. Covariance is about measuring the relationship between * two variables* whereas, variance is a measure of the spread of the data for a

*.*

__single variable__**Covariance and Covariance**:

The concepts of covariance and correlation are similar as both measure the linear relationship between two variables. The difference is that the correlation coefficient is a standardized value of the covariance and therefore the correlation coefficient always has a value lying between -1 and 1.