Formula
1. `r = (n * sum fdxdy - sum fdx * sum fdy)/(sqrt(n * sum f dx^2 - (sum f dx)^2) * sqrt(n * sum f dy^2 - (sum f dy)^2))`
|
2. Population `Cov(x,y) = (sum fdxdy - (sum fdx * sum fdy)/n)/(n)`
|
3. Sample `Cov(x,y) = (sum fdxdy - (sum fdx * sum fdy)/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-Y Class-X | 10 - 20 | 20 - 30 | 30 - 40 | 40 - 50 | 50 - 60 |
15 - 25 | 6 | 3 | 0 | 0 | 0 |
25 - 35 | 3 | 16 | 10 | 0 | 0 |
35 - 45 | 0 | 10 | 15 | 7 | 0 |
45 - 55 | 0 | 0 | 7 | 10 | 4 |
55 - 65 | 0 | 0 | 0 | 4 | 5 |
Solution:
| | C.I.`(y)` | 10 - 20 | 20 - 30 | 30 - 40 | 40 - 50 | 50 - 60 | | | | |
| | M.V.`(y)` | 15 | 25 | 35 | 45 | 55 | | | | |
C.I.`(x)` | M.V.`(x)` | `dy` `dx` | -2 | -1 | 0 | 1 | 2 | `f_x` | `fdx` | `fdx^2` | `fdxdy` |
15 - 25 | 20 | -2 | [24]6 | [6]3 | [0]0 | [0]0 | [0]0 | 9 | -18 | 36 | 30 |
25 - 35 | 30 | -1 | [6]3 | [16]16 | [0]10 | [0]0 | [0]0 | 29 | -29 | 29 | 22 |
35 - 45 | 40 | 0 | [0]0 | [0]10 | [0]15 | [0]7 | [0]0 | 32 | 0 | 0 | 0 |
45 - 55 | 50 | 1 | [0]0 | [0]0 | [0]7 | [10]10 | [8]4 | 21 | 21 | 21 | 18 |
55 - 65 | 60 | 2 | [0]0 | [0]0 | [0]0 | [8]4 | [20]5 | 9 | 18 | 36 | 28 |
| | `f_y` | 9 | 29 | 32 | 21 | 9 | 100 | -8 | 122 | 98 |
| | `fdy` | -18 | -29 | 0 | 21 | 18 | -8 | | | |
| | `fdy^2` | 36 | 29 | 0 | 21 | 36 | 122 | | | |
| | `fdxdy` | 30 | 22 | 0 | 18 | 28 | 98 | | | |
Correlation Coefficient r :
`r = (n * sum fdxdy - sum fdx * sum fdy)/(sqrt(n * sum f dx^2 - (sum f dx)^2) * sqrt(n * sum f dy^2 - (sum f dy)^2))`
`=(100 * 98 - -8 * -8 )/(sqrt(100 * 122 - (-8)^2) * sqrt(100 * 122 - (-8)^2)`
`=(9800 - 64)/(sqrt(12200 - 64) * sqrt(12200 - 64))`
`=9736/( sqrt(12136) * sqrt(12136))`
`=9736/( 110.1635 * 110.1635)`
`=9736/12136`
`=0.8022`
Correlation Coefficient r with Population Cov(x,y) :
Population `Cov(x,y) = (sum fdxdy - (sum fdx * sum fdy)/n)/(n)`
`=(98 - (-8 xx -8)/100)/100`
`=(98 - (64)/100)/100`
`=(98 - 0.64)/100`
`=(97.36)/100`
`=0.9736`
Population Standard deviation `sigma_x = sqrt((sum fdx^2 - (sum fdx)^2/n)/(n))`
`=sqrt((122 - (-8)^2/100)/100)`
`=sqrt((122 - 0.64)/100)`
`=sqrt(121.36/100)`
`=sqrt(1.2136)`
`=1.1016`
Population Standard deviation `sigma_y = sqrt((sum fdy^2 - (sum fdy)^2/n)/(n))`
`=sqrt((122 - (-8)^2/100)/100)`
`=sqrt((122 - 0.64)/100)`
`=sqrt(121.36/100)`
`=sqrt(1.2136)`
`=1.1016`
Now, `r = (cov(x,y))/(sigma_x * sigma_y)`
`= (0.9736)/(1.1016 * 1.1016)`
`=0.8022`
Correlation Coefficient r with Sample Cov(x,y) :
Sample `Cov(x,y) = (sum fdxdy - (sum fdx * sum fdy)/n)/(n-1)`
`=(98 - (-8 xx -8)/100)/99`
`=(98 - (64)/100)/99`
`=(98 - 0.64)/99`
`=(97.36)/99`
`=0.9834`
Sample Standard deviation `sigma_x = sqrt((sum fdx^2 - (sum fdx)^2/n)/(n-1))`
`=sqrt((122 - (-8)^2/100)/99)`
`=sqrt((122 - 0.64)/99)`
`=sqrt(121.36/99)`
`=sqrt(1.2259)`
`=1.1072`
Sample Standard deviation `sigma_y = sqrt((sum fdy^2 - (sum fdy)^2/n)/(n-1))`
`=sqrt((122 - (-8)^2/100)/99)`
`=sqrt((122 - 0.64)/99)`
`=sqrt(121.36/99)`
`=sqrt(1.2259)`
`=1.1072`
Now, `r = (cov(x,y))/(sigma_x * sigma_y)`
`= (0.9834)/(1.1072 * 1.1072)`
`=0.8022`
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then