In: Statistics and Probability
solve using r and
Consider the data birds.txt. A wildlife ecologist measured X1 = Tail length (in millimeters)
and X2 = Wing length (in millimeters) for a sample of n = 45 female hook-billed kites.
(a) Evaluate the sample mean vector x.
(b) Evaluate the sample variance-covariance matrix, S.
(c) Determine the eigenvalue and eigenvector pairs for S.
(d) Evaluate the sample correlation matrix R. Interpret the sample correlation, r12.
the data is
Tail Wing 191 284 197 285 208 288 180 273 180 275 188 280 210 283 196 288 191 271 179 257 208 289 202 285 200 272 192 282 199 280 186 266 197 285 201 295 190 282 209 305 187 285 207 297 178 268 202 271 205 285 190 280 189 277 211 310 216 305 189 274 173 271 194 280 198 300 180 272 190 292 191 286 196 285 207 286 209 303 179 261 186 262 174 245 181 250 189 262 188 258
>
Tail<-c(191,197,208,180,180,188,210,196,191,179,208,202,200,192,199,186,197,201,190,209,187,207,178,202,205,190,189,211,216,189,173,194,198,180,190,191,196,207,209,179,186,174,181,189,188)
>
Wing<-c(284,285,288,273,275,280,283,288,271,257,289,285,272,282,280,266,285,295,282,305,285,297,268,271,285,280,277,310,305,274,271,280,300,272,292,286,285,286,303,261,262,245,250,262,258)
> A<-data.frame(Tail,Wing)
a.
> mean(Tail)
[1] 193.6222
> mean(Wing)
[1] 279.7778
b.
> var(Tail)
[1] 120.6949
> var(Wing)
[1] 208.5404
> cov(A)
Tail Wing
Tail 120.6949 122.3460
Wing 122.3460 208.5404
c.
> eigen(B)
eigen() decomposition
$values
[1] 294.60898 34.62637
$vectors
[,1] [,2]
[1,] 0.5753739 -0.8178905
[2,] 0.8178905 0.5753739
d.
> cor(A)
Tail Wing
Tail 1.0000000 0.7711697
Wing 0.7711697 1.0000000
The correlation between Tail Length and Wing Length for the female
Hook-billed Kites is 77.11697%, a Fairly Strong relation between
the two variables