Covariance Calculator
Calculate the population and sample covariance between two paired data sets.
Enter two paired data sets. Both lists must be non-empty and have the same number of values.
Sample Covariance
Population Covariance
Count (n)
Mean of X (x̄)
Mean of Y (ȳ)
Calculation Steps
What Covariance Measures
Covariance measures the joint variability of two variables, X and Y. A positive covariance means the two variables tend to increase together, while a negative covariance means that as one variable increases, the other tends to decrease. A covariance near zero suggests little linear relationship between the variables.
Population vs Sample Covariance
Population covariance divides the sum of products of deviations by n and is used when your data includes every member of the group you care about. Sample covariance divides by n − 1 and is used when your data is only a sample drawn from a larger population.
- Population: cov(X, Y) = Σ(xᵢ − x̄)(yᵢ − ȳ) / n
- Sample: cov(X, Y) = Σ(xᵢ − x̄)(yᵢ − ȳ) / (n − 1)
Covariance and Correlation
Covariance shares the sign of the relationship with the correlation coefficient, but its magnitude depends on the units of the data, making it hard to interpret on its own. Dividing the covariance by the product of the standard deviations of X and Y yields the correlation coefficient, a standardized measure between −1 and 1.