Hw-6.pdf - hw6 Mingyu Sun 4/22/2020 problem 1 part a) make...

This preview shows page 1 - 4 out of 16 pages.

The preview shows page 2 - 4 out of 16 pages.
hw6Mingyu Sun4/22/2020problem 1part a) make plots of the datalibrary(faraway)data(butterfat)attach(butterfat)par(mfrow=c(2,2))boxplot(Butterfat~Breed,data=butterfat,outline=FALSE)stripchart(Butterfat~Breed,data=butterfat,method="jitter",col="blue",vertical=TRUE,add=TRUE)boxplot(Butterfat~Age,data=butterfat,outline=FALSE)stripchart(Butterfat~Age,data=butterfat,method="jitter",col="blue",vertical=TRUE,add=TRUE)interaction.plot(butterfat$Breed,butterfat$Age,butterfat$Butterfat)interaction.plot(butterfat$Age,butterfat$Breed,butterfat$Butterfat)1
AyrshireGuernseyJersey3.55.06.5BreedButterfat2yearMature3.55.06.5AgeButterfat4.05.0butterfat$Breedmean ofbutterfat$ButterfatAyrshireGuernseyJerseybutterfat$AgMatur2year4.05.0butterfat$Agemean ofbutterfat$Butterfat2yearMaturebutterfat$BreedJerseyGuernseCanadianAyrshireHolstein-part b)model=lm(Butterfat~Breed*Age,data=butterfat)anova(model)## Analysis of Variance Table#### Response: Butterfat##Df Sum Sq Mean Sq F value Pr(>F)## Breed4 34.3218.5803 49.5651 <2e-16 ***## Age10.2740.27351.5801 0.2120## Breed:Age40.5140.12850.7421 0.5658## Residuals 90 15.5800.1731## ---## Signif. codes:0***0.001**0.01*0.05.0.112
P value of the anova test for the interaction term is 0.5658. Therefore, Do Notreject H0.Interaction term is not significant.This can also be seen from theinteraction plots. Since the lines are almost parallel to each other, the interaction

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 16 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
Ma,P

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture