1. Learn
  2. /
  3. Courses
  4. /
  5. Intro to Statistics with R: Analysis of Variance (ANOVA)

Exercise

Calculate and interpret the results of Tukey

As explained in the first exercise and as seen in the video, anytime you engage in NHST, a type I error can occur. In a situation were you do multiple pairwise comparisons, the probability of type I errors in the process inflates substantially. Therefore, it is better to build in adjustments to take this into account. This is what Tukey tests and other post-hoc procedures do. They adjust the p-value to prevent inflation of the type I error rate.

In R you can use Tukey's procedure via the TukeyHSD() function.

The dataset wm is still loaded in your working environment.

Instructions

100 XP
  • Use an ANOVA analysis to compare IQ gain across all groups and save the model in the variable anova_wm.
  • Print the summary statistics of the model to the console. Recall that you already have done such an analysis in chapter 1, so you should be comfortable doing this.
  • Use TukeyHSD() to conduct to evaluate all pairwise comparisons. Store the result in tukey.
  • Call plot() on the result from Tukey's procedure to plot confidence intervals for the mean differences of the different pairwise comparisons.