In: Statistics and Probability
The dataset ”chickwts” you can access in R by typing
Courtelary 80.2 17.0 15 12 9.96
Delemont 83.1 45.1 6 9 84.84
Franches-Mnt 92.5 39.7 5 5 93.40
Moutier 85.8 36.5 12 7 33.77
Neuveville 76.9 43.5 17 15 5.16
Porrentruy 76.1 35.3 9 7 90.57
Infant.Mortality
Courtelary 22.2
Delemont 22.2
Franches-Mnt 20.2
Moutier 20.3
Neuveville 20.6
Porrentruy 26.6
I.
Let X1; ...X6 be random variables for the 6 different
columns.
Let
xj =∑ xij /n
and
s^2 =∑(xij - xj )^2 /n
be estimators for the mean and variance of each of the
variables.
Let
Cov(Xj ; Xk) = E[(Xj -E(Xk))(Xk -E(Xk))]
be the Covariance between any two of the columns. Estimate all the
- pairwise - covariances. Make
some comments.
Do any of the variables appear to be independent. Why or why
not?
All R commands are shown in bold.
The data is,
> head(swiss)
Fertility Agriculture Examination Education Catholic
Infant.Mortality
Courtelary 80.2 17.0 15 12 9.96 22.2
Delemont 83.1 45.1 6 9 84.84 22.2
Franches-Mnt 92.5 39.7 5 5 93.40 20.2
Moutier 85.8 36.5 12 7 33.77 20.3
Neuveville 76.9 43.5 17 15 5.16 20.6
Porrentruy 76.1 35.3 9 7 90.57 26.6
All the - pairwise - covariances can be found as,
cov(swiss, use = "pairwise")
Fertility Agriculture Examination Education Catholic
Infant.Mortality
Fertility 156.04249769 100.169148936 -64.366928770 -79.729509713
241.56320305 15.156193340
Agriculture 100.16914894 515.799417206 -124.392830712
-139.657400555 379.90437558 -4.025851064
Examination -64.36692877 -124.392830712 63.646623497 53.575855689
-190.56061055 -2.649537465
Education -79.72950971 -139.657400555 53.575855689 92.456059204
-61.69882979 -2.781683626
Catholic 241.56320305 379.904375578 -190.560610546 -61.698829787
1739.29453719 21.318116096
Infant.Mortality 15.15619334 -4.025851064 -2.649537465 -2.781683626
21.31811610 8.483802035
If any of the variables appear to be independent, then covariance between those variables should be close to 0.
Since for none of the variables, the covariance is 0, no variable appears to be independent.
Very low covariance is found between
Infant.Mortality and Examination which is equal to -2.649537465
Infant.Mortality and Education which is equal to -2.781683626
Infant.Mortality and Agriculture which is equal to -4.025851064
We can say that Infant.Mortality is least dependent on Examination, Education and Agriculture.