Before carrying out our data analysis, first load the data, look
at it and get an idea of its
structure using the command
Make sure that you understand how to interpret this output.
Does the assumption of homoscedasticity appear to hold for these data? Do there appear to be differences in mean weight gain for these two factors? Explain.
Now fit an anova model to the data. Here, we will fit the full model, including interactions, and produce the anova table. Before proceeding, write out the mathematical model that you are fitting.
and extract the estimated model coefficient via:
By default, the model identifiability constraint is
treatment constrasts, which you can see in
Treatment contrasts fit with a model where the coefficient for the first level of a model is set to 0. Thus, the interpretation of a given coefficient is that it estimates the
difference between the effect of the first level and
the level corresponding to the coefficient. (It is possible
to change this if it makes more practical sense to use a different constraint for your problem \- see the help for
To get the levels for each factor (and their order) apply the command
What are the interpretations of the model coefficients? [Hint: Your interpretation should correspond to the design plot you made.
The interaction term is marginally significant. You can examine the interaction graphically by making an interaction plot:
Again, make sure that you understand how to interpret this plot. Does the plot support the anova results you obtained?
Now make some diagnostic plots to assess the validity of the model assumptions:
Summarize your findings for your analyses of the
Here, you will repeat the analyses you did above for the
Unlike the
Carry out the same exploration on this dataset that you did above.
We will again fit the full model, but because the data are unbalanced we want to see how much the order of the variables affects inference. So you should examine the anova tables for the following 2 models:
Also, verify that you get the same results for the
Are there large differences between the anova results for the 2 models? Are there any significant effects? Which ones?
Using model 1 as the basis of post hoc multiple comparisons, compute the Tukey honest significant differences:
Make sure that you understand the output (remember our friend
Which differences are significant?
Summarize your findings for your analyses of the