Chapter 4 -- Linear models -- anything goes -- Exercise solutions and Code Boxes4 years ago
Exercise 4.1: Ravens and gunshots | Code Box 4.1: Paired t-test for the ravens data | Exercise 4.2: Ravens, guns and air horns | Code Box 4.2: Paired t-test for the ravens data via a linear model | Code Box 4.3: A linear model for the blocked design given by the raven counts in Exercise 4.2 | Exercise 4.3: Seaweed, snails and seaweed mass | Code Box 4.4: Scatterplot of data from Exercise 4.3. | Code Box 4.5: Analysis of covariance for the seaweed data of Exercise 4.3. | Exercise 4.4: Checking ANCOVA assumptions | Code Box 4.6: ANCOVA with the order of terms switched. | Exercise 4.5: Order of terms in writing out a model for snails and seaweed. | Code Box 4.7: "Type II sums of squares" for the ANCOVA of snails and seaweed. | Exercise 4.6: Snails, isolation and time | Code Box 4.8: A comparative boxplot of snail density at each of the six possible combinations of sampling time and distance of isolation. | Exercise 4.7: Factorial ANOVA assumptions | Code Box 4.9: Factorial ANOVA of Snails, Isolation, and Time | Code Box 4.10: R code for the interaction plot in Figure 4.1. | Code Box 4.11: Uh oh... anova gone wrong | Code Box 4.12: Tukey's comparisons don't work for main e�ects in an orthogonal design, as seen for Exercise 4.9: | Code Box 4.13: Tukey's comparisons for a main e�ect of Dist for Exercise 4.6, assuming no interaction. | Code Box 4.14: Tukey's comparisons for all possible treatment combinations for Exercise 4.6. | Code Box 4.15: Tukey's comparisons for Dist within each sampling time, for Exercise 4.6. | Code Box 4.16: Testing for an interaction in an ANCOVA for density of epifauna as a function of Dist and algal wet mass. | Exercise 4.8: Global plant height | Code Box 4.17: Using R to fit a quadratic model to the plant height data of Exercise 3.1. | Exercise 4.9: Snowmelt and time to flowering | Exercise 4.10: Bird exclusion and biological control | Exercise 4.11: Seaweed, snails and three factors
ecostats 1.1.11David WartonChapter4Solutions.Rmd