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.

Alex Lomas, [CC BY 2.0](https://creativecommons.org/licenses/by/2.0) , via Wikimedia Commons

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.

Preliminaries

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'))

Model fitting

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

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-1.7823 -0.5397 -0.0675  0.5553  2.2738 

Random effects:
 Groups   Name        Variance Std.Dev.
 mesocosm (Intercept) 0.0665   0.258   
 Residual             0.3538   0.595   
Number of obs: 191, groups:  mesocosm, 12

Fixed effects:
                     Estimate Std. Error       df t value Pr(>|t|)    
(Intercept)            2.4343     0.0860   7.9996   28.29  2.6e-09 ***
oaw1                   0.4874     0.0860   7.9996    5.67  0.00047 ***
nutrient1             -0.3157     0.0860   7.9996   -3.67  0.00631 ** 
sib1                  -0.0159     0.1663 119.0024   -0.10  0.92386    
sib2                  -0.1752     0.1663 119.0024   -1.05  0.29428    
sib3                  -0.3331     0.1663 119.0024   -2.00  0.04746 *  
sib4                  -0.4723     0.1663 119.0024   -2.84  0.00530 ** 
sib5                   0.3699     0.1763 119.4228    2.10  0.03796 *  
sib6                  -0.5703     0.1663 119.0024   -3.43  0.00083 ***
sib7                  -0.6490     0.1663 119.0024   -3.90  0.00016 ***
sib8                  -0.1104     0.1663 119.0024   -0.66  0.50807    
sib9                   0.4223     0.1663 119.0024    2.54  0.01239 *  
sib10                 -0.1458     0.1663 119.0024   -0.88  0.38232    
sib11                  0.3408     0.1663 119.0024    2.05  0.04263 *  
sib12                 -0.0631     0.1663 119.0024   -0.38  0.70524    
sib13                  0.0353     0.1663 119.0024    0.21  0.83242    
sib14                  0.7441     0.1663 119.0024    4.47  1.8e-05 ***
sib15                  0.1869     0.1663 119.0024    1.12  0.26336    
oaw1:nutrient1         0.2540     0.0860   7.9996    2.95  0.01835 *  
oaw1:sib1              0.0226     0.1663 119.0024    0.14  0.89227    
oaw1:sib2             -0.0622     0.1663 119.0024   -0.37  0.70921    
oaw1:sib3              0.0499     0.1663 119.0024    0.30  0.76463    
oaw1:sib4              0.2858     0.1663 119.0024    1.72  0.08826 .  
oaw1:sib5             -0.2113     0.1763 119.4228   -1.20  0.23289    
oaw1:sib6             -0.0224     0.1663 119.0024   -0.13  0.89286    
oaw1:sib7              0.3103     0.1663 119.0024    1.87  0.06453 .  
oaw1:sib8             -0.0649     0.1663 119.0024   -0.39  0.69697    
oaw1:sib9              0.0942     0.1663 119.0024    0.57  0.57209    
oaw1:sib10            -0.1081     0.1663 119.0024   -0.65  0.51695    
oaw1:sib11            -0.0311     0.1663 119.0024   -0.19  0.85202    
oaw1:sib12             0.0605     0.1663 119.0024    0.36  0.71644    
oaw1:sib13            -0.1527     0.1663 119.0024   -0.92  0.36048    
oaw1:sib14            -0.0885     0.1663 119.0024   -0.53  0.59560    
oaw1:sib15             0.1139     0.1663 119.0024    0.68  0.49486    
nutrient1:sib1         0.4123     0.1663 119.0024    2.48  0.01455 *  
nutrient1:sib2         0.1461     0.1663 119.0024    0.88  0.38137    
nutrient1:sib3         0.0951     0.1663 119.0024    0.57  0.56837    
nutrient1:sib4         0.0438     0.1663 119.0024    0.26  0.79289    
nutrient1:sib5        -0.1547     0.1763 119.4228   -0.88  0.38201    
nutrient1:sib6        -0.2106     0.1663 119.0024   -1.27  0.20782    
nutrient1:sib7        -0.1247     0.1663 119.0024   -0.75  0.45472    
nutrient1:sib8        -0.0968     0.1663 119.0024   -0.58  0.56144    
nutrient1:sib9         0.2649     0.1663 119.0024    1.59  0.11382    
nutrient1:sib10       -0.1647     0.1663 119.0024   -0.99  0.32394    
nutrient1:sib11        0.0364     0.1663 119.0024    0.22  0.82725    
nutrient1:sib12        0.1852     0.1663 119.0024    1.11  0.26756    
nutrient1:sib13       -0.2440     0.1663 119.0024   -1.47  0.14488    
nutrient1:sib14       -0.1570     0.1663 119.0024   -0.94  0.34695    
nutrient1:sib15       -0.0466     0.1663 119.0024   -0.28  0.77972    
oaw1:nutrient1:sib1    0.1735     0.1663 119.0024    1.04  0.29890    
oaw1:nutrient1:sib2   -0.4336     0.1663 119.0024   -2.61  0.01029 *  
oaw1:nutrient1:sib3    0.2191     0.1663 119.0024    1.32  0.19011    
oaw1:nutrient1:sib4   -0.0826     0.1663 119.0024   -0.50  0.62025    
oaw1:nutrient1:sib5   -0.1265     0.1763 119.4228   -0.72  0.47440    
oaw1:nutrient1:sib6   -0.0781     0.1663 119.0024   -0.47  0.63962    
oaw1:nutrient1:sib7    0.3925     0.1663 119.0024    2.36  0.01990 *  
oaw1:nutrient1:sib8    0.0920     0.1663 119.0024    0.55  0.58126    
oaw1:nutrient1:sib9   -0.1491     0.1663 119.0024   -0.90  0.37162    
oaw1:nutrient1:sib10  -0.1400     0.1663 119.0024   -0.84  0.40158    
oaw1:nutrient1:sib11  -0.2614     0.1663 119.0024   -1.57  0.11866    
oaw1:nutrient1:sib12   0.2010     0.1663 119.0024    1.21  0.22910    
oaw1:nutrient1:sib13   0.0454     0.1663 119.0024    0.27  0.78511    
oaw1:nutrient1:sib14  -0.0753     0.1663 119.0024   -0.45  0.65167    
oaw1:nutrient1:sib15   0.1550     0.1663 119.0024    0.93  0.35309    
---
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.25   11.25     1     8   31.81 0.00048 ***
nutrient           4.81    4.81     1     8   13.59 0.00615 ** 
sib               28.13    1.88    15   119    5.30   5e-08 ***
oaw:nutrient       3.10    3.10     1     8    8.77 0.01810 *  
oaw:sib            4.04    0.27    15   119    0.76 0.71725    
nutrient:sib       6.15    0.41    15   119    1.16 0.31377    
oaw:nutrient:sib   7.71    0.51    15   119    1.45 0.13424    
---
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.41e-02 1.34e-01
sigma                   1.93e-01 2.91e-01
(Intercept)             5.22e+00 6.68e+00
oaw1                    1.14e-01 4.05e-01
nutrient1               2.16e-01 2.76e-02
sib1                    8.01e-02 6.31e-02
sib2                    1.96e-01 8.47e-03
sib3                    3.60e-01 4.34e-03
sib4                    5.47e-01 4.21e-02
sib5                    7.51e-03 4.26e-01
sib6                    7.01e-01 9.19e-02
sib7                    8.39e-01 1.46e-01
sib8                    1.43e-01 2.46e-02
sib9                    2.41e-02 4.75e-01
sib10                   1.71e-01 1.47e-02
sib11                   5.42e-03 3.70e-01
sib12                   1.09e-01 4.17e-02
sib13                   5.38e-02 9.15e-02
sib14                   2.27e-01 1.02e+00
sib15                   6.45e-03 2.06e-01
oaw1:nutrient1          1.09e-02 1.63e-01
oaw1:sib1               5.98e-02 8.40e-02
oaw1:sib2               1.08e-01 4.20e-02
oaw1:sib3               4.72e-02 1.01e-01
oaw1:sib4               3.47e-04 3.06e-01
oaw1:sib5               2.44e-01 5.17e-03
oaw1:sib6               8.39e-02 5.99e-02
oaw1:sib7               1.86e-03 3.33e-01
oaw1:sib8               1.10e-01 4.09e-02
oaw1:sib9               2.99e-02 1.31e-01
oaw1:sib10              1.41e-01 2.53e-02
oaw1:sib11              8.90e-02 5.57e-02
oaw1:sib12              4.27e-02 1.07e-01
oaw1:sib13              1.76e-01 1.31e-02
oaw1:sib14              1.27e-01 3.19e-02
oaw1:sib15              2.35e-02 1.45e-01
nutrient1:sib1          2.11e-02 4.62e-01
nutrient1:sib2          1.47e-02 1.71e-01
nutrient1:sib3          2.96e-02 1.31e-01
nutrient1:sib4          4.99e-02 9.67e-02
nutrient1:sib5          1.92e-01 1.65e-02
nutrient1:sib6          2.28e-01 3.20e-03
nutrient1:sib7          1.54e-01 2.03e-02
nutrient1:sib8          1.33e-01 2.90e-02
nutrient1:sib9          5.17e-06 2.83e-01
nutrient1:sib10         1.87e-01 1.05e-02
nutrient1:sib11         5.33e-02 9.21e-02
nutrient1:sib12         6.71e-03 2.05e-01
nutrient1:sib13         2.61e-01 5.36e-04
nutrient1:sib14         1.80e-01 1.21e-02
nutrient1:sib15         9.85e-02 4.87e-02
oaw1:nutrient1:sib1     8.78e-03 1.94e-01
oaw1:nutrient1:sib2     4.91e-01 2.77e-02
oaw1:nutrient1:sib3     2.31e-03 2.37e-01
oaw1:nutrient1:sib4     1.22e-01 3.41e-02
oaw1:nutrient1:sib5     1.68e-01 2.46e-02
oaw1:nutrient1:sib6     1.19e-01 3.58e-02
oaw1:nutrient1:sib7     1.57e-02 4.35e-01
oaw1:nutrient1:sib8     3.07e-02 1.29e-01
oaw1:nutrient1:sib9     1.73e-01 1.39e-02
oaw1:nutrient1:sib10    1.66e-01 1.62e-02
oaw1:nutrient1:sib11    2.79e-01 3.37e-05
oaw1:nutrient1:sib12    4.38e-03 2.19e-01
oaw1:nutrient1:sib13    4.92e-02 9.77e-02
oaw1:nutrient1:sib14    1.17e-01 3.68e-02
oaw1:nutrient1:sib15    1.26e-02 1.78e-01
LS0tCnRpdGxlOiAiUUsgQm94IDExLjQiCm91dHB1dDoKICBodG1sX2RvY3VtZW50OgogICAgZGZfcHJpbnQ6IHBhZ2VkCiAgaHRtbF9ub3RlYm9vazoKICAgIHRoZW1lOiBmbGF0bHkKLS0tCgpgYGB7ciBzZXR1cCwgaW5jbHVkZT1GQUxTRX0Ka25pdHI6Om9wdHNfY2h1bmskc2V0KGVjaG8gPSBUUlVFKQpgYGAKCkFsLUphbmFiaSBldCBhbCAoMjAxNikgZXhhbWluZWQgdGhlIGVmZmVjdHMgb2Ygb2NlYW4tYWNpZGlmaWNhdGlvbiBhbmQgd2FybWluZyAoT0FXKSBhbmQgbnV0cmllbnQgbGV2ZWxzIG9u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