Using Excel to calculate Two-Variable Correlation

Wednesday, June 6, 2012

Using Excel to calculate Two-Variable Correlation

  • Correlation coefficient.
  • Calculation using the Data Analysis Add-in.
  • Calculation using the CORREL function.
  • Covariances.

CORRELATION COEFFICIENT

The correlation coefficient between two series, say x and y, equals
  Covariance(x,y) / [Sqrt(Variance(x)) * Sqrt(Variance(y))]
where
  • Covariance(x,y) is the sample covariance between x and y:  (1/(n-1)) × Σ i (xi - xbar)(yi - ybar)
  • Variance(x) is the sample variance of x: (1/(n-1)) × Σ i (xi - xbar)2
  • Variance(x) is the sample variance of y: (1/(n-1)) × Σ i (yi - ybar)



CALCULATION USING THE DATA ANALYSIS ADD-IN (Lean how to activate it here)

The data used can be downloaded here here
We consider only two series, but we could do the same for more than two series.

  • In the Data Group select the Data Analysis Add-in
  • Select Correlation
  • Fill out the Correlation dialog box as below
The Data, Click on Data Analysis (Data > Data Analysis) 



When you click data analysis,







When you click OK,

  The Result

 

0 comments: