1 Initialize R

Set R to use the sum-to-zero definition of effects and load the runData data frame with the following commands:

options(contrasts=c("contr.sum","contr.poly"))
load(url("http://pnb.mcmaster.ca/bennett/psy710/datasets/runData-2023.rda") )

The data frame rundata contains data from a 3x3 between-subjects, factorial experiment that measured the time (in seconds) to complete a 1.5-mile course. All runners were men who were divided into 3 age groups and three fitness categories. The independent variables were age and fitness and the dependent variable was runtime. The data frame also contains a variable, id, which is an id number assigned to each subject.

2 Analysis of runData data

  1. Use ANOVA to evaluate the effects of age and fitness on runtime. What are the null hypotheses for the main effects and interaction?
  1. Use box plots to illustrate the main effect of age and the main effect of fitness.

  2. Evaluate the ANOVA’s constant-variance and normality assumptions.

  1. Evaluate the simple main effect of fitness at each level of age.

  2. Analyze the main effect of age by performing a linear contrast that evaluates the difference between mean runtime in the b50 and c60 age groups, and determine if the value of this linear contrast depends on the level of fitness.

  1. Suppose you are interested in knowing if the difference between means in the b50 and c60 age groups in the low fitness conditions differs from the difference between means in the b50 and c60 age groups averaged across the medium and high fitness conditions. Design a set of contrast weights that you could use to evaluate this hypothesis and then perform the contrast.
  1. Would you expect the Type II and III Sums of Squares to be the same for the main effects of age and fitness? Why or why not? Verify your answer by calculating the Type II and III sums of squares.