In this video we conclude our illustration of one-way ANOVA models
in R
through Example 11 in Mod13Script.R. You should open this script in
RStudio and follow along while watching. In this portion of the example
we show how to draw inferences on treatment means and marginal means. "Marginal means" are just the treatment means in a one-way model, but in a higher-way model, they would be means at the levels of a particular factor, averaged over the levels of the other factors in the model. Inference in marginal means in R is available through functions in the emmeans package as well as through other tools such as the linearHypothesis() function of the car package and the TukeyHSD() function. We illustrate these functions to estimate population treatment means, form confidence intervals for those means, estimate and test contrasts on the population treatment means, and conduct multiple inferences with controlled Type I error rates (by using multiple comparisons procedures such as Tukey's HSD method for all pairwise contrasts and Dunnett's method for all pairwise contrasts with a control treatment). In this video we also illustrate how to produce ANOVA model diagnostics in R including residual plots, tests of equal variance, and tests of normality.
This video is essential content for the course.
A second example involving a one-way ANOVA model, this time involving a quantitative explanatory factor, is included in Mod13Script.R, but is not covered in any course videos. That example, Example 12, illustrates how to test orthogonal polynomial contrasts to determine whether the treatment means display a linear trend with increasing levels of the explanatory factor. Students are encouraged to read through Example 12 on their own.