Home > Statistical Methods calculators > Covariance - Population Covariance, Sample Covariance for bivariate grouped data example

2. Covariance - Population Covariance, Sample Covariance for bivariate grouped data example ( Enter your problem )
  1. Formula & Example-1
  2. Example-2
  3. Example-3
Other related methods
  1. Correlation Coefficient r
  2. Covariance - Population Covariance, Sample Covariance

1. Correlation Coefficient r
(Previous method)
2. Example-2
(Next example)

1. Formula & Example-1





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 Population cov(x,y), Sample cov(x,y) from the following data
Class-Y
Class-X
10 - 2020 - 3030 - 4040 - 5050 - 60
15 - 2563000
25 - 353161000
35 - 450101570
45 - 55007104
55 - 6500045


Solution:
C.I.`(y)`10 - 2020 - 3030 - 4040 - 5050 - 60
M.V.`(y)` 15 `15=(10+20)/2` 25 `25=(20+30)/2` 35 `35=(30+40)/2` 45 `45=(40+50)/2` 55 `55=(50+60)/2`
C.I.`(x)`M.V.`(x)`
`dy`
`dx`
 -2 `-2=(15-35)/10`
`dy=(y-35)/10`
 -1 `-1=(25-35)/10`
`dy=(y-35)/10`
 0 `0=(35-35)/10`
`dy=(y-35)/10`
 1 `1=(45-35)/10`
`dy=(y-35)/10`
 2 `2=(55-35)/10`
`dy=(y-35)/10`
`f_x``fdx``fdx^2``fdxdy`
15 - 25 20 `20=(15+25)/2` -2 `-2=(20-40)/10`
`dx=(x-40)/10`
 [24] `24=6*-2*-2`
`f*dx*dy`
6
 [6] `6=3*-2*-1`
`f*dx*dy`
3
 [0] `0=0*-2*0`
`f*dx*dy`
0
 [0] `0=0*-2*1`
`f*dx*dy`
0
 [0] `0=0*-2*2`
`f*dx*dy`
0
 9 `9=6+3+0+0+0` -18 `-18=9*-2`
`fdx=f_x*dx`
 36 `36=-18*-2`
`fdx^2=fdx*dx`
 30 `30=24+6+0+0+0`
25 - 35 30 `30=(25+35)/2` -1 `-1=(30-40)/10`
`dx=(x-40)/10`
 [6] `6=3*-1*-2`
`f*dx*dy`
3
 [16] `16=16*-1*-1`
`f*dx*dy`
16
 [0] `0=10*-1*0`
`f*dx*dy`
10
 [0] `0=0*-1*1`
`f*dx*dy`
0
 [0] `0=0*-1*2`
`f*dx*dy`
0
 29 `29=3+16+10+0+0` -29 `-29=29*-1`
`fdx=f_x*dx`
 29 `29=-29*-1`
`fdx^2=fdx*dx`
 22 `22=6+16+0+0+0`
35 - 45 40 `40=(35+45)/2` 0 `0=(40-40)/10`
`dx=(x-40)/10`
 [0] `0=0*0*-2`
`f*dx*dy`
0
 [0] `0=10*0*-1`
`f*dx*dy`
10
 [0] `0=15*0*0`
`f*dx*dy`
15
 [0] `0=7*0*1`
`f*dx*dy`
7
 [0] `0=0*0*2`
`f*dx*dy`
0
 32 `32=0+10+15+7+0` 0 `0=32*0`
`fdx=f_x*dx`
 0 `0=0*0`
`fdx^2=fdx*dx`
 0 `0=0+0+0+0+0`
45 - 55 50 `50=(45+55)/2` 1 `1=(50-40)/10`
`dx=(x-40)/10`
 [0] `0=0*1*-2`
`f*dx*dy`
0
 [0] `0=0*1*-1`
`f*dx*dy`
0
 [0] `0=7*1*0`
`f*dx*dy`
7
 [10] `10=10*1*1`
`f*dx*dy`
10
 [8] `8=4*1*2`
`f*dx*dy`
4
 21 `21=0+0+7+10+4` 21 `21=21*1`
`fdx=f_x*dx`
 21 `21=21*1`
`fdx^2=fdx*dx`
 18 `18=0+0+0+10+8`
55 - 65 60 `60=(55+65)/2` 2 `2=(60-40)/10`
`dx=(x-40)/10`
 [0] `0=0*2*-2`
`f*dx*dy`
0
 [0] `0=0*2*-1`
`f*dx*dy`
0
 [0] `0=0*2*0`
`f*dx*dy`
0
 [8] `8=4*2*1`
`f*dx*dy`
4
 [20] `20=5*2*2`
`f*dx*dy`
5
 9 `9=0+0+0+4+5` 18 `18=9*2`
`fdx=f_x*dx`
 36 `36=18*2`
`fdx^2=fdx*dx`
 28 `28=0+0+0+8+20`
`f_y` 9 `9=6+3+0+0+0` 29 `29=3+16+10+0+0` 32 `32=0+10+15+7+0` 21 `21=0+0+7+10+4` 9 `9=0+0+0+4+5` 100 `n=sum f_x=100=9+29+32+21+9`
OR
`n=sum f_y=100=9+29+32+21+9`
 -8 `sum fdx=-8=-18-29+0+21+18` 122 `sum fdx^2=122=36+29+0+21+36` 98 `sum fdxdy=98=30+22+0+18+28`
`fdy` -18 `-18=9*-2`
`fdy=f_y*dy`
 -29 `-29=29*-1`
`fdy=f_y*dy`
 0 `0=32*0`
`fdy=f_y*dy`
 21 `21=21*1`
`fdy=f_y*dy`
 18 `18=9*2`
`fdy=f_y*dy`
 -8 `sum fdy=-8=-18-29+0+21+18`
`fdy^2` 36 `36=-18*-2`
`fdy^2=fdy*dy`
 29 `29=-29*-1`
`fdy^2=fdy*dy`
 0 `0=0*0`
`fdy^2=fdy*dy`
 21 `21=21*1`
`fdy^2=fdy*dy`
 36 `36=18*2`
`fdy^2=fdy*dy`
 122 `sum fdy^2=122=-18-29+0+21+18`
`fdxdy` 30 `30=24+6+0+0+0` 22 `22=6+16+0+0+0` 0 `0=0+0+0+0+0` 18 `18=0+0+0+10+8` 28 `28=0+0+0+8+20` 98 `sum fdxdy=98=30+22+0+18+28`



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`



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`


This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then Submit Here



1. Correlation Coefficient r
(Previous method)
2. Example-2
(Next example)





Share this solution or page with your friends.


 
Copyright © 2024. All rights reserved. Terms, Privacy
 
 

.