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 |
20 - 25 | 110 |
25 - 30 | 170 |
30 - 35 | 80 |
35 - 40 | 45 |
40 - 45 | 40 |
45 - 50 | 35 |
Solution:
Mean `bar x = (sum x_i)/n`
`=(22.5+27.5+32.5+37.5+42.5+47.5)/6`
`=210/6`
`=35`
Mean `bar y = (sum y_i)/n`
`=(110+170+80+45+40+35)/6`
`=480/6`
`=80`
Class-X | Mid value `x` | `y` | `X=(x-35)/1` | `Y=(y-80)/5` | `X^2` | `Y^2` | `X*Y` |
20-25 | 22.5 | 110 | -12.5 | 6 | 156.25 | 36 | -75 |
25-30 | 27.5 | 170 | -7.5 | 18 | 56.25 | 324 | -135 |
30-35 | 32.5 | 80 | -2.5 | 0 | 6.25 | 0 | 0 |
35-40 | 37.5 | 45 | 2.5 | -7 | 6.25 | 49 | -17.5 |
40-45 | 42.5 | 40 | 7.5 | -8 | 56.25 | 64 | -60 |
45-50 | 47.5 | 35 | 12.5 | -9 | 156.25 | 81 | -112.5 |
--- | --- | --- | --- | --- | --- | --- | --- |
| `210` | `480` | `sum X=0` | `sum Y=0` | `sum X^2=437.5` | `sum Y^2=554` | `sum X*Y=-400` |
Correlation Coefficient r :
`r = (sum XY)/(sqrt(sum X^2) * sqrt(sum Y^2))`
`=-400/(sqrt(437.5) * sqrt(554))`
`=-400/(20.9165 * 23.5372)`
`=-0.8125`
Correlation Coefficient r with Population Cov(x,y) :
Population `Cov(x,y) = (sum (x-bar x)(y-bar y))/(n)`
`=-400/6`
`=-66.6667`
Population Standard deviation `sigma = sqrt((sum (x - bar x)^2)/(n))`
`=sqrt(437.5/6)`
`=sqrt(72.9167)`
`=8.5391`
Population Standard deviation `sigma = sqrt((sum (y - bar y)^2)/(n))`
`=sqrt(554/6)`
`=sqrt(92.3333)`
`=9.609`
Now, `r = (cov(x,y))/(sigma_x * sigma_y)`
`= (-66.6667)/(8.5391 * 9.609)`
`=-0.8125`
Correlation Coefficient r with Sample Cov(x,y) :
Sample `Cov(x,y) = (sum (x-bar x)(y-bar y))/(n-1)`
`=-400/5`
`=-80`
Sample Standard deviation `sigma = sqrt((sum (x - bar x)^2)/(n-1))`
`=sqrt(437.5/5)`
`=sqrt(87.5)`
`=9.3541`
Sample Standard deviation `sigma = sqrt((sum (y - bar y)^2)/(n-1))`
`=sqrt(554/5)`
`=sqrt(110.8)`
`=10.5262`
Now, `r = (cov(x,y))/(sigma_x * sigma_y)`
`= (-80)/(9.3541 * 10.5262)`
`=-0.8125`
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then