STAT 3022 HW 10 - 5.23 > data(ex0523 > View(ex0523 >...

This preview shows page 1 - 5 out of 7 pages.

5.23 > data(ex0523) > View(ex0523) > attach(ex0523) > head(ex0523) Oxygen Bone 1 11.10 Bone1 2 11.22 Bone1 3 11.29 Bone1 4 11.49 Bone1 5 11.32 Bone2 6 11.40 Bone2 > boxplot(Oxygen~Bone, ylab="Oxygen Isotopic Composition", xlab="Bone", col="gray", pch=16,main="Measurements of oxygen isotopic composition of vertebrate bone phosphate")
> n <- tapply(Oxygen,Bone,length) > Average <- tapply(Oxygen,Bone,mean) > SD <- tapply(Oxygen,Bone,sd) > print(cbind(n,Average,SD),digits=3) n Average SD Bone1 4 11.3 0.163 Bone10 6 11.1 0.166 Bone11 5 11.6 0.220 Bone12 5 12.2 0.191 Bone2 3 11.5 0.206 Bone3 3 11.8 0.226 Bone4 5 11.1 0.319 Bone5 5 11.3 0.318 Bone6 4 11.9 0.195 Bone7 5 11.8 0.439 Bone8 4 11.8 0.364 Bone9 3 11.8 0.257 > m<- aov(Oxygen~Bone) > summary(m) Df Sum Sq Mean Sq F value Pr(>F) Bone 11 6.067 0.5516 7.427 9.73e-07 *** Residuals 40 2.971 0.0743 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 > par(mfrow=c(2,2))
> plot(m) From the p-value of 9.73e-07, we can conclude that the means are different for the different bones. 13.20 > data(ex1320) > View(ex1320) > attach(ex1320) > View(ex1320) > m<-lm(Score~Sex+Background) > summary(m)
Call: lm(formula = Score ~ Sex + Background) Residuals: Min 1Q Median 3Q Max -13.9641 -3.3629 0.0359 3.4354 14.0366 Coefficients: Estimate Std. Error t value Pr(>|t|)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture