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
1. 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
Class-X | Y |
2 - 4 | 3 |
4 - 6 | 4 |
6 - 8 | 2 |
8 - 10 | 1 |
Solution:
Class-X | Mid value `x` | `y` | `x^2` | `y^2` | `x*y` |
2-4 | 3 | 3 | 9 | 9 | 9 |
4-6 | 5 | 4 | 25 | 16 | 20 |
6-8 | 7 | 2 | 49 | 4 | 14 |
8-10 | 9 | 1 | 81 | 1 | 9 |
--- | --- | --- | --- | --- | --- |
| `sum x=24` | `sum y=10` | `sum x^2=164` | `sum y^2=30` | `sum xy=52` |
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))`
`=(4 * 52 - 24 * 10 )/(sqrt(4 * 164 - (24)^2) * sqrt(4 * 30 - (10)^2)`
`=(208 - 240)/(sqrt(656 - 576) * sqrt(120 - 100))`
`=-32/( sqrt(80) * sqrt(20))`
`=-32/( 8.9443 * 4.4721)`
`=-32/40`
`=-0.8`
Correlation Coefficient r with Population Cov(x,y) :
Population `Cov(x,y) = (sum xy - (sum x * sum y)/n)/(n)`
`=(52 - (24 xx 10)/4)/4`
`=(52 - (240)/4)/4`
`=(52 - 60)/4`
`=(-8)/4`
`=-2`
Population Standard deviation `sigma_x = sqrt((sum x^2 - (sum x)^2/n)/(n))`
`=sqrt((164 - (24)^2/4)/4)`
`=sqrt((164 - 144)/4)`
`=sqrt(20/4)`
`=sqrt(5)`
`=2.2361`
Population Standard deviation `sigma_y = sqrt((sum y^2 - (sum y)^2/n)/(n))`
`=sqrt((30 - (10)^2/4)/4)`
`=sqrt((30 - 25)/4)`
`=sqrt(5/4)`
`=sqrt(1.25)`
`=1.118`
Now, `r = (cov(x,y))/(sigma_x * sigma_y)`
`= (-2)/(2.2361 * 1.118)`
`=-0.8`
Correlation Coefficient r with Sample Cov(x,y) :
Sample `Cov(x,y) = (sum xy - (sum x * sum y)/n)/(n-1)`
`=(52 - (24 xx 10)/4)/3`
`=(52 - (240)/4)/3`
`=(52 - 60)/3`
`=(-8)/3`
`=-2.6667`
Sample Standard deviation `sigma_x = sqrt((sum x^2 - (sum x)^2/n)/(n-1))`
`=sqrt((164 - (24)^2/4)/3)`
`=sqrt((164 - 144)/3)`
`=sqrt(20/3)`
`=sqrt(6.6667)`
`=2.582`
Sample Standard deviation `sigma_y = sqrt((sum y^2 - (sum y)^2/n)/(n-1))`
`=sqrt((30 - (10)^2/4)/3)`
`=sqrt((30 - 25)/3)`
`=sqrt(5/3)`
`=sqrt(1.6667)`
`=1.291`
Now, `r = (cov(x,y))/(sigma_x * sigma_y)`
`= (-2.6667)/(2.582 * 1.291)`
`=-0.8`
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then