Covariance Calculator

Calculate the covariance between two variables (Sample or Population).
Calculator
Enter your values
Analysis
Interpretation of the current calculator output

Enter values to see detailed analysis and insights.

How to Use

Step-by-step instructions
  1. 1Enter the values for variable X.
  2. 2Enter the values for variable Y.
  3. 3Select Sample or Population.
  4. 4The calculator will compute the covariance.

Covariance Formula

Covariance measures how two variables change together. A positive covariance indicates that the variables tend to move in the same direction, while a negative covariance indicates they move in opposite directions. For population covariance, divide by n instead of n-1.
Cov(X,Y) = Sum(x - xBar)(y - yBar) / (n - 1)

Variables:

x, yIndividual data points
xBar, yBarMeans of X and Y
nSample size

Example

Simple Dataset

Inputs:

X:2, 4, 6
Y:5, 10, 15

Steps:

  1. 1.Means: xBar = 4, yBar = 10
  2. 2.Deviations X: -2, 0, 2
  3. 3.Deviations Y: -5, 0, 5
  4. 4.Products: 10, 0, 10
  5. 5.Sum: 20
  6. 6.Sample Covariance: 20 / (3-1) = 10
Result:
10

Frequently Asked Questions

What is the difference between covariance and correlation?

Covariance indicates the direction of the linear relationship between variables, while correlation measures both the strength and direction. Correlation is a standardized version of covariance.