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 {(X_{i}, Y

_{i})}

_{i = 1...n}, the covariance of X and Y is

Covariance(X,Y) = (1/n)Σ (X

_{i}- μ

_{X})(Y

_{i}- μ

_{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))Σ (X

_{i}- x)(Y

_{i}- 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)Σ (X

_{i}- μ

_{X})²

Var(Y) = Cov(Y,Y) = (1/n)Σ (Y

_{i}- μ

_{Y})²

Samp. Var(X) = Samp. Cov(X,X) = (1/(n-1))Σ (X

_{i}- x)²

Samp. Var(Y) = Samp. Cov(Y,Y) = (1/(n-1))Σ (Y

_{i}- 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
*