Formula
1. `r = (n * sum xy - sum x * sum y)/(sqrt(n * sum x^2 - (sum x)^2) * sqrt(n * sum y^2 - (sum y)^2))`
|
2. `r = (sum XY)/(sqrt(sum X^2) * sqrt(sum Y^2))`
|
3. `r = (n * sum dxdy - sum dx * sum dy)/( sqrt(n * sum dx^2 - (sum dx)^2) * sqrt(n * sum dy^2 - (sum dy)^2))`
|
4. Population `Cov(x,y)`
1. Population `Cov(x,y) = (sum (x-bar x)(y-bar y))/(n)`
2. Population `Cov(x,y) = (sum dxdy - (sum dx * sum dy)/n)/(n)`
3. Population `Cov(x,y) = (sum xy - (sum x * sum y)/n)/(n)`
|
5. Sample `Cov(x,y)`
1. Sample `Cov(x,y) = (sum (x-bar x)(y-bar y))/(n-1)`
2. Sample `Cov(x,y) = (sum dxdy - (sum dx * sum dy)/n)/(n-1)`
3. Sample `Cov(x,y) = (sum xy - (sum x * sum y)/n)/(n-1)`
|
Examples
2. Calculate Correlation Coefficient r without cov(x,y), Correlation Coefficient r with population cov(x,y), Correlation Coefficient r with sample cov(x,y) from the following data
Solution:
`x` | `y` | `x^2` | `y^2` | `x*y` |
3 | 9 | 9 | 81 | 27 |
4 | 11 | 16 | 121 | 44 |
6 | 14 | 36 | 196 | 84 |
7 | 15 | 49 | 225 | 105 |
10 | 16 | 100 | 256 | 160 |
--- | --- | --- | --- | --- |
`sum x=30` | `sum y=65` | `sum x^2=210` | `sum y^2=879` | `sum xy=420` |
Correlation Coefficient r :
`r = (n * sum xy - sum x * sum y)/(sqrt(n * sum x^2 - (sum x)^2) * sqrt(n * sum y^2 - (sum y)^2))`
`=(5 * 420 - 30 * 65 )/(sqrt(5 * 210 - (30)^2) * sqrt(5 * 879 - (65)^2)`
`=(2100 - 1950)/(sqrt(1050 - 900) * sqrt(4395 - 4225))`
`=150/( sqrt(150) * sqrt(170))`
`=150/( 12.2474 * 13.0384)`
`=150/159.6872`
`=0.9393`
Correlation Coefficient r with Population Cov(x,y) :
Population `Cov(x,y) = (sum xy - (sum x * sum y)/n)/(n)`
`=(420 - (30 xx 65)/5)/5`
`=(420 - (1950)/5)/5`
`=(420 - 390)/5`
`=(30)/5`
`=6`
Population Standard deviation `sigma_x = sqrt((sum x^2 - (sum x)^2/n)/(n))`
`=sqrt((210 - (30)^2/5)/5)`
`=sqrt((210 - 180)/5)`
`=sqrt(30/5)`
`=sqrt(6)`
`=2.4495`
Population Standard deviation `sigma_y = sqrt((sum y^2 - (sum y)^2/n)/(n))`
`=sqrt((879 - (65)^2/5)/5)`
`=sqrt((879 - 845)/5)`
`=sqrt(34/5)`
`=sqrt(6.8)`
`=2.6077`
Now, `r = (cov(x,y))/(sigma_x * sigma_y)`
`= (6)/(2.4495 * 2.6077)`
`=0.9393`
Correlation Coefficient r with Sample Cov(x,y) :
Sample `Cov(x,y) = (sum xy - (sum x * sum y)/n)/(n-1)`
`=(420 - (30 xx 65)/5)/4`
`=(420 - (1950)/5)/4`
`=(420 - 390)/4`
`=(30)/4`
`=7.5`
Sample Standard deviation `sigma_x = sqrt((sum x^2 - (sum x)^2/n)/(n-1))`
`=sqrt((210 - (30)^2/5)/4)`
`=sqrt((210 - 180)/4)`
`=sqrt(30/4)`
`=sqrt(7.5)`
`=2.7386`
Sample Standard deviation `sigma_y = sqrt((sum y^2 - (sum y)^2/n)/(n-1))`
`=sqrt((879 - (65)^2/5)/4)`
`=sqrt((879 - 845)/4)`
`=sqrt(34/4)`
`=sqrt(8.5)`
`=2.9155`
Now, `r = (cov(x,y))/(sigma_x * sigma_y)`
`= (7.5)/(2.7386 * 2.9155)`
`=0.9393`
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then