Tartu et al. (2016) collected data on blood mercury concentrations in male and female Arctic black-legged kittiwakes (Rissa tridactyla) (Factor Sex, with two levels) that were collected during the incubation period and while chicks were being reared (Factor Breeding Stage, 2 levels). During incubation, they collected 48 females and 44 males, with 17 and 21, respectively, during chick rearing. The authors analyzed these data with a generalized linear model based on a normal distribution and identity link. In contrast, keeping with the theme for this chapter, we fitted a two-factor OLS linear model including the fixed main effects of site and season and their interaction. With these unequal sample sizes, we have the options of Type I, II or III SS.
Anderson, Brian, Public domain, via Wikimedia Commons
The paper is here
Tartu, S., Bustamante, P., Angelier, F., Lendvai, A. Z., Moe, B., Blevin, P., Bech, C., Gabrielsen, G. W., Bustnes, J. O. & Chastel, O. (2016). Mercury exposure, stress and prolactin secretion in an Arctic seabird: an experimental study. Functional Ecology, 30, 596-604.
First, load the required packages (car)
Import tartu_hg data file (tartu_hg.csv)
tartu_hg <- read.csv("../data/tartu_hg.csv")
head(tartu_hg,10)
boxplot(hg~sex*stage,data=tartu_hg)
No particular issues here, so happy to proceed
tartu.aov <- aov(hg~sex*stage, data=tartu_hg)
summary(tartu.aov)
Df Sum Sq Mean Sq F value Pr(>F)
sex 1 6.360 6.360 44.680 6.74e-10 ***
stage 1 6.978 6.978 49.022 1.34e-10 ***
sex:stage 1 0.394 0.394 2.766 0.0988 .
Residuals 126 17.936 0.142
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
plot(tartu.aov)
Note pattern in residuals but untransformed data will be analysed
tartu1.aov <- aov(hg~stage*sex, data=tartu_hg)
summary(tartu1.aov)
Df Sum Sq Mean Sq F value Pr(>F)
stage 1 6.076 6.076 42.685 1.44e-09 ***
sex 1 7.262 7.262 51.017 6.48e-11 ***
stage:sex 1 0.394 0.394 2.766 0.0988 .
Residuals 126 17.936 0.142
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
plot(tartu1.aov)
tartu.lm1 <- lm(hg~stage*sex, data=tartu_hg, contrasts=list(stage=contr.sum, sex=contr.sum))
Anova(tartu.lm1, type='III')
Anova Table (Type III tests)
Response: hg
Sum Sq Df F value Pr(>F)
(Intercept) 167.105 1 1173.8984 < 2.2e-16 ***
stage 6.748 1 47.4012 2.438e-10 ***
sex 4.768 1 33.4957 5.345e-08 ***
stage:sex 0.394 1 2.7661 0.09877 .
Residuals 17.936 126
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Anova(tartu.lm1, type='II')
Anova Table (Type II tests)
Response: hg
Sum Sq Df F value Pr(>F)
stage 6.9783 1 49.0222 1.341e-10 ***
sex 7.2624 1 51.0173 6.477e-11 ***
stage:sex 0.3938 1 2.7661 0.09877 .
Residuals 17.9362 126
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1