# Thread: simplifying the correlation coefficient

1. ## simplifying the correlation coefficient

Hi,

I am trying to understand the following simplification.
I cannot see how to get from the one step to the other.

$\displaystyle \sum (x_i - \bar{x})(y_i - \bar{y})$

we get

$\displaystyle \sum (x_i y_i - y_i \bar{x} - x_i \bar{y} + \bar{x}\bar{y})$

and then (how do they get to this step?)

$\displaystyle \sum (x y) -n\bar{x}\bar{y} -n\bar{x}\bar{y} +n\bar{x}\bar{y}$

and then (very obviously)
$\displaystyle \sum (x y) -n\bar{x}\bar{y}$

It can be seen on wolfram mathworld:
Correlation Coefficient -- from Wolfram MathWorld

I get the following.
$\displaystyle \sum (x_i y_i) + n\bar{x}\bar{y} -n(\bar{x}\sum y_i + \bar{y}\sum x_i)$

How does the simplification from step 2 to step 3 happen.
My simplification is not the same, and I don't see how to make it simpler.

Thanks
Regards
Craig

2. $\displaystyle \displaystyle \overline{x}=\frac{\sum{x}}{n},$ so $\displaystyle \displaystyle n\overline{x}=\sum{x}.$