Copyright © Had2Know 2010-2024. All Rights Reserved.
Terms of Use | Privacy Policy | Contact
Site Design by E. Emerson
Covariance and Correlation Calculator
Covariance is a measure of how two random variables change together. For paired data (X, Y), if the values of Y tend to increase as the values of X increase, the covariance will be positive. If Y tends to decrease as X increases, covariance is negative. The correlation coefficient r (also called Pearson's correlation coefficient) indicates the strength of the relationship. When |r| is close to the 1, there is a strong linear relation between X and Y. See calculator and equations below.
Enter paired data as shown in the input field on the left; you can enter as many points as necessary. Do not end the list with a comma.
Covariance Formula
Given a set of paired X and Y data {(Xi, Yi)}i = 1...n, the covariance of X and Y isCovariance(X,Y) = (1/n)Σ (Xi - μX)(Yi - μY)
where μX and μY are the population means of X and Y respectively. If μX and μX are replaced by the sample mean of X and Y, then the sample covariance is
Sample Covariance(X,Y) = (1/(n-1))Σ (Xi - x)(Yi - y)
where x and y are the sample mean of X and Y respectively. These equations are analogous to the equations for variance and sample variance:
Var(X) = Cov(X,X) = (1/n)Σ (Xi - μX)²
Var(Y) = Cov(Y,Y) = (1/n)Σ (Yi - μY)²
Samp. Var(X) = Samp. Cov(X,X) = (1/(n-1))Σ (Xi - x)²
Samp. Var(Y) = Samp. Cov(Y,Y) = (1/(n-1))Σ (Yi - y)²
Pearson's Correlation Coefficient
Pearson's correlation coefficient is a normalized measure of covariance that ranges from -1 to 1. Values at the extreme end indicate a strong linear relation between the two variables. The expression for the correlation coefficient isr = Cov(X,Y)/√Var(X)Var(Y)
© Had2Know 2010