Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Solving for Correlation


r=r= correlation, where −1≤r≤1-1\le r\le1



r=1n−1∑(xi−xˉSx)(yi−yˉSy)=∑XY−(∑X)(∑Y)n(n−1)SxSy=(SSxy)2(SSxx)(SSyy)\displaystyle\boxed{ \large r=\frac{1}{n-1}\sum\Big(\frac{x_i-\bar{x}}{S_x}\Big)\Big(\frac{y_i-\bar{y}}{S_y}\Big)=\frac{\sum XY-\frac{(\sum X)(\sum Y)}{n}}{(n-1)S_xS_y}=\sqrt{\frac{\color{green}(SS_{xy})\color{black}^2}{\color{blue}(SS_{xx})\color{Red}(SS_{yy})}}}



where

Sx=∑(xi−xˉ)2n−1=SSxxn−1\large S_x=\sqrt\frac{\sum(x_i-\bar{x})^2}{n-1}=\sqrt{\frac{SS_{xx}}{n-1}}



Sy=∑(yi−yˉ)2n−1=SSyyn−1\large S_y=\sqrt{\frac{\sum(y_i-\bar{y})^2}{n-1}}=\sqrt{\frac{SS_{yy}}{n-1}}



SSxx=∑(xi−xˉ)2=∑xi2−(∑xi)2n\color{blue}SS_{xx}=\sum(x_i-\bar{x})^2=\sum x^2_i-\frac{(\sum x_i)^2}{n}


SSyy=∑(yi−yˉ)2=∑yi2−(∑yi)2n\color{red}SS_{yy}=\sum(y_i-\bar{y})^2=\sum y^2_i-\frac{(\sum y_i)^2}{n}


SSxy=∑(xi−xˉ)(yi−yˉ)=∑xiyi−(∑xi)(∑yi)n\color{green}SS_{xy}=\sum(x_i-\bar{x})(y_i-\bar{y})=\sum x_iy_i-\frac{(\sum x_i)(\sum y_i)}{n}









Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Example: Solving for Correlation


Find the correlation coefficient and interpret it.



Image illustrating Example


∑x=30\sum x=30

∑y=25\sum y=25

∑xy=122\sum xy=122

∑x2=220\sum x^2=220

∑y2=159\sum y^2=159



r=1n−1∑(xi−xˉSx)(yi−yˉSy)=∑XY−(∑X)(∑Y)n(n−1)SxSy=(SSxy)2(SSxx)(SSyy)\displaystyle{ \large r=\frac{1}{n-1}\sum\Big(\frac{x_i-\bar{x}}{S_x}\Big)\Big(\frac{y_i-\bar{y}}{S_y}\Big)=\frac{\sum XY-\frac{(\sum X)(\sum Y)}{n}}{(n-1)S_xS_y}=\sqrt{\frac{\color{green}(SS_{xy})\color{black}^2}{\color{blue}(SS_{xx})\color{Red}(SS_{yy})}}}




SSxx=∑(xi−xˉ)2=∑xi2−(∑xi)2n\color{blue}SS_{xx}=\sum(x_i-\bar{x})^2=\sum x^2_i-\frac{(\sum x_i)^2}{n}

SSxx=220−(30)25=40SS_{xx}=220-\frac{\left(30\right)^2}{5}=40

SSyy=∑(yi−yˉ)2=∑yi2−(∑yi)2n\color{red}SS_{yy}=\sum(y_i-\bar{y})^2=\sum y^2_i-\frac{(\sum y_i)^2}{n}


SSyy=159−(25)25=34SS_{yy}=159-\frac{\left(25\right)^2}{5}=34



SSxy=∑(xi−xˉ)(yi−yˉ)=∑xiyi−(∑xi)(∑yi)n\color{green}SS_{xy}=\sum(x_i-\bar{x})(y_i-\bar{y})=\sum x_iy_i-\frac{(\sum x_i)(\sum y_i)}{n}


SSxy=122−(30)(25)5=−28SS_{xy}=122-\frac{\left(30\right)\left(25\right)}{5}=-28



r=(SSxy)2(SSxx)(SSyy) \large r=\sqrt{\frac{\color{green}(SS_{xy})\color{black}^2}{\color{blue}(SS_{xx})\color{Red}(SS_{yy})}}


r=−(28)2(40)(34)=−0.5765=−0.7593r=-\sqrt{\frac{\left(28\right)^2}{\left(40\right)\left(34\right)}}=-\sqrt{0.5765}=-0.7593




Image illustrating Example


Pretty strong, negative correlation.





We want to predict a person’s body fat based on their age. Age and percentage body fat were measured in 18 adult males.


∑x=702∑y=461∑xy=19,871∑x2=31,396∑y2=13,449\begin{array}{ll}\sum x=702\\\sum y=461\\\sum xy=19,871\\\sum x^2=31,396\\\sum y^2=13,449\end{array}


Illustration for practice question: Correlation





(i) What is the average age in the sample?

Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Example: Solving for Correlation

Solve for the correlation coefficient.


Image illustrating Example


∑x=42\sum_{ }^{ }x=42

∑y=235\sum_{ }^{ }y=235

∑xy=1911\sum_{ }^{ }xy=1911

Sx=3.3466S_x=3.3466

Sy=18.7341S_y=18.7341



r=1n−1∑(xi−xˉSx)(yi−yˉSy)=∑XY−(∑X)(∑Y)n(n−1)SxSy=(SSxy)2(SSxx)(SSyy) \displaystyle{\large r=\frac{1}{n-1}\sum\Big(\frac{x_i-\bar{x}}{S_x}\Big)\Big(\frac{y_i-\bar{y}}{S_y}\Big)=\frac{\sum XY-\frac{(\sum X)(\sum Y)}{n}}{(n-1)S_xS_y}=\sqrt{\frac{\color{green}(SS_{xy})\color{black}^2}{\color{blue}(SS_{xx})\color{Red}(SS_{yy})}}}



There are multiple ways to solve for r. Based on the variables are given in this question, we use this formula:



r=∑XY−(∑X)(∑Y)n(n−1)SxSy\large r=\frac{\sum XY-\frac{(\sum X)(\sum Y)}{n}}{(n-1)S_xS_y}


r=1911−(42)(235)6(6−1)(3.3466)(18.7341)=266313.4815=0.8485r=\frac{1911-\frac{\left(42\right)\left(235\right)}{6}}{\left(6-1\right)\left(3.3466\right)\left(18.7341\right)}=\frac{266}{313.4815}=0.8485



Strong, positive correlation.






Illustration for practice question: Correlation


∑X=33,115\sum X=33,115

∑Y=14,263,500\sum Y=14,263,500

∑XY=15,157,905,000\sum XY=15,157,905,000


Solve for the correlation coefficient.



Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice