Al-Janabi et al (2016) examined the effects of ocean-acidification and warming (OAW) and nutrient levels on growth of different sibling groups of the early life stage of a seaweed, Fucus vesiculosus. There were two fixed and crossed between-plots factors: OAW (ambient pH and temperature vs future 2010 pH and temperature) and nutrient levels (ambient nutrients vs doubled nutrients). The plots were “benthocosms”, benthic mesocosm tanks in an outdoor facility in Germany; there were three mesocosms nested within each combination of OAW and nutrients. The sub-plots were 2 cm2 sandstone cubes each containing germlings from one of 16 sibling groups (populations) of F. vesiculosus previously produced by mating male and female plants collected from the wild. One cube for each sibling group was placed within each mesocosm. In contrast to Al-Janabi et al who considered sibling group a random effect, we will illustrate the analysis with sibling group as fixed. The response variable was the mean relative growth rate (% change in area) of a subset of individual germlings on each cube over 8 weeks.
Fucus vesiculosus. Alex Lomas, CC BY 2.0
The paper is here
Al-Janabi, B., Kruse, I., Graiff, A., Winde, V., Lenz, M. & Wahl, M. (2016). Buffering and amplifying interactions among OAW (Ocean Acidification & Warming) and nutrient enrichment on early life-stage Fucus vesiculosus L. (Phaeophyceae) and their carry over effects to hypoxia impact. PLoS One, 11, e0152948.
First, load the required packages (afex, car, lattice, lme4, lmerTest, nlme, VCA, ez, emmeans, Rmisc, MuMIn)
Import aljanabi data file (aljanabi.csv)
aljanabi <- read.csv("../data/aljanabi.csv")
aljanabi
NA
set contrasts from afex
set_sum_contrasts()
setting contr.sum globally: options(contrasts=c('contr.sum', 'contr.poly'))
Don’t use OLS ANOVA because of missing cell
Fit mixed effects models with lmer
aljanabi.lmer <- lmer(meanrate~oaw+nutrient+oaw*nutrient+sib+oaw*sib+nutrient*sib+oaw*nutrient*sib+(1|mesocosm), REML=TRUE, na.action=na.omit, aljanabi)
Check residuals from lmer plot
plot(aljanabi.lmer)
Looks fine
summary(aljanabi.lmer, ddf="Kenward-Roger")
Linear mixed model fit by REML. t-tests use Kenward-Roger's method ['lmerModLmerTest']
Formula: meanrate ~ oaw + nutrient + oaw * nutrient + sib + oaw * sib + nutrient * sib + oaw * nutrient * sib + (1 | mesocosm)
Data: aljanabi
REML criterion at convergence: 420.3
Scaled residuals:
Min 1Q Median 3Q Max
-1.78235 -0.53967 -0.06754 0.55534 2.27385
Random effects:
Groups Name Variance Std.Dev.
mesocosm (Intercept) 0.06653 0.2579
Residual 0.35377 0.5948
Number of obs: 191, groups: mesocosm, 12
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 2.43430 0.08603 7.99963 28.295 2.63e-09 ***
oaw1 0.48744 0.08603 7.99963 5.666 0.000473 ***
nutrient1 -0.31572 0.08603 7.99963 -3.670 0.006312 **
sib1 -0.01593 0.16629 119.00237 -0.096 0.923860
sib2 -0.17518 0.16629 119.00237 -1.053 0.294281
sib3 -0.33308 0.16629 119.00237 -2.003 0.047455 *
sib4 -0.47234 0.16629 119.00237 -2.840 0.005301 **
sib5 0.36989 0.17625 119.42278 2.099 0.037956 *
sib6 -0.57029 0.16629 119.00237 -3.429 0.000832 ***
sib7 -0.64904 0.16629 119.00237 -3.903 0.000158 ***
sib8 -0.11039 0.16629 119.00237 -0.664 0.508071
sib9 0.42231 0.16629 119.00237 2.540 0.012387 *
sib10 -0.14582 0.16629 119.00237 -0.877 0.382320
sib11 0.34078 0.16629 119.00237 2.049 0.042633 *
sib12 -0.06305 0.16629 119.00237 -0.379 0.705244
sib13 0.03526 0.16629 119.00237 0.212 0.832419
sib14 0.74411 0.16629 119.00237 4.475 1.76e-05 ***
sib15 0.18688 0.16629 119.00237 1.124 0.263356
oaw1:nutrient1 0.25402 0.08603 7.99963 2.953 0.018354 *
oaw1:sib1 0.02257 0.16629 119.00237 0.136 0.892266
oaw1:sib2 -0.06216 0.16629 119.00237 -0.374 0.709207
oaw1:sib3 0.04990 0.16629 119.00237 0.300 0.764627
oaw1:sib4 0.28582 0.16629 119.00237 1.719 0.088255 .
oaw1:sib5 -0.21133 0.17625 119.42278 -1.199 0.232893
oaw1:sib6 -0.02245 0.16629 119.00237 -0.135 0.892856
oaw1:sib7 0.31027 0.16629 119.00237 1.866 0.064531 .
oaw1:sib8 -0.06491 0.16629 119.00237 -0.390 0.696974
oaw1:sib9 0.09421 0.16629 119.00237 0.567 0.572091
oaw1:sib10 -0.10809 0.16629 119.00237 -0.650 0.516955
oaw1:sib11 -0.03109 0.16629 119.00237 -0.187 0.852021
oaw1:sib12 0.06055 0.16629 119.00237 0.364 0.716437
oaw1:sib13 -0.15265 0.16629 119.00237 -0.918 0.360483
oaw1:sib14 -0.08850 0.16629 119.00237 -0.532 0.595600
oaw1:sib15 0.11386 0.16629 119.00237 0.685 0.494859
nutrient1:sib1 0.41234 0.16629 119.00237 2.480 0.014552 *
nutrient1:sib2 0.14611 0.16629 119.00237 0.879 0.381370
nutrient1:sib3 0.09513 0.16629 119.00237 0.572 0.568369
nutrient1:sib4 0.04376 0.16629 119.00237 0.263 0.792887
nutrient1:sib5 -0.15465 0.17625 119.42278 -0.877 0.382010
nutrient1:sib6 -0.21061 0.16629 119.00237 -1.266 0.207816
nutrient1:sib7 -0.12472 0.16629 119.00237 -0.750 0.454724
nutrient1:sib8 -0.09684 0.16629 119.00237 -0.582 0.561438
nutrient1:sib9 0.26490 0.16629 119.00237 1.593 0.113816
nutrient1:sib10 -0.16471 0.16629 119.00237 -0.991 0.323936
nutrient1:sib11 0.03637 0.16629 119.00237 0.219 0.827255
nutrient1:sib12 0.18524 0.16629 119.00237 1.114 0.267562
nutrient1:sib13 -0.24403 0.16629 119.00237 -1.467 0.144884
nutrient1:sib14 -0.15702 0.16629 119.00237 -0.944 0.346953
nutrient1:sib15 -0.04661 0.16629 119.00237 -0.280 0.779723
oaw1:nutrient1:sib1 0.17350 0.16629 119.00237 1.043 0.298895
oaw1:nutrient1:sib2 -0.43361 0.16629 119.00237 -2.608 0.010287 *
oaw1:nutrient1:sib3 0.21914 0.16629 119.00237 1.318 0.190109
oaw1:nutrient1:sib4 -0.08261 0.16629 119.00237 -0.497 0.620253
oaw1:nutrient1:sib5 -0.12648 0.17625 119.42278 -0.718 0.474396
oaw1:nutrient1:sib6 -0.07806 0.16629 119.00237 -0.469 0.639622
oaw1:nutrient1:sib7 0.39245 0.16629 119.00237 2.360 0.019901 *
oaw1:nutrient1:sib8 0.09197 0.16629 119.00237 0.553 0.581257
oaw1:nutrient1:sib9 -0.14914 0.16629 119.00237 -0.897 0.371616
oaw1:nutrient1:sib10 -0.13999 0.16629 119.00237 -0.842 0.401580
oaw1:nutrient1:sib11 -0.26137 0.16629 119.00237 -1.572 0.118663
oaw1:nutrient1:sib12 0.20103 0.16629 119.00237 1.209 0.229104
oaw1:nutrient1:sib13 0.04545 0.16629 119.00237 0.273 0.785107
oaw1:nutrient1:sib14 -0.07526 0.16629 119.00237 -0.453 0.651667
oaw1:nutrient1:sib15 0.15503 0.16629 119.00237 0.932 0.353088
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation matrix not shown by default, as p = 64 > 12.
Use print(x, correlation=TRUE) or
vcov(x) if you need it
anova(aljanabi.lmer, ddf="Kenward-Roger")
Type III Analysis of Variance Table with Kenward-Roger's method
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
oaw 11.3560 11.3560 1 8.00 32.1001 0.0004728 ***
nutrient 4.7642 4.7642 1 8.00 13.4670 0.0063124 **
sib 28.1276 1.8752 15 119.03 5.3006 5.024e-08 ***
oaw:nutrient 3.0841 3.0841 1 8.00 8.7178 0.0183536 *
oaw:sib 4.0399 0.2693 15 119.03 0.7613 0.7172454
nutrient:sib 6.1474 0.4098 15 119.03 1.1585 0.3137711
oaw:nutrient:sib 7.7113 0.5141 15 119.03 1.4532 0.1342442
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Get variance components with CIs
aljanabi.ci <- confint.merMod(aljanabi.lmer,oldNames=FALSE)
Computing profile confidence intervals ...
aljanabi.vc <- (aljanabi.ci)^2
print(aljanabi.vc)
2.5 % 97.5 %
sd_(Intercept)|mesocosm 1.414172e-02 1.340031e-01
sigma 1.925128e-01 2.914894e-01
(Intercept) 5.221280e+00 6.676068e+00
oaw1 1.141991e-01 4.054257e-01
nutrient1 2.162333e-01 2.762645e-02
sib1 8.014782e-02 6.313439e-02
sib2 1.956770e-01 8.466865e-03
sib3 3.603048e-01 4.340758e-03
sib4 5.468907e-01 4.208697e-02
sib5 7.514840e-03 4.262480e-01
sib6 7.013570e-01 9.187027e-02
sib7 8.394601e-01 1.458103e-01
sib8 1.425595e-01 2.458590e-02
sib9 2.406772e-02 4.754202e-01
sib10 1.705653e-01 1.473162e-02
sib11 5.417612e-03 3.696323e-01
sib12 1.090511e-01 4.167337e-02
sib13 5.378329e-02 9.148038e-02
sib14 2.274617e-01 1.022725e+00
sib15 6.447379e-03 2.061831e-01
oaw1:nutrient1 1.092379e-02 1.626620e-01
oaw1:sib1 5.983984e-02 8.395370e-02
oaw1:sib2 1.084748e-01 4.203087e-02
oaw1:sib3 4.721429e-02 1.005404e-01
oaw1:sib4 3.470090e-04 3.058064e-01
oaw1:sib5 2.443486e-01 5.165619e-03
oaw1:sib6 8.389045e-02 5.989326e-02
oaw1:sib7 1.855729e-03 3.334458e-01
oaw1:sib8 1.102938e-01 4.091086e-02
oaw1:sib9 2.992213e-02 1.306022e-01
oaw1:sib10 1.408352e-01 2.530941e-02
oaw1:sib11 8.897105e-02 5.573817e-02
oaw1:sib12 4.270291e-02 1.074021e-01
oaw1:sib13 1.762714e-01 1.311544e-02
oaw1:sib14 1.265143e-01 3.192690e-02
oaw1:sib15 2.351014e-02 1.451910e-01
nutrient1:sib1 2.107344e-02 4.617697e-01
nutrient1:sib2 1.465707e-02 1.708194e-01
nutrient1:sib3 2.960111e-02 1.312756e-01
nutrient1:sib4 4.991489e-02 9.669181e-02
nutrient1:sib5 1.917193e-01 1.646882e-02
nutrient1:sib6 2.282767e-01 3.202021e-03
nutrient1:sib7 1.535854e-01 2.029763e-02
nutrient1:sib8 1.325079e-01 2.902017e-02
nutrient1:sib9 5.174440e-06 2.831248e-01
nutrient1:sib10 1.865302e-01 1.050176e-02
nutrient1:sib11 5.327237e-02 9.214953e-02
nutrient1:sib12 6.714394e-03 2.046912e-01
nutrient1:sib13 2.613337e-01 5.364507e-04
nutrient1:sib14 1.799454e-01 1.213737e-02
nutrient1:sib15 9.846505e-02 4.865469e-02
oaw1:nutrient1:sib1 8.777533e-03 1.941997e-01
oaw1:nutrient1:sib2 4.911279e-01 2.770083e-02
oaw1:nutrient1:sib3 2.309298e-03 2.365016e-01
oaw1:nutrient1:sib4 1.223636e-01 3.406399e-02
oaw1:nutrient1:sib5 1.676627e-01 2.456186e-02
oaw1:nutrient1:sib6 1.192011e-01 3.576423e-02
oaw1:nutrient1:sib7 1.569045e-02 4.351130e-01
oaw1:nutrient1:sib8 3.070269e-02 1.289870e-01
oaw1:nutrient1:sib9 1.733308e-01 1.393328e-02
oaw1:nutrient1:sib10 1.657957e-01 1.617712e-02
oaw1:nutrient1:sib11 2.793794e-01 3.370952e-05
oaw1:nutrient1:sib12 4.377607e-03 2.192168e-01
oaw1:nutrient1:sib13 4.917165e-02 9.773293e-02
oaw1:nutrient1:sib14 1.172755e-01 3.683111e-02
oaw1:nutrient1:sib15 1.258065e-02 1.782579e-01