R Markdown

library(knitr)
library(rmarkdown)
library(lattice)
library(permute)
library(ggplot2)
library(lme4)
## Loading required package: Matrix
library(MuMIn)
library(vegan)
## This is vegan 2.6-4
library(emmeans)
library(lmerTest)
## 
## Attaching package: 'lmerTest'
## The following object is masked from 'package:lme4':
## 
##     lmer
## The following object is masked from 'package:stats':
## 
##     step
library(tibble)
library(plyr)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:plyr':
## 
##     arrange, count, desc, failwith, id, mutate, rename, summarise,
##     summarize
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(readr)
library(janitor)
## 
## Attaching package: 'janitor'
## The following objects are masked from 'package:stats':
## 
##     chisq.test, fisher.test
library(pbkrtest) 
library(tidyr)
## 
## Attaching package: 'tidyr'
## The following objects are masked from 'package:Matrix':
## 
##     expand, pack, unpack
library(ggpubr)
## 
## Attaching package: 'ggpubr'
## The following object is masked from 'package:plyr':
## 
##     mutate
library(ggthemes)
library(stringr)  
library(ggfortify)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats   1.0.0     ✔ purrr     1.0.1
## ✔ lubridate 1.9.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::arrange()   masks plyr::arrange()
## ✖ purrr::compact()   masks plyr::compact()
## ✖ dplyr::count()     masks plyr::count()
## ✖ dplyr::desc()      masks plyr::desc()
## ✖ tidyr::expand()    masks Matrix::expand()
## ✖ dplyr::failwith()  masks plyr::failwith()
## ✖ dplyr::filter()    masks stats::filter()
## ✖ dplyr::id()        masks plyr::id()
## ✖ dplyr::lag()       masks stats::lag()
## ✖ ggpubr::mutate()   masks dplyr::mutate(), plyr::mutate()
## ✖ tidyr::pack()      masks Matrix::pack()
## ✖ dplyr::rename()    masks plyr::rename()
## ✖ dplyr::summarise() masks plyr::summarise()
## ✖ dplyr::summarize() masks plyr::summarize()
## ✖ tidyr::unpack()    masks Matrix::unpack()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(car)
## Loading required package: carData
## 
## Attaching package: 'car'
## 
## The following object is masked from 'package:purrr':
## 
##     some
## 
## The following object is masked from 'package:dplyr':
## 
##     recode

Input and sort data

#loading the data 

library(readr)
Behaviour_and_resp <- read_csv("C:/Users/jc819096/OneDrive - James Cook University/DATA/Lab 3/Behaviour data/Behaviour_and_resp_JMD2.csv")
## Rows: 544 Columns: 37
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (17): Maternal, Maternal_GF, Maternal_GM, Paternal, Paternal_GF, Paterna...
## dbl (20): Tank, Density, Female, Male, Age, Wet_weight, Weight, RMR, Mo2_res...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
View(Behaviour_and_resp)

#combine column for x axis
Behaviour_and_resp <- Behaviour_and_resp %>%  
 unite(Temp:Control_CO2, col="Juv_treat", sep="_", remove=FALSE)
head(Behaviour_and_resp)
## # A tibble: 6 × 38
##    Tank Density Female  Male Maternal Maternal_GF Maternal_GM Paternal
##   <dbl>   <dbl>  <dbl> <dbl> <chr>    <chr>       <chr>       <chr>   
## 1   100      18    132     9 DC       D           C           CA      
## 2    30      17    132     9 DC       D           C           CA      
## 3   113      14     75     9 AE       A           E           CA      
## 4   107      15    190   139 AE       A           E           FA      
## 5    32      17    190   139 AE       A           E           FA      
## 6   117      19     42   138 DA       D           A           CA      
## # ℹ 30 more variables: Paternal_GF <chr>, Paternal_GM <chr>,
## #   Parental_treatment <chr>, DOM <chr>, DOT <chr>, DOD <chr>, Age <dbl>,
## #   am_pm <chr>, Wet_weight <dbl>, Weight <dbl>, Juv_treat <chr>,
## #   Control_CO2 <chr>, Temp <chr>, Chamber_ID <chr>, Parental_number <chr>,
## #   RMR <dbl>, Mo2_rest <dbl>, MMR <dbl>, AS <dbl>, FS <dbl>, Mo2_max <dbl>,
## #   Mo2_AS <dbl>, `Behaviour day` <chr>, Cam <dbl>, `Video ID` <chr>,
## #   Time_emerge_s <dbl>, Time_emerge_min <dbl>, Bold <dbl>, Sum_score <dbl>, …
#coding the factors 
str(Behaviour_and_resp)
## tibble [544 × 38] (S3: tbl_df/tbl/data.frame)
##  $ Tank              : num [1:544] 100 30 113 107 32 117 39 167 113 75 ...
##  $ Density           : num [1:544] 18 17 14 15 17 19 16 3 14 17 ...
##  $ Female            : num [1:544] 132 132 75 190 190 42 190 185 75 190 ...
##  $ Male              : num [1:544] 9 9 9 139 139 138 197 190 9 139 ...
##  $ Maternal          : chr [1:544] "DC" "DC" "AE" "AE" ...
##  $ Maternal_GF       : chr [1:544] "D" "D" "A" "A" ...
##  $ Maternal_GM       : chr [1:544] "C" "C" "E" "E" ...
##  $ Paternal          : chr [1:544] "CA" "CA" "CA" "FA" ...
##  $ Paternal_GF       : chr [1:544] "C" "C" "C" "F" ...
##  $ Paternal_GM       : chr [1:544] "A" "A" "A" "A" ...
##  $ Parental_treatment: chr [1:544] "HHHC" "HHHC" "HHHC" "CCCC" ...
##  $ DOM               : chr [1:544] "8/01/2022" "8/01/2022" "6/03/2022" "16/02/2022" ...
##  $ DOT               : chr [1:544] "6/05/2022" "6/05/2022" "2/07/2022" "27/06/2022" ...
##  $ DOD               : chr [1:544] "7/05/2022" "7/05/2022" "3/07/2022" "28/06/2022" ...
##  $ Age               : num [1:544] 119 119 119 132 121 130 104 129 119 131 ...
##  $ am_pm             : chr [1:544] "pm" "am" "pm" "pm" ...
##  $ Wet_weight        : num [1:544] 1.55 1.45 2.04 1.59 1.42 1.26 1.24 2.61 1.9 1.86 ...
##  $ Weight            : num [1:544] 0.00155 0.00145 0.00204 0.00159 0.00142 0.00126 0.00124 0.00261 0.0019 0.00186 ...
##  $ Juv_treat         : chr [1:544] "zero_control" "elevated_control" "zero_control" "zero_control" ...
##  $ Control_CO2       : chr [1:544] "control" "control" "control" "control" ...
##  $ Temp              : chr [1:544] "zero" "elevated" "zero" "zero" ...
##  $ Chamber_ID        : chr [1:544] "A" "D" "D" "C" ...
##  $ Parental_number   : chr [1:544] "65" "65" "9b" "92b" ...
##  $ RMR               : num [1:544] 216 205 219 244 205 ...
##  $ Mo2_rest          : num [1:544] 0.34 0.3 0.45 0.39 0.29 0.21 0.31 0.44 0.32 0.33 ...
##  $ MMR               : num [1:544] 592 512 528 719 585 ...
##  $ AS                : num [1:544] 376 307 309 475 380 ...
##  $ FS                : num [1:544] 2.74 2.5 2.41 2.95 2.85 ...
##  $ Mo2_max           : num [1:544] 0.918 0.742 1.078 1.144 0.831 ...
##  $ Mo2_AS            : num [1:544] 0.58 0.45 0.63 0.76 0.54 0.82 0.54 2.12 0.84 0.68 ...
##  $ Behaviour day     : chr [1:544] "7/05/2022" "7/05/2022" "3/07/2022" "28/06/2022" ...
##  $ Cam               : num [1:544] 3 4 4 4 4 3 4 4 4 2 ...
##  $ Video ID          : chr [1:544] "4349" "4352" "4734" "4674" ...
##  $ Time_emerge_s     : num [1:544] 3 23 0 0 0 0 0 0 0 0 ...
##  $ Time_emerge_min   : num [1:544] 0.05 0.383 0 0 0 ...
##  $ Bold              : num [1:544] 4 4 1 1 1 1 1 2 2 2 ...
##  $ Sum_score         : num [1:544] 8 8 2 2 2 2 2 4 4 4 ...
##  $ Sum_score_v2      : num [1:544] 5 5 2 2 2 2 2 3 3 3 ...
Behaviour_and_resp$Tank= factor (Behaviour_and_resp$Tank)
Behaviour_and_resp$Parental_number = factor (Behaviour_and_resp$Parental_number)
Behaviour_and_resp$Parental_treatment = factor (Behaviour_and_resp$Parental_treatment, levels=c("CCCC", "CCCH", "HHCC", "CCHC","HHHC"))
Behaviour_and_resp$Temp = factor (Behaviour_and_resp$Temp)
Behaviour_and_resp$Control_CO2 = factor (Behaviour_and_resp$Control_CO2)
Behaviour_and_resp$am_pm = factor (Behaviour_and_resp$am_pm)



str(Behaviour_and_resp)
## tibble [544 × 38] (S3: tbl_df/tbl/data.frame)
##  $ Tank              : Factor w/ 162 levels "1","2","3","4",..: 89 23 102 96 25 106 31 147 102 64 ...
##  $ Density           : num [1:544] 18 17 14 15 17 19 16 3 14 17 ...
##  $ Female            : num [1:544] 132 132 75 190 190 42 190 185 75 190 ...
##  $ Male              : num [1:544] 9 9 9 139 139 138 197 190 9 139 ...
##  $ Maternal          : chr [1:544] "DC" "DC" "AE" "AE" ...
##  $ Maternal_GF       : chr [1:544] "D" "D" "A" "A" ...
##  $ Maternal_GM       : chr [1:544] "C" "C" "E" "E" ...
##  $ Paternal          : chr [1:544] "CA" "CA" "CA" "FA" ...
##  $ Paternal_GF       : chr [1:544] "C" "C" "C" "F" ...
##  $ Paternal_GM       : chr [1:544] "A" "A" "A" "A" ...
##  $ Parental_treatment: Factor w/ 5 levels "CCCC","CCCH",..: 5 5 5 1 2 3 1 2 5 1 ...
##  $ DOM               : chr [1:544] "8/01/2022" "8/01/2022" "6/03/2022" "16/02/2022" ...
##  $ DOT               : chr [1:544] "6/05/2022" "6/05/2022" "2/07/2022" "27/06/2022" ...
##  $ DOD               : chr [1:544] "7/05/2022" "7/05/2022" "3/07/2022" "28/06/2022" ...
##  $ Age               : num [1:544] 119 119 119 132 121 130 104 129 119 131 ...
##  $ am_pm             : Factor w/ 2 levels "am","pm": 2 1 2 2 1 2 2 2 2 1 ...
##  $ Wet_weight        : num [1:544] 1.55 1.45 2.04 1.59 1.42 1.26 1.24 2.61 1.9 1.86 ...
##  $ Weight            : num [1:544] 0.00155 0.00145 0.00204 0.00159 0.00142 0.00126 0.00124 0.00261 0.0019 0.00186 ...
##  $ Juv_treat         : chr [1:544] "zero_control" "elevated_control" "zero_control" "zero_control" ...
##  $ Control_CO2       : Factor w/ 2 levels "CO","control": 2 2 2 2 2 1 2 2 2 1 ...
##  $ Temp              : Factor w/ 2 levels "elevated","zero": 2 1 2 2 1 1 2 1 2 2 ...
##  $ Chamber_ID        : chr [1:544] "A" "D" "D" "C" ...
##  $ Parental_number   : Factor w/ 24 levels "13","15","4",..: 8 8 24 20 6 14 19 21 24 20 ...
##  $ RMR               : num [1:544] 216 205 219 244 205 ...
##  $ Mo2_rest          : num [1:544] 0.34 0.3 0.45 0.39 0.29 0.21 0.31 0.44 0.32 0.33 ...
##  $ MMR               : num [1:544] 592 512 528 719 585 ...
##  $ AS                : num [1:544] 376 307 309 475 380 ...
##  $ FS                : num [1:544] 2.74 2.5 2.41 2.95 2.85 ...
##  $ Mo2_max           : num [1:544] 0.918 0.742 1.078 1.144 0.831 ...
##  $ Mo2_AS            : num [1:544] 0.58 0.45 0.63 0.76 0.54 0.82 0.54 2.12 0.84 0.68 ...
##  $ Behaviour day     : chr [1:544] "7/05/2022" "7/05/2022" "3/07/2022" "28/06/2022" ...
##  $ Cam               : num [1:544] 3 4 4 4 4 3 4 4 4 2 ...
##  $ Video ID          : chr [1:544] "4349" "4352" "4734" "4674" ...
##  $ Time_emerge_s     : num [1:544] 3 23 0 0 0 0 0 0 0 0 ...
##  $ Time_emerge_min   : num [1:544] 0.05 0.383 0 0 0 ...
##  $ Bold              : num [1:544] 4 4 1 1 1 1 1 2 2 2 ...
##  $ Sum_score         : num [1:544] 8 8 2 2 2 2 2 4 4 4 ...
##  $ Sum_score_v2      : num [1:544] 5 5 2 2 2 2 2 3 3 3 ...
Behaviour_and_resp$Juv_treat = factor (Behaviour_and_resp$Juv_treat, levels=c("zero_control", "elevated_control", "zero_CO", "elevated_CO"))

head(Behaviour_and_resp)
## # A tibble: 6 × 38
##   Tank  Density Female  Male Maternal Maternal_GF Maternal_GM Paternal
##   <fct>   <dbl>  <dbl> <dbl> <chr>    <chr>       <chr>       <chr>   
## 1 100        18    132     9 DC       D           C           CA      
## 2 30         17    132     9 DC       D           C           CA      
## 3 113        14     75     9 AE       A           E           CA      
## 4 107        15    190   139 AE       A           E           FA      
## 5 32         17    190   139 AE       A           E           FA      
## 6 117        19     42   138 DA       D           A           CA      
## # ℹ 30 more variables: Paternal_GF <chr>, Paternal_GM <chr>,
## #   Parental_treatment <fct>, DOM <chr>, DOT <chr>, DOD <chr>, Age <dbl>,
## #   am_pm <fct>, Wet_weight <dbl>, Weight <dbl>, Juv_treat <fct>,
## #   Control_CO2 <fct>, Temp <fct>, Chamber_ID <chr>, Parental_number <fct>,
## #   RMR <dbl>, Mo2_rest <dbl>, MMR <dbl>, AS <dbl>, FS <dbl>, Mo2_max <dbl>,
## #   Mo2_AS <dbl>, `Behaviour day` <chr>, Cam <dbl>, `Video ID` <chr>,
## #   Time_emerge_s <dbl>, Time_emerge_min <dbl>, Bold <dbl>, Sum_score <dbl>, …

Exploring raw data

ggplot(data=Behaviour_and_resp, aes(x=Bold, color=Parental_treatment, fill= Parental_treatment)) +
geom_density(aes(y=..density..), position="identity", alpha=0.5) +  theme_classic() + facet_wrap(~Juv_treat) 
## Warning: The dot-dot notation (`..density..`) was deprecated in ggplot2 3.4.0.
## ℹ Please use `after_stat(density)` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.

ggplot(Behaviour_and_resp, aes(x=Bold, y=AS, colour=Parental_treatment)) + geom_point() + theme_classic() + geom_smooth(method = lm, se=FALSE) + facet_wrap(~Juv_treat)
## `geom_smooth()` using formula = 'y ~ x'

ggplot(Behaviour_and_resp, aes(x=Bold, y=RMR, colour=Parental_treatment)) + geom_point()  + theme_classic() + geom_smooth(method = lm, se=FALSE)+ facet_wrap(~Juv_treat)
## `geom_smooth()` using formula = 'y ~ x'

Raw data checks

qqPlot(Behaviour_and_resp$Bold)

## [1] 3 4
qqPlot(Behaviour_and_resp$RMR)

## [1] 288 345
qqPlot(Behaviour_and_resp$AS)

## [1]  73 189

RMR model

### plot data
ggplot(Behaviour_and_resp, aes(x=Bold, y=RMR, colour=Parental_treatment)) + theme_classic() + geom_smooth(method = lm) +  facet_grid(~Juv_treat)
## `geom_smooth()` using formula = 'y ~ x'

lmer.bold.RMR= lmer(RMR ~ Parental_treatment * Temp * Control_CO2  * Bold  + (1 | Parental_number) + (1 | Chamber_ID), data = Behaviour_and_resp)

model analysis

summary(lmer.bold.RMR)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## RMR ~ Parental_treatment * Temp * Control_CO2 * Bold + (1 | Parental_number) +  
##     (1 | Chamber_ID)
##    Data: Behaviour_and_resp
## 
## REML criterion at convergence: 5262.2
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.54804 -0.65217  0.04187  0.63304  2.52837 
## 
## Random effects:
##  Groups          Name        Variance Std.Dev.
##  Parental_number (Intercept)   54.57   7.387  
##  Chamber_ID      (Intercept)  137.53  11.727  
##  Residual                    1479.91  38.470  
## Number of obs: 544, groups:  Parental_number, 24; Chamber_ID, 4
## 
## Fixed effects:
##                                                         Estimate Std. Error
## (Intercept)                                              142.081     30.617
## Parental_treatmentCCCH                                   107.809     38.996
## Parental_treatmentHHCC                                    72.567     36.899
## Parental_treatmentCCHC                                    67.899     37.840
## Parental_treatmentHHHC                                    66.338     40.799
## Tempzero                                                  60.797     40.129
## Control_CO2control                                       134.417     37.646
## Bold                                                      24.609      8.524
## Parental_treatmentCCCH:Tempzero                          -67.120     52.163
## Parental_treatmentHHCC:Tempzero                          -45.192     55.006
## Parental_treatmentCCHC:Tempzero                          -56.797     51.283
## Parental_treatmentHHHC:Tempzero                          -81.870     53.866
## Parental_treatmentCCCH:Control_CO2control               -170.907     49.886
## Parental_treatmentHHCC:Control_CO2control               -107.978     51.786
## Parental_treatmentCCHC:Control_CO2control               -104.169     47.598
## Parental_treatmentHHHC:Control_CO2control               -115.172     54.386
## Tempzero:Control_CO2control                              -69.479     51.168
## Parental_treatmentCCCH:Bold                              -32.974     10.855
## Parental_treatmentHHCC:Bold                              -19.223     10.375
## Parental_treatmentCCHC:Bold                              -26.142     10.636
## Parental_treatmentHHHC:Bold                              -16.307     11.616
## Tempzero:Bold                                            -17.287     11.741
## Control_CO2control:Bold                                  -37.477     10.911
## Parental_treatmentCCCH:Tempzero:Control_CO2control       112.552     67.100
## Parental_treatmentHHCC:Tempzero:Control_CO2control        63.157     73.070
## Parental_treatmentCCHC:Tempzero:Control_CO2control        58.871     66.640
## Parental_treatmentHHHC:Tempzero:Control_CO2control        92.268     71.515
## Parental_treatmentCCCH:Tempzero:Bold                      19.428     15.270
## Parental_treatmentHHCC:Tempzero:Bold                      10.007     15.901
## Parental_treatmentCCHC:Tempzero:Bold                      22.528     14.943
## Parental_treatmentHHHC:Tempzero:Bold                      24.906     16.167
## Parental_treatmentCCCH:Control_CO2control:Bold            47.456     14.242
## Parental_treatmentHHCC:Control_CO2control:Bold            30.993     14.516
## Parental_treatmentCCHC:Control_CO2control:Bold            33.714     13.719
## Parental_treatmentHHHC:Control_CO2control:Bold            34.452     15.922
## Tempzero:Control_CO2control:Bold                          19.970     15.407
## Parental_treatmentCCCH:Tempzero:Control_CO2control:Bold  -28.702     20.200
## Parental_treatmentHHCC:Tempzero:Control_CO2control:Bold  -15.886     21.350
## Parental_treatmentCCHC:Tempzero:Control_CO2control:Bold  -20.911     19.876
## Parental_treatmentHHHC:Tempzero:Control_CO2control:Bold  -34.449     21.703
##                                                               df t value
## (Intercept)                                              388.018   4.641
## Parental_treatmentCCCH                                   452.129   2.765
## Parental_treatmentHHCC                                   463.359   1.967
## Parental_treatmentCCHC                                   471.124   1.794
## Parental_treatmentHHHC                                   458.386   1.626
## Tempzero                                                 488.733   1.515
## Control_CO2control                                       499.923   3.571
## Bold                                                     485.507   2.887
## Parental_treatmentCCCH:Tempzero                          492.715  -1.287
## Parental_treatmentHHCC:Tempzero                          501.289  -0.822
## Parental_treatmentCCHC:Tempzero                          500.007  -1.108
## Parental_treatmentHHHC:Tempzero                          501.055  -1.520
## Parental_treatmentCCCH:Control_CO2control                499.909  -3.426
## Parental_treatmentHHCC:Control_CO2control                500.904  -2.085
## Parental_treatmentCCHC:Control_CO2control                500.597  -2.189
## Parental_treatmentHHHC:Control_CO2control                489.309  -2.118
## Tempzero:Control_CO2control                              500.809  -1.358
## Parental_treatmentCCCH:Bold                              483.988  -3.038
## Parental_treatmentHHCC:Bold                              496.412  -1.853
## Parental_treatmentCCHC:Bold                              496.137  -2.458
## Parental_treatmentHHHC:Bold                              493.583  -1.404
## Tempzero:Bold                                            495.024  -1.472
## Control_CO2control:Bold                                  494.698  -3.435
## Parental_treatmentCCCH:Tempzero:Control_CO2control       500.979   1.677
## Parental_treatmentHHCC:Tempzero:Control_CO2control       500.876   0.864
## Parental_treatmentCCHC:Tempzero:Control_CO2control       500.993   0.883
## Parental_treatmentHHHC:Tempzero:Control_CO2control       500.681   1.290
## Parental_treatmentCCCH:Tempzero:Bold                     499.343   1.272
## Parental_treatmentHHCC:Tempzero:Bold                     501.301   0.629
## Parental_treatmentCCHC:Tempzero:Bold                     500.859   1.508
## Parental_treatmentHHHC:Tempzero:Bold                     500.378   1.541
## Parental_treatmentCCCH:Control_CO2control:Bold           495.855   3.332
## Parental_treatmentHHCC:Control_CO2control:Bold           499.404   2.135
## Parental_treatmentCCHC:Control_CO2control:Bold           501.342   2.457
## Parental_treatmentHHHC:Control_CO2control:Bold           478.402   2.164
## Tempzero:Control_CO2control:Bold                         500.968   1.296
## Parental_treatmentCCCH:Tempzero:Control_CO2control:Bold  501.158  -1.421
## Parental_treatmentHHCC:Tempzero:Control_CO2control:Bold  500.987  -0.744
## Parental_treatmentCCHC:Tempzero:Control_CO2control:Bold  500.730  -1.052
## Parental_treatmentHHHC:Tempzero:Control_CO2control:Bold  500.095  -1.587
##                                                         Pr(>|t|)    
## (Intercept)                                             4.76e-06 ***
## Parental_treatmentCCCH                                  0.005932 ** 
## Parental_treatmentHHCC                                  0.049823 *  
## Parental_treatmentCCHC                                  0.073392 .  
## Parental_treatmentHHHC                                  0.104642    
## Tempzero                                                0.130410    
## Control_CO2control                                      0.000391 ***
## Bold                                                    0.004064 ** 
## Parental_treatmentCCCH:Tempzero                         0.198787    
## Parental_treatmentHHCC:Tempzero                         0.411713    
## Parental_treatmentCCHC:Tempzero                         0.268605    
## Parental_treatmentHHHC:Tempzero                         0.129173    
## Parental_treatmentCCCH:Control_CO2control               0.000663 ***
## Parental_treatmentHHCC:Control_CO2control               0.037569 *  
## Parental_treatmentCCHC:Control_CO2control               0.029094 *  
## Parental_treatmentHHHC:Control_CO2control               0.034708 *  
## Tempzero:Control_CO2control                             0.175118    
## Parental_treatmentCCCH:Bold                             0.002513 ** 
## Parental_treatmentHHCC:Bold                             0.064496 .  
## Parental_treatmentCCHC:Bold                             0.014315 *  
## Parental_treatmentHHHC:Bold                             0.160989    
## Tempzero:Bold                                           0.141557    
## Control_CO2control:Bold                                 0.000643 ***
## Parental_treatmentCCCH:Tempzero:Control_CO2control      0.094092 .  
## Parental_treatmentHHCC:Tempzero:Control_CO2control      0.387822    
## Parental_treatmentCCHC:Tempzero:Control_CO2control      0.377435    
## Parental_treatmentHHHC:Tempzero:Control_CO2control      0.197580    
## Parental_treatmentCCCH:Tempzero:Bold                    0.203874    
## Parental_treatmentHHCC:Tempzero:Bold                    0.529425    
## Parental_treatmentCCHC:Tempzero:Bold                    0.132299    
## Parental_treatmentHHHC:Tempzero:Bold                    0.124059    
## Parental_treatmentCCCH:Control_CO2control:Bold          0.000926 ***
## Parental_treatmentHHCC:Control_CO2control:Bold          0.033240 *  
## Parental_treatmentCCHC:Control_CO2control:Bold          0.014334 *  
## Parental_treatmentHHHC:Control_CO2control:Bold          0.030972 *  
## Tempzero:Control_CO2control:Bold                        0.195510    
## Parental_treatmentCCCH:Tempzero:Control_CO2control:Bold 0.155970    
## Parental_treatmentHHCC:Tempzero:Control_CO2control:Bold 0.457186    
## Parental_treatmentCCHC:Tempzero:Control_CO2control:Bold 0.293275    
## Parental_treatmentHHHC:Tempzero:Control_CO2control:Bold 0.113082    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation matrix not shown by default, as p = 40 > 12.
## Use print(x, correlation=TRUE)  or
##     vcov(x)        if you need it
Anova(lmer.bold.RMR)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: RMR
##                                            Chisq Df Pr(>Chisq)  
## Parental_treatment                        4.3914  4    0.35562  
## Temp                                      0.4341  1    0.51000  
## Control_CO2                               4.7936  1    0.02857 *
## Bold                                      0.0239  1    0.87725  
## Parental_treatment:Temp                   5.7365  4    0.21971  
## Parental_treatment:Control_CO2            1.9469  4    0.74552  
## Temp:Control_CO2                          0.1826  1    0.66916  
## Parental_treatment:Bold                   4.4520  4    0.34828  
## Temp:Bold                                 0.1969  1    0.65725  
## Control_CO2:Bold                          4.8343  1    0.02790 *
## Parental_treatment:Temp:Control_CO2       3.8510  4    0.42654  
## Parental_treatment:Temp:Bold              1.5869  4    0.81114  
## Parental_treatment:Control_CO2:Bold      11.3979  4    0.02244 *
## Temp:Control_CO2:Bold                     0.0114  1    0.91509  
## Parental_treatment:Temp:Control_CO2:Bold  3.0958  4    0.54192  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

post model checks

performance::check_model(lmer.bold.RMR, check="homogeneity") 
## Model has interaction terms. VIFs might be inflated.
##   You may check multicollinearity among predictors of a model without
##   interaction terms.

performance::check_model(lmer.bold.RMR, check="outliers") 
## Model has interaction terms. VIFs might be inflated.
##   You may check multicollinearity among predictors of a model without
##   interaction terms.

performance::check_model(lmer.bold.RMR, check="qq") 
## Model has interaction terms. VIFs might be inflated.
##   You may check multicollinearity among predictors of a model without
##   interaction terms.

performance::check_model(lmer.bold.RMR, check="normality") 
## Model has interaction terms. VIFs might be inflated.
##   You may check multicollinearity among predictors of a model without
##   interaction terms.

performance::check_model(lmer.bold.RMR, check="linearity") 
## Model has interaction terms. VIFs might be inflated.
##   You may check multicollinearity among predictors of a model without
##   interaction terms.

performance::check_model(lmer.bold.RMR, check="pp_check")
## Model has interaction terms. VIFs might be inflated.
##   You may check multicollinearity among predictors of a model without
##   interaction terms.

#Homogeneity
plot(lmer.bold.RMR)

#normality
hist(residuals(lmer.bold.RMR), col="darkgray")

shapiro.test(residuals(lmer.bold.RMR))
## 
##  Shapiro-Wilk normality test
## 
## data:  residuals(lmer.bold.RMR)
## W = 0.99531, p-value = 0.09984
qqnorm(resid(lmer.bold.RMR))
qqline(resid(lmer.bold.RMR))

#model fit
library(sjPlot)
## Install package "strengejacke" from GitHub (`devtools::install_github("strengejacke/strengejacke")`) to load all sj-packages at once!
plot_model(lmer.bold.RMR, type = "diag")
## Warning in checkMatrixPackageVersion(): Package version inconsistency detected.
## TMB was built with Matrix version 1.5.3
## Current Matrix version is 1.5.4
## Please re-install 'TMB' from source using install.packages('TMB', type = 'source') or ask CRAN for a binary version of 'TMB' matching CRAN's 'Matrix' package
## [[1]]
## `geom_smooth()` using formula = 'y ~ x'

## 
## [[2]]
## [[2]]$Parental_number
## `geom_smooth()` using formula = 'y ~ x'

## 
## [[2]]$Chamber_ID
## `geom_smooth()` using formula = 'y ~ x'

## 
## 
## [[3]]

## 
## [[4]]
## `geom_smooth()` using formula = 'y ~ x'

#outlier test
outlierTest(lmer.bold.RMR)
## No Studentized residuals with Bonferroni p < 0.05
## Largest |rstudent|:
##     rstudent unadjusted p-value Bonferroni p
## 506 2.706483          0.0070325           NA
library(DHARMa)
## This is DHARMa 0.4.6. For overview type '?DHARMa'. For recent changes, type news(package = 'DHARMa')
plot(simulateResiduals(lmer.bold.RMR))

emmeans(lmer.bold.RMR, pairwise ~ Control_CO2, adjust="tukey") 
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Control_CO2 emmean   SE   df lower.CL upper.CL
##  CO             225 6.55 3.96      207      244
##  control        232 6.51 3.86      214      250
## 
## Results are averaged over the levels of: Parental_treatment, Temp 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast     estimate   SE  df t.ratio p.value
##  CO - control    -6.86 3.45 491  -1.988  0.0473
## 
## Results are averaged over the levels of: Parental_treatment, Temp 
## Degrees-of-freedom method: kenward-roger
plot(emmeans(lmer.bold.RMR, pairwise ~ Control_CO2, adjust="tukey"))
## NOTE: Results may be misleading due to involvement in interactions

emmeans(lmer.bold.RMR, pairwise ~ Parental_treatment *  Control_CO2, adjust="tukey") 
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Parental_treatment Control_CO2 emmean   SE   df lower.CL upper.CL
##  CCCC               CO             223 8.73 11.6      204      242
##  CCCH               CO             224 8.76 11.8      204      243
##  HHCC               CO             228 8.49 10.4      209      247
##  CCHC               CO             215 8.73 11.7      196      235
##  HHHC               CO             236 9.13 13.4      217      256
##  CCCC               control        236 8.41 10.0      217      254
##  CCCH               control        226 8.64 11.2      207      245
##  HHCC               control        237 8.49 10.4      218      256
##  CCHC               control        227 8.34  9.7      208      246
##  HHHC               control        234 9.20 13.6      215      254
## 
## Results are averaged over the levels of: Temp 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                    estimate   SE    df t.ratio p.value
##  CCCC CO - CCCH CO             -0.577 9.17  49.8  -0.063  1.0000
##  CCCC CO - HHCC CO             -4.934 8.92  44.6  -0.553  0.9999
##  CCCC CO - CCHC CO              7.621 9.15  49.4   0.833  0.9976
##  CCCC CO - HHHC CO            -13.197 9.53  46.6  -1.385  0.9259
##  CCCC CO - CCCC control       -12.604 7.47 486.8  -1.686  0.8029
##  CCCC CO - CCCH control        -3.402 9.07  47.3  -0.375  1.0000
##  CCCC CO - HHCC control       -14.144 8.92  44.5  -1.586  0.8478
##  CCCC CO - CCHC control        -3.915 8.77  42.3  -0.446  1.0000
##  CCCC CO - HHHC control       -11.327 9.60  45.5  -1.180  0.9718
##  CCCH CO - HHCC CO             -4.357 8.94  45.4  -0.487  1.0000
##  CCCH CO - CCHC CO              8.197 9.17  50.4   0.894  0.9960
##  CCCH CO - HHHC CO            -12.621 9.55  47.3  -1.322  0.9435
##  CCCH CO - CCCC control       -12.027 8.87  44.1  -1.356  0.9340
##  CCCH CO - CCCH control        -2.825 7.80 492.3  -0.362  1.0000
##  CCCH CO - HHCC control       -13.568 8.94  45.4  -1.517  0.8783
##  CCCH CO - CCHC control        -3.339 8.79  43.1  -0.380  1.0000
##  CCCH CO - HHHC control       -10.751 9.61  46.1  -1.118  0.9802
##  HHCC CO - CCHC CO             12.554 8.92  45.1   1.408  0.9185
##  HHCC CO - HHHC CO             -8.264 9.31  42.7  -0.888  0.9961
##  HHCC CO - CCCC control        -7.670 8.61  39.2  -0.891  0.9959
##  HHCC CO - CCCH control         1.532 8.84  43.1   0.173  1.0000
##  HHCC CO - HHCC control        -9.211 7.29 490.1  -1.263  0.9612
##  HHCC CO - CCHC control         1.018 8.53  38.2   0.119  1.0000
##  HHCC CO - HHHC control        -6.394 9.37  41.7  -0.682  0.9995
##  CCHC CO - HHHC CO            -20.818 9.53  47.1  -2.184  0.4812
##  CCHC CO - CCCC control       -20.225 8.85  43.8  -2.286  0.4176
##  CCHC CO - CCCH control       -11.022 9.07  48.0  -1.216  0.9662
##  CCHC CO - HHCC control       -21.765 8.92  45.1  -2.441  0.3274
##  CCHC CO - CCHC control       -11.536 7.41 485.3  -1.557  0.8677
##  CCHC CO - HHHC control       -18.948 9.59  45.9  -1.975  0.6198
##  HHHC CO - CCCC control         0.594 9.25  41.8   0.064  1.0000
##  HHHC CO - CCCH control         9.796 9.46  45.4   1.036  0.9883
##  HHHC CO - HHCC control        -0.947 9.31  42.8  -0.102  1.0000
##  HHHC CO - CCHC control         9.282 9.18  40.9   1.011  0.9899
##  HHHC CO - HHHC control         1.870 8.46 495.2   0.221  1.0000
##  CCCC control - CCCH control    9.202 8.76  41.8   1.051  0.9868
##  CCCC control - HHCC control   -1.540 8.60  39.1  -0.179  1.0000
##  CCCC control - CCHC control    8.689 8.45  36.8   1.029  0.9884
##  CCCC control - HHHC control    1.277 9.30  40.6   0.137  1.0000
##  CCCH control - HHCC control  -10.743 8.83  43.0  -1.216  0.9656
##  CCCH control - CCHC control   -0.514 8.68  40.8  -0.059  1.0000
##  CCCH control - HHHC control   -7.926 9.52  44.2  -0.833  0.9976
##  HHCC control - CCHC control   10.229 8.53  38.1   1.200  0.9679
##  HHCC control - HHHC control    2.817 9.37  41.7   0.301  1.0000
##  CCHC control - HHHC control   -7.412 9.23  39.6  -0.803  0.9981
## 
## Results are averaged over the levels of: Temp 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 10 estimates
plot(emmeans(lmer.bold.RMR, pairwise ~ Parental_treatment *  Control_CO2, adjust="tukey"))
## NOTE: Results may be misleading due to involvement in interactions

emmeans(lmer.bold.RMR, pairwise ~ Parental_treatment * Temp * Control_CO2, adjust="tukey") 
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Parental_treatment Temp     Control_CO2 emmean    SE   df lower.CL upper.CL
##  CCCC               elevated CO             220 10.58 24.5      198      242
##  CCCH               elevated CO             223 10.37 22.9      202      245
##  HHCC               elevated CO             232  9.82 18.6      211      252
##  CCHC               elevated CO             205 10.46 23.7      184      227
##  HHHC               elevated CO             235 10.69 24.9      213      257
##  CCCC               zero     CO             226 10.14 21.0      205      247
##  CCCH               zero     CO             224 10.49 23.6      202      246
##  HHCC               zero     CO             224 10.03 20.1      203      245
##  CCHC               zero     CO             226 10.27 22.0      204      247
##  HHHC               zero     CO             238 11.12 29.2      215      261
##  CCCC               elevated control        236  9.76 18.1      215      256
##  CCCH               elevated control        219 10.53 24.3      197      240
##  HHCC               elevated control        238 10.43 23.3      216      259
##  CCHC               elevated control        223  9.67 17.5      203      244
##  HHHC               elevated control        244 11.37 30.9      221      268
##  CCCC               zero     control        236  9.84 18.7      215      256
##  CCCH               zero     control        234  9.86 18.8      214      255
##  HHCC               zero     control        237  9.41 15.7      217      257
##  CCHC               zero     control        230  9.67 17.5      210      251
##  HHHC               zero     control        224 10.56 23.7      203      246
## 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                                      estimate    SE    df t.ratio
##  CCCC elevated CO - CCCH elevated CO            -3.3702 12.26 134.9  -0.275
##  CCCC elevated CO - HHCC elevated CO           -11.6818 11.82 119.0  -0.989
##  CCCC elevated CO - CCHC elevated CO            14.8986 12.34 136.4   1.207
##  CCCC elevated CO - HHHC elevated CO           -14.6901 12.53 119.3  -1.172
##  CCCC elevated CO - CCCC zero CO                -6.0444 11.15 498.2  -0.542
##  CCCC elevated CO - CCCH zero CO                -3.8273 12.37 128.6  -0.309
##  CCCC elevated CO - HHCC zero CO                -4.2299 11.99 123.3  -0.353
##  CCCC elevated CO - CCHC zero CO                -5.7012 12.19 129.6  -0.468
##  CCCC elevated CO - HHHC zero CO               -17.7491 12.92 132.4  -1.374
##  CCCC elevated CO - CCCC elevated control      -15.7180 10.73 489.9  -1.465
##  CCCC elevated CO - CCCH elevated control        1.5128 12.41 136.3   0.122
##  CCCC elevated CO - HHCC elevated control      -17.5856 12.32 132.9  -1.427
##  CCCC elevated CO - CCHC elevated control       -3.4313 11.68 114.7  -0.294
##  CCCC elevated CO - HHHC elevated control      -24.3551 13.12 128.2  -1.856
##  CCCC elevated CO - CCCC zero control          -15.5341 10.80 489.9  -1.439
##  CCCC elevated CO - CCCH zero control          -14.3604 11.85 118.4  -1.212
##  CCCC elevated CO - HHCC zero control          -16.7473 11.48 108.5  -1.459
##  CCCC elevated CO - CCHC zero control          -10.4436 11.68 115.4  -0.894
##  CCCC elevated CO - HHHC zero control           -4.3439 12.43 115.7  -0.349
##  CCCH elevated CO - HHCC elevated CO            -8.3116 11.62 119.8  -0.715
##  CCCH elevated CO - CCHC elevated CO            18.2687 12.15 137.8   1.504
##  CCCH elevated CO - HHHC elevated CO           -11.3200 12.36 120.3  -0.916
##  CCCH elevated CO - CCCC zero CO                -2.6742 11.90 128.5  -0.225
##  CCCH elevated CO - CCCH zero CO                -0.4571 11.31 500.8  -0.040
##  CCCH elevated CO - HHCC zero CO                -0.8598 11.79 124.2  -0.073
##  CCCH elevated CO - CCHC zero CO                -2.3311 12.01 131.2  -0.194
##  CCCH elevated CO - HHHC zero CO               -14.3790 12.74 133.3  -1.129
##  CCCH elevated CO - CCCC elevated control      -12.3478 11.56 117.6  -1.068
##  CCCH elevated CO - CCCH elevated control        4.8829 11.32 493.8   0.431
##  CCCH elevated CO - HHCC elevated control      -14.2155 12.12 134.2  -1.172
##  CCCH elevated CO - CCHC elevated control       -0.0612 11.48 115.3  -0.005
##  CCCH elevated CO - HHHC elevated control      -20.9849 12.93 128.9  -1.622
##  CCCH elevated CO - CCCC zero control          -12.1639 11.63 118.7  -1.046
##  CCCH elevated CO - CCCH zero control          -10.9902 10.69 490.3  -1.028
##  CCCH elevated CO - HHCC zero control          -13.3772 11.29 109.2  -1.185
##  CCCH elevated CO - CCHC zero control           -7.0734 11.49 116.1  -0.616
##  CCCH elevated CO - HHHC zero control           -0.9738 12.25 116.2  -0.080
##  HHCC elevated CO - CCHC elevated CO            26.5803 11.71 121.4   2.270
##  HHCC elevated CO - HHHC elevated CO            -3.0083 11.90 105.5  -0.253
##  HHCC elevated CO - CCCC zero CO                 5.6374 11.42 111.5   0.494
##  HHCC elevated CO - CCCH zero CO                 7.8545 11.73 113.6   0.670
##  HHCC elevated CO - HHCC zero CO                 7.4519 10.29 485.9   0.724
##  HHCC elevated CO - CCHC zero CO                 5.9805 11.54 114.2   0.518
##  HHCC elevated CO - HHHC zero CO                -6.0674 12.29 118.0  -0.494
##  HHCC elevated CO - CCCC elevated control       -4.0362 11.09 101.5  -0.364
##  HHCC elevated CO - CCCH elevated control       13.1945 11.78 121.5   1.120
##  HHCC elevated CO - HHCC elevated control       -5.9039 10.70 491.1  -0.552
##  HHCC elevated CO - CCHC elevated control        8.2505 11.01  99.4   0.749
##  HHCC elevated CO - HHHC elevated control      -12.6733 12.52 115.3  -1.012
##  HHCC elevated CO - CCCC zero control           -3.8523 11.17 102.8  -0.345
##  HHCC elevated CO - CCCH zero control           -2.6786 11.18 102.8  -0.240
##  HHCC elevated CO - HHCC zero control           -5.0655  9.71 485.6  -0.522
##  HHCC elevated CO - CCHC zero control            1.2382 11.01 100.0   0.112
##  HHCC elevated CO - HHHC zero control            7.3378 11.79 101.8   0.622
##  CCHC elevated CO - HHHC elevated CO           -29.5887 12.43 121.6  -2.380
##  CCHC elevated CO - CCCC zero CO               -20.9429 11.98 130.1  -1.748
##  CCHC elevated CO - CCCH zero CO               -18.7258 12.26 131.2  -1.527
##  CCHC elevated CO - HHCC zero CO               -19.1285 11.88 125.9  -1.610
##  CCHC elevated CO - CCHC zero CO               -20.5998 11.17 493.8  -1.845
##  CCHC elevated CO - HHHC zero CO               -32.6477 12.82 134.7  -2.547
##  CCHC elevated CO - CCCC elevated control      -30.6165 11.65 119.4  -2.628
##  CCHC elevated CO - CCCH elevated control      -13.3858 12.31 139.6  -1.087
##  CCHC elevated CO - HHCC elevated control      -32.4842 12.21 135.8  -2.661
##  CCHC elevated CO - CCHC elevated control      -18.3299 10.57 486.5  -1.734
##  CCHC elevated CO - HHHC elevated control      -39.2536 13.01 130.4  -3.017
##  CCHC elevated CO - CCCC zero control          -30.4326 11.72 120.5  -2.596
##  CCHC elevated CO - CCCH zero control          -29.2589 11.75 121.2  -2.490
##  CCHC elevated CO - HHCC zero control          -31.6458 11.38 111.0  -2.780
##  CCHC elevated CO - CCHC zero control          -25.3421 10.59 486.9  -2.393
##  CCHC elevated CO - HHHC zero control          -19.2425 12.33 117.8  -1.560
##  HHHC elevated CO - CCCC zero CO                 8.6457 12.17 113.1   0.710
##  HHHC elevated CO - CCCH zero CO                10.8628 12.45 114.8   0.872
##  HHHC elevated CO - HHCC zero CO                10.4602 12.09 109.8   0.865
##  HHHC elevated CO - CCHC zero CO                 8.9889 12.28 115.4   0.732
##  HHHC elevated CO - HHHC zero CO                -3.0590 11.92 490.9  -0.257
##  HHHC elevated CO - CCCC elevated control       -1.0279 11.86 104.1  -0.087
##  HHHC elevated CO - CCCH elevated control       16.2029 12.51 121.8   1.296
##  HHHC elevated CO - HHCC elevated control       -2.8955 12.42 118.8  -0.233
##  HHHC elevated CO - CCHC elevated control       11.2588 11.78 102.1   0.956
##  HHHC elevated CO - HHHC elevated control       -9.6650 12.08 494.8  -0.800
##  HHHC elevated CO - CCCC zero control           -0.8440 11.93 105.2  -0.071
##  HHHC elevated CO - CCCH zero control            0.3297 11.94 105.3   0.028
##  HHHC elevated CO - HHCC zero control           -2.0572 11.58  96.3  -0.178
##  HHHC elevated CO - CCHC zero control            4.2466 11.79 102.8   0.360
##  HHHC elevated CO - HHHC zero control           10.3462 11.37 487.2   0.910
##  CCCC zero CO - CCCH zero CO                     2.2171 12.00 122.1   0.185
##  CCCC zero CO - HHCC zero CO                     1.8145 11.61 116.3   0.156
##  CCCC zero CO - CCHC zero CO                     0.3431 11.81 122.5   0.029
##  CCCC zero CO - HHHC zero CO                   -11.7048 12.56 126.0  -0.932
##  CCCC zero CO - CCCC elevated control           -9.6736 10.37 490.4  -0.933
##  CCCC zero CO - CCCH elevated control            7.5571 12.04 129.9   0.628
##  CCCC zero CO - HHCC elevated control          -11.5413 11.96 126.7  -0.965
##  CCCC zero CO - CCHC elevated control            2.6131 11.30 107.9   0.231
##  CCCC zero CO - HHHC elevated control          -18.3107 12.78 122.7  -1.433
##  CCCC zero CO - CCCC zero control               -9.4897 10.46 492.9  -0.908
##  CCCC zero CO - CCCH zero control               -8.3160 11.45 111.0  -0.726
##  CCCC zero CO - HHCC zero control              -10.7029 11.07 100.8  -0.967
##  CCCC zero CO - CCHC zero control               -4.3992 11.29 108.3  -0.389
##  CCCC zero CO - HHHC zero control                1.7004 12.06 109.3   0.141
##  CCCH zero CO - HHCC zero CO                    -0.4026 11.91 118.3  -0.034
##  CCCH zero CO - CCHC zero CO                    -1.8740 12.11 124.6  -0.155
##  CCCH zero CO - HHHC zero CO                   -13.9219 12.83 127.2  -1.085
##  CCCH zero CO - CCCC elevated control          -11.8907 11.68 112.2  -1.018
##  CCCH zero CO - CCCH elevated control            5.3400 11.40 499.1   0.468
##  CCCH zero CO - HHCC elevated control          -13.7584 12.24 128.0  -1.124
##  CCCH zero CO - CCHC elevated control            0.3960 11.60 110.0   0.034
##  CCCH zero CO - HHHC elevated control          -20.5278 13.04 123.9  -1.574
##  CCCH zero CO - CCCC zero control              -11.7068 11.75 113.3  -0.996
##  CCCH zero CO - CCCH zero control              -10.5331 10.78 498.4  -0.977
##  CCCH zero CO - HHCC zero control              -12.9200 11.40 103.8  -1.133
##  CCCH zero CO - CCHC zero control               -6.6163 11.61 110.8  -0.570
##  CCCH zero CO - HHHC zero control               -0.5167 12.36 111.4  -0.042
##  HHCC zero CO - CCHC zero CO                    -1.4713 11.72 118.9  -0.126
##  HHCC zero CO - HHHC zero CO                   -13.5192 12.47 122.5  -1.084
##  HHCC zero CO - CCCC elevated control          -11.4881 11.27 105.9  -1.019
##  HHCC zero CO - CCCH elevated control            5.7427 11.95 125.9   0.481
##  HHCC zero CO - HHCC elevated control          -13.3557 10.85 488.2  -1.231
##  HHCC zero CO - CCHC elevated control            0.7986 11.19 103.8   0.071
##  HHCC zero CO - HHHC elevated control          -20.1252 12.68 118.9  -1.587
##  HHCC zero CO - CCCC zero control              -11.3042 11.34 107.0  -0.997
##  HHCC zero CO - CCCH zero control              -10.1305 11.37 107.4  -0.891
##  HHCC zero CO - HHCC zero control              -12.5174  9.94 490.1  -1.259
##  HHCC zero CO - CCHC zero control               -6.2137 11.19 104.3  -0.555
##  HHCC zero CO - HHHC zero control               -0.1140 11.97 105.8  -0.010
##  CCHC zero CO - HHHC zero CO                   -12.0479 12.67 128.4  -0.951
##  CCHC zero CO - CCCC elevated control          -10.0167 11.49 112.4  -0.872
##  CCHC zero CO - CCCH elevated control            7.2140 12.15 132.4   0.594
##  CCHC zero CO - HHCC elevated control          -11.8844 12.07 129.3  -0.985
##  CCHC zero CO - CCHC elevated control            2.2699 10.40 488.1   0.218
##  CCHC zero CO - HHHC elevated control          -18.6538 12.88 125.0  -1.448
##  CCHC zero CO - CCCC zero control               -9.8329 11.56 113.6  -0.851
##  CCHC zero CO - CCCH zero control               -8.6592 11.57 113.5  -0.748
##  CCHC zero CO - HHCC zero control              -11.0461 11.19 103.4  -0.987
##  CCHC zero CO - CCHC zero control               -4.7423 10.40 488.5  -0.456
##  CCHC zero CO - HHHC zero control                1.3573 12.17 111.6   0.112
##  HHHC zero CO - CCCC elevated control            2.0312 12.26 116.8   0.166
##  HHHC zero CO - CCCH elevated control           19.2619 12.89 134.9   1.495
##  HHHC zero CO - HHCC elevated control            0.1635 12.80 131.7   0.013
##  HHHC zero CO - CCHC elevated control           14.3178 12.18 114.9   1.175
##  HHHC zero CO - HHHC elevated control           -6.6059 12.50 497.9  -0.529
##  HHHC zero CO - CCCC zero control                2.2150 12.33 118.0   0.180
##  HHHC zero CO - CCCH zero control                3.3888 12.34 118.1   0.275
##  HHHC zero CO - HHCC zero control                1.0018 11.99 108.8   0.084
##  HHHC zero CO - CCHC zero control                7.3056 12.19 115.6   0.599
##  HHHC zero CO - HHHC zero control               13.4052 11.81 491.5   1.135
##  CCCC elevated control - CCCH elevated control  17.2307 11.71 119.4   1.471
##  CCCC elevated control - HHCC elevated control  -1.8677 11.62 116.0  -0.161
##  CCCC elevated control - CCHC elevated control  12.2867 10.94  97.3   1.123
##  CCCC elevated control - HHHC elevated control  -8.6371 12.47 113.4  -0.693
##  CCCC elevated control - CCCC zero control       0.1839 10.05 487.1   0.018
##  CCCC elevated control - CCCH zero control       1.3576 11.12 101.0   0.122
##  CCCC elevated control - HHCC zero control      -1.0293 10.73  90.9  -0.096
##  CCCC elevated control - CCHC zero control       5.2744 10.94  97.7   0.482
##  CCCC elevated control - HHHC zero control      11.3740 11.74 100.1   0.969
##  CCCH elevated control - HHCC elevated control -19.0984 12.28 136.0  -1.555
##  CCCH elevated control - CCHC elevated control  -4.9441 11.64 117.3  -0.425
##  CCCH elevated control - HHHC elevated control -25.8678 13.09 130.6  -1.977
##  CCCH elevated control - CCCC zero control     -17.0469 11.78 120.4  -1.447
##  CCCH elevated control - CCCH zero control     -15.8731 10.84 493.9  -1.465
##  CCCH elevated control - HHCC zero control     -18.2601 11.43 110.7  -1.597
##  CCCH elevated control - CCHC zero control     -11.9563 11.64 117.8  -1.028
##  CCCH elevated control - HHHC zero control      -5.8567 12.39 117.8  -0.473
##  HHCC elevated control - CCHC elevated control  14.1543 11.54 113.7   1.227
##  HHCC elevated control - HHHC elevated control  -6.7694 12.99 127.3  -0.521
##  HHCC elevated control - CCCC zero control       2.0515 11.69 117.0   0.176
##  HHCC elevated control - CCCH zero control       3.2253 11.72 117.7   0.275
##  HHCC elevated control - HHCC zero control       0.8384 10.32 489.5   0.081
##  HHCC elevated control - CCHC zero control       7.1421 11.54 114.5   0.619
##  HHCC elevated control - HHHC zero control      13.2417 12.30 114.8   1.076
##  CCHC elevated control - HHHC elevated control -20.9238 12.39 111.4  -1.689
##  CCHC elevated control - CCCC zero control     -12.1028 11.02  98.4  -1.099
##  CCHC elevated control - CCCH zero control     -10.9291 11.05  99.2  -0.989
##  CCHC elevated control - HHCC zero control     -13.3160 10.66  89.1  -1.250
##  CCHC elevated control - CCHC zero control      -7.0122  9.79 482.8  -0.716
##  CCHC elevated control - HHHC zero control      -0.9126 11.66  98.2  -0.078
##  HHHC elevated control - CCCC zero control       8.8210 12.53 114.3   0.704
##  HHHC elevated control - CCCH zero control       9.9947 12.57 115.1   0.795
##  HHHC elevated control - HHCC zero control       7.6078 12.22 106.4   0.623
##  HHHC elevated control - CCHC zero control      13.9115 12.40 112.1   1.122
##  HHHC elevated control - HHHC zero control      20.0111 11.94 492.6   1.675
##  CCCC zero control - CCCH zero control           1.1737 11.19 102.2   0.105
##  CCCC zero control - HHCC zero control          -1.2132 10.80  92.2  -0.112
##  CCCC zero control - CCHC zero control           5.0906 11.01  98.8   0.462
##  CCCC zero control - HHHC zero control          11.1902 11.81 101.1   0.948
##  CCCH zero control - HHCC zero control          -2.3869 10.82  92.1  -0.221
##  CCCH zero control - CCHC zero control           3.9168 11.04  99.3   0.355
##  CCCH zero control - HHHC zero control          10.0165 11.83 101.5   0.847
##  HHCC zero control - CCHC zero control           6.3037 10.64  89.2   0.592
##  HHCC zero control - HHHC zero control          12.4034 11.46  92.5   1.083
##  CCHC zero control - HHHC zero control           6.0996 11.66  98.6   0.523
##  p.value
##   1.0000
##   1.0000
##   0.9996
##   0.9998
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9980
##   0.9961
##   1.0000
##   0.9967
##   1.0000
##   0.9449
##   0.9969
##   0.9996
##   0.9955
##   1.0000
##   1.0000
##   1.0000
##   0.9939
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9999
##   0.9999
##   1.0000
##   0.9998
##   1.0000
##   0.9855
##   1.0000
##   1.0000
##   0.9997
##   1.0000
##   1.0000
##   0.7504
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9999
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.6747
##   0.9687
##   0.9926
##   0.9866
##   0.9516
##   0.5502
##   0.4910
##   0.9999
##   0.4657
##   0.9736
##   0.2392
##   0.5140
##   0.5937
##   0.3835
##   0.6665
##   0.9904
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9990
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9965
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9999
##   1.0000
##   1.0000
##   0.9999
##   1.0000
##   0.9895
##   1.0000
##   1.0000
##   0.9998
##   1.0000
##   1.0000
##   1.0000
##   0.9999
##   1.0000
##   1.0000
##   0.9996
##   1.0000
##   0.9884
##   1.0000
##   1.0000
##   0.9995
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9960
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9943
##   1.0000
##   0.9997
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9999
##   0.9952
##   1.0000
##   0.9999
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9910
##   1.0000
##   0.9059
##   0.9960
##   0.9961
##   0.9874
##   1.0000
##   1.0000
##   0.9995
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9999
##   0.9773
##   0.9999
##   1.0000
##   0.9993
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9999
##   0.9817
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9999
##   1.0000
## 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 20 estimates
plot(emmeans(lmer.bold.RMR, pairwise ~ Parental_treatment * Temp * Control_CO2, adjust="tukey"))
## NOTE: Results may be misleading due to involvement in interactions

#for graphs
BoldRMR = (emmeans(lmer.bold.RMR, ~ Parental_treatment * Temp * Control_CO2) %>% as.data.frame) 
## NOTE: Results may be misleading due to involvement in interactions
BoldRMR 
##  Parental_treatment Temp     Control_CO2   emmean        SE    df lower.CL
##  CCCC               elevated CO          220.0250 10.577903 24.49 198.2163
##  CCCH               elevated CO          223.3951 10.365983 22.95 201.9488
##  HHCC               elevated CO          231.7067  9.820583 18.55 211.1183
##  CCHC               elevated CO          205.1264 10.464084 23.74 183.5171
##  HHHC               elevated CO          234.7151 10.685283 24.91 212.7042
##  CCCC               zero     CO          226.0693 10.137488 21.00 204.9872
##  CCCH               zero     CO          223.8522 10.490055 23.57 202.1811
##  HHCC               zero     CO          224.2549 10.033039 20.12 203.3341
##  CCHC               zero     CO          225.7262 10.267284 22.01 204.4340
##  HHHC               zero     CO          237.7741 11.124755 29.16 215.0270
##  CCCC               elevated control     235.7429  9.758533 18.10 215.2488
##  CCCH               elevated control     218.5122 10.530972 24.26 196.7895
##  HHCC               elevated control     237.6106 10.433221 23.34 216.0454
##  CCHC               elevated control     223.4563  9.672716 17.47 203.0905
##  HHHC               elevated control     244.3800 11.368758 30.91 221.1905
##  CCCC               zero     control     235.5591  9.841118 18.66 214.9356
##  CCCH               zero     control     234.3853  9.859564 18.78 213.7330
##  HHCC               zero     control     236.7723  9.411743 15.72 216.7908
##  CCHC               zero     control     230.4685  9.667406 17.47 210.1141
##  HHHC               zero     control     224.3689 10.555604 23.74 202.5708
##  upper.CL
##  241.8337
##  244.8414
##  252.2951
##  226.7358
##  256.7260
##  247.1515
##  245.5233
##  245.1756
##  247.0184
##  260.5212
##  256.2371
##  240.2349
##  259.1759
##  243.8220
##  267.5696
##  256.1825
##  255.0377
##  256.7537
##  250.8229
##  246.1670
## 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95

plot data

BoldRMR = (emmeans(lmer.bold.RMR, ~ Parental_treatment * Temp * Control_CO2) %>% as.data.frame) 
## NOTE: Results may be misleading due to involvement in interactions
BoldRMR 
##  Parental_treatment Temp     Control_CO2   emmean        SE    df lower.CL
##  CCCC               elevated CO          220.0250 10.577903 24.49 198.2163
##  CCCH               elevated CO          223.3951 10.365983 22.95 201.9488
##  HHCC               elevated CO          231.7067  9.820583 18.55 211.1183
##  CCHC               elevated CO          205.1264 10.464084 23.74 183.5171
##  HHHC               elevated CO          234.7151 10.685283 24.91 212.7042
##  CCCC               zero     CO          226.0693 10.137488 21.00 204.9872
##  CCCH               zero     CO          223.8522 10.490055 23.57 202.1811
##  HHCC               zero     CO          224.2549 10.033039 20.12 203.3341
##  CCHC               zero     CO          225.7262 10.267284 22.01 204.4340
##  HHHC               zero     CO          237.7741 11.124755 29.16 215.0270
##  CCCC               elevated control     235.7429  9.758533 18.10 215.2488
##  CCCH               elevated control     218.5122 10.530972 24.26 196.7895
##  HHCC               elevated control     237.6106 10.433221 23.34 216.0454
##  CCHC               elevated control     223.4563  9.672716 17.47 203.0905
##  HHHC               elevated control     244.3800 11.368758 30.91 221.1905
##  CCCC               zero     control     235.5591  9.841118 18.66 214.9356
##  CCCH               zero     control     234.3853  9.859564 18.78 213.7330
##  HHCC               zero     control     236.7723  9.411743 15.72 216.7908
##  CCHC               zero     control     230.4685  9.667406 17.47 210.1141
##  HHHC               zero     control     224.3689 10.555604 23.74 202.5708
##  upper.CL
##  241.8337
##  244.8414
##  252.2951
##  226.7358
##  256.7260
##  247.1515
##  245.5233
##  245.1756
##  247.0184
##  260.5212
##  256.2371
##  240.2349
##  259.1759
##  243.8220
##  267.5696
##  256.1825
##  255.0377
##  256.7537
##  250.8229
##  246.1670
## 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95
library(broom.mixed)
ab <- augment(lmer.bold.RMR)
ab
## # A tibble: 544 × 18
##      RMR Parental_treatment Temp    Control_CO2  Bold Parental_number Chamber_ID
##    <dbl> <fct>              <fct>   <fct>       <dbl> <fct>           <fct>     
##  1  216. HHHC               zero    control         4 65              A         
##  2  205. HHHC               elevat… control         4 65              D         
##  3  219. HHHC               zero    control         1 9b              D         
##  4  244. CCCC               zero    control         1 92b             C         
##  5  205. CCCH               elevat… control         1 5               B         
##  6  170. HHCC               elevat… CO              1 81              A         
##  7  251. CCCC               zero    control         1 92              C         
##  8  168. CCCH               elevat… control         2 94              A         
##  9  168. HHHC               zero    control         2 9b              B         
## 10  175. CCCC               zero    CO              2 92b             C         
## # ℹ 534 more rows
## # ℹ 11 more variables: .fitted <dbl>, .resid <dbl>, .hat <dbl>, .cooksd <dbl>,
## #   .fixed <dbl>, .mu <dbl>, .offset <dbl>, .sqrtXwt <dbl>, .sqrtrwt <dbl>,
## #   .weights <dbl>, .wtres <dbl>
ggplot(ab, aes(x=Bold, y=.fitted)) + geom_jitter(aes (x=Bold, y=.fitted),height = .2, width = .2, alpha=0.3) + theme_classic() + geom_smooth(method = lm, se=TRUE) +  theme(text = element_text(size=20))
## `geom_smooth()` using formula = 'y ~ x'

graph.1 <- ggplot(ab, aes(x=Bold, y=.fitted, colour=Control_CO2, fill= Control_CO2)) + geom_jitter(aes (x=Bold, y=.fitted, colour = Control_CO2),height = .2, width = .2, alpha=0.3) + theme_classic() + geom_smooth(method = lm, se=TRUE) + stat_regline_equation(label.y= c(300, 280), label.x= (c(1))) + stat_cor(aes(label = paste(..rr.label.., ..p.label.., sep = "~`,`~")), label.y= c(300, 280), label.x= (c(2.5))) +  scale_color_manual(values=c("control" = "black", "CO" = "tan")) + scale_fill_manual(values=c("control" = "black", "CO" = "tan")) + theme(text = element_text(size=20))


graph.2 <- ggplot(ab, aes(x=Bold, y=RMR, colour= Control_CO2, fill= Control_CO2)) + geom_jitter(aes (, colour= Control_CO2),height = .2, width = .2, alpha=0.3) + theme_classic() + geom_smooth(method = lm, se=TRUE) + facet_grid(~Parental_treatment) +  scale_color_manual(values=c("control" = "black", "CO" = "tan")) + scale_fill_manual(values=c("control" = "black", "CO" = "tan")) + theme(text = element_text(size=20))

graph.1
## `geom_smooth()` using formula = 'y ~ x'

graph.2
## `geom_smooth()` using formula = 'y ~ x'

ggsave("RMRxbold_temp.eps", graph.1, height = 6, width = 10, dpi = 320)
## `geom_smooth()` using formula = 'y ~ x'
## Warning in grid.Call.graphics(C_points, x$x, x$y, x$pch, x$size):
## semi-transparency is not supported on this device: reported only once per page
ggsave("RMRxbold_temp.2.eps", graph.2, height = 6, width = 10, dpi = 320)
## `geom_smooth()` using formula = 'y ~ x'
## Warning in grid.Call.graphics(C_points, x$x, x$y, x$pch, x$size):
## semi-transparency is not supported on this device: reported only once per page
ggsave("RMRxbold_temp.png", graph.1, height = 6, width = 10, dpi = 320)
## `geom_smooth()` using formula = 'y ~ x'
ggsave("RMRxbold_temp.2.png", graph.2, height = 6, width = 10, dpi = 320)
## `geom_smooth()` using formula = 'y ~ x'

AS model

### plot data
ggplot(Behaviour_and_resp, aes(x=Bold, y=AS, colour=Parental_treatment)) + theme_classic() + geom_smooth(method = lm) +  facet_grid(~Juv_treat)
## `geom_smooth()` using formula = 'y ~ x'

### **AS model** 
lmer.bold.AS = lmer(AS ~ Parental_treatment * Temp * Control_CO2  * Bold  + (1 | Parental_number) +  (1 | Chamber_ID), data = Behaviour_and_resp)

model analysis

summary(lmer.bold.AS)
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: 
## AS ~ Parental_treatment * Temp * Control_CO2 * Bold + (1 | Parental_number) +  
##     (1 | Chamber_ID)
##    Data: Behaviour_and_resp
## 
## REML criterion at convergence: 6453.9
## 
## Scaled residuals: 
##      Min       1Q   Median       3Q      Max 
## -2.07859 -0.66859 -0.08868  0.58651  2.89525 
## 
## Random effects:
##  Groups          Name        Variance Std.Dev.
##  Parental_number (Intercept)   607.5   24.65  
##  Chamber_ID      (Intercept)  4854.4   69.67  
##  Residual                    15622.7  124.99  
## Number of obs: 544, groups:  Parental_number, 24; Chamber_ID, 4
## 
## Fixed effects:
##                                                         Estimate Std. Error
## (Intercept)                                               721.05     103.78
## Parental_treatmentCCCH                                   -189.08     126.85
## Parental_treatmentHHCC                                   -192.03     120.02
## Parental_treatmentCCHC                                   -160.15     123.08
## Parental_treatmentHHHC                                   -249.90     132.73
## Tempzero                                                 -373.27     130.49
## Control_CO2control                                       -312.68     122.41
## Bold                                                      -63.85      27.72
## Parental_treatmentCCCH:Tempzero                           221.24     169.61
## Parental_treatmentHHCC:Tempzero                           357.57     178.83
## Parental_treatmentCCHC:Tempzero                           292.42     166.71
## Parental_treatmentHHHC:Tempzero                           333.35     175.10
## Parental_treatmentCCCH:Control_CO2control                 203.98     162.21
## Parental_treatmentHHCC:Control_CO2control                 462.56     168.35
## Parental_treatmentCCHC:Control_CO2control                 202.96     154.72
## Parental_treatmentHHHC:Control_CO2control                 402.91     176.87
## Tempzero:Control_CO2control                               379.24     166.33
## Parental_treatmentCCCH:Bold                                44.32      35.30
## Parental_treatmentHHCC:Bold                                42.77      33.73
## Parental_treatmentCCHC:Bold                                35.37      34.58
## Parental_treatmentHHHC:Bold                                49.66      37.77
## Tempzero:Bold                                              85.41      38.17
## Control_CO2control:Bold                                    66.14      35.49
## Parental_treatmentCCCH:Tempzero:Control_CO2control       -159.64     218.14
## Parental_treatmentHHCC:Tempzero:Control_CO2control       -676.38     237.55
## Parental_treatmentCCHC:Tempzero:Control_CO2control       -346.56     216.61
## Parental_treatmentHHHC:Tempzero:Control_CO2control       -486.51     232.45
## Parental_treatmentCCCH:Tempzero:Bold                      -48.82      49.65
## Parental_treatmentHHCC:Tempzero:Bold                      -86.54      51.69
## Parental_treatmentCCHC:Tempzero:Bold                      -61.45      48.58
## Parental_treatmentHHHC:Tempzero:Bold                      -72.15      52.55
## Parental_treatmentCCCH:Control_CO2control:Bold            -38.97      46.32
## Parental_treatmentHHCC:Control_CO2control:Bold           -104.00      47.19
## Parental_treatmentCCHC:Control_CO2control:Bold            -42.30      44.60
## Parental_treatmentHHHC:Control_CO2control:Bold            -63.35      51.79
## Tempzero:Control_CO2control:Bold                          -89.49      50.08
## Parental_treatmentCCCH:Tempzero:Control_CO2control:Bold    36.49      65.67
## Parental_treatmentHHCC:Tempzero:Control_CO2control:Bold   174.09      69.41
## Parental_treatmentCCHC:Tempzero:Control_CO2control:Bold    74.86      64.60
## Parental_treatmentHHHC:Tempzero:Control_CO2control:Bold    84.49      70.54
##                                                              df t value
## (Intercept)                                              161.74   6.948
## Parental_treatmentCCCH                                   456.41  -1.491
## Parental_treatmentHHCC                                   466.47  -1.600
## Parental_treatmentCCHC                                   473.45  -1.301
## Parental_treatmentHHHC                                   461.82  -1.883
## Tempzero                                                 490.65  -2.861
## Control_CO2control                                       499.85  -2.554
## Bold                                                     487.78  -2.303
## Parental_treatmentCCCH:Tempzero                          493.95   1.304
## Parental_treatmentHHCC:Tempzero                          501.06   1.999
## Parental_treatmentCCHC:Tempzero                          500.25   1.754
## Parental_treatmentHHHC:Tempzero                          501.01   1.904
## Parental_treatmentCCCH:Control_CO2control                499.88   1.258
## Parental_treatmentHHCC:Control_CO2control                500.88   2.748
## Parental_treatmentCCHC:Control_CO2control                500.37   1.312
## Parental_treatmentHHHC:Control_CO2control                490.86   2.278
## Tempzero:Control_CO2control                              500.86   2.280
## Parental_treatmentCCCH:Bold                              486.40   1.255
## Parental_treatmentHHCC:Bold                              497.21   1.268
## Parental_treatmentCCHC:Bold                              496.82   1.023
## Parental_treatmentHHHC:Bold                              494.50   1.315
## Tempzero:Bold                                            496.07   2.237
## Control_CO2control:Bold                                  495.40   1.864
## Parental_treatmentCCCH:Tempzero:Control_CO2control       500.91  -0.732
## Parental_treatmentHHCC:Tempzero:Control_CO2control       500.83  -2.847
## Parental_treatmentCCHC:Tempzero:Control_CO2control       500.94  -1.600
## Parental_treatmentHHHC:Tempzero:Control_CO2control       500.62  -2.093
## Parental_treatmentCCCH:Tempzero:Bold                     499.60  -0.983
## Parental_treatmentHHCC:Tempzero:Bold                     501.04  -1.674
## Parental_treatmentCCHC:Tempzero:Bold                     500.92  -1.265
## Parental_treatmentHHHC:Tempzero:Bold                     500.29  -1.373
## Parental_treatmentCCCH:Control_CO2control:Bold           496.38  -0.841
## Parental_treatmentHHCC:Control_CO2control:Bold           499.68  -2.204
## Parental_treatmentCCHC:Control_CO2control:Bold           501.11  -0.948
## Parental_treatmentHHHC:Control_CO2control:Bold           481.24  -1.223
## Tempzero:Control_CO2control:Bold                         500.97  -1.787
## Parental_treatmentCCCH:Tempzero:Control_CO2control:Bold  501.05   0.556
## Parental_treatmentHHCC:Tempzero:Control_CO2control:Bold  500.95   2.508
## Parental_treatmentCCHC:Tempzero:Control_CO2control:Bold  500.66   1.159
## Parental_treatmentHHHC:Tempzero:Control_CO2control:Bold  500.02   1.198
##                                                         Pr(>|t|)    
## (Intercept)                                              8.6e-11 ***
## Parental_treatmentCCCH                                   0.13677    
## Parental_treatmentHHCC                                   0.11029    
## Parental_treatmentCCHC                                   0.19381    
## Parental_treatmentHHHC                                   0.06036 .  
## Tempzero                                                 0.00441 ** 
## Control_CO2control                                       0.01094 *  
## Bold                                                     0.02169 *  
## Parental_treatmentCCCH:Tempzero                          0.19271    
## Parental_treatmentHHCC:Tempzero                          0.04610 *  
## Parental_treatmentCCHC:Tempzero                          0.08004 .  
## Parental_treatmentHHHC:Tempzero                          0.05751 .  
## Parental_treatmentCCCH:Control_CO2control                0.20916    
## Parental_treatmentHHCC:Control_CO2control                0.00622 ** 
## Parental_treatmentCCHC:Control_CO2control                0.19022    
## Parental_treatmentHHHC:Control_CO2control                0.02315 *  
## Tempzero:Control_CO2control                              0.02303 *  
## Parental_treatmentCCCH:Bold                              0.20993    
## Parental_treatmentHHCC:Bold                              0.20540    
## Parental_treatmentCCHC:Bold                              0.30699    
## Parental_treatmentHHHC:Bold                              0.18926    
## Tempzero:Bold                                            0.02570 *  
## Control_CO2control:Bold                                  0.06293 .  
## Parental_treatmentCCCH:Tempzero:Control_CO2control       0.46462    
## Parental_treatmentHHCC:Tempzero:Control_CO2control       0.00459 ** 
## Parental_treatmentCCHC:Tempzero:Control_CO2control       0.11025    
## Parental_treatmentHHHC:Tempzero:Control_CO2control       0.03686 *  
## Parental_treatmentCCCH:Tempzero:Bold                     0.32589    
## Parental_treatmentHHCC:Tempzero:Bold                     0.09475 .  
## Parental_treatmentCCHC:Tempzero:Bold                     0.20643    
## Parental_treatmentHHHC:Tempzero:Bold                     0.17036    
## Parental_treatmentCCCH:Control_CO2control:Bold           0.40054    
## Parental_treatmentHHCC:Control_CO2control:Bold           0.02801 *  
## Parental_treatmentCCHC:Control_CO2control:Bold           0.34336    
## Parental_treatmentHHHC:Control_CO2control:Bold           0.22184    
## Tempzero:Control_CO2control:Bold                         0.07456 .  
## Parental_treatmentCCCH:Tempzero:Control_CO2control:Bold  0.57862    
## Parental_treatmentHHCC:Tempzero:Control_CO2control:Bold  0.01245 *  
## Parental_treatmentCCHC:Tempzero:Control_CO2control:Bold  0.24714    
## Parental_treatmentHHHC:Tempzero:Control_CO2control:Bold  0.23160    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation matrix not shown by default, as p = 40 > 12.
## Use print(x, correlation=TRUE)  or
##     vcov(x)        if you need it
Anova(lmer.bold.AS)
## Analysis of Deviance Table (Type II Wald chisquare tests)
## 
## Response: AS
##                                            Chisq Df Pr(>Chisq)   
## Parental_treatment                        1.0702  4   0.898963   
## Temp                                      6.7119  1   0.009577 **
## Control_CO2                               0.5300  1   0.466606   
## Bold                                      2.4494  1   0.117570   
## Parental_treatment:Temp                   2.9648  4   0.563731   
## Parental_treatment:Control_CO2            8.2652  4   0.082333 . 
## Temp:Control_CO2                          0.0454  1   0.831244   
## Parental_treatment:Bold                   0.6814  4   0.953599   
## Temp:Bold                                 4.2750  1   0.038677 * 
## Control_CO2:Bold                          0.5978  1   0.439432   
## Parental_treatment:Temp:Control_CO2      10.1758  4   0.037569 * 
## Parental_treatment:Temp:Bold              1.8354  4   0.765999   
## Parental_treatment:Control_CO2:Bold       0.8542  4   0.931038   
## Temp:Control_CO2:Bold                     0.6545  1   0.418494   
## Parental_treatment:Temp:Control_CO2:Bold  7.3474  4   0.118632   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

post model checks

performance::check_model(lmer.bold.AS, check="homogeneity") 
## Model has interaction terms. VIFs might be inflated.
##   You may check multicollinearity among predictors of a model without
##   interaction terms.

performance::check_model(lmer.bold.AS, check="outliers") 
## Model has interaction terms. VIFs might be inflated.
##   You may check multicollinearity among predictors of a model without
##   interaction terms.

performance::check_model(lmer.bold.AS, check="qq") 
## Model has interaction terms. VIFs might be inflated.
##   You may check multicollinearity among predictors of a model without
##   interaction terms.

performance::check_model(lmer.bold.AS, check="normality") 
## Model has interaction terms. VIFs might be inflated.
##   You may check multicollinearity among predictors of a model without
##   interaction terms.

performance::check_model(lmer.bold.AS, check="linearity") 
## Model has interaction terms. VIFs might be inflated.
##   You may check multicollinearity among predictors of a model without
##   interaction terms.

performance::check_model(lmer.bold.AS, check="pp_check")
## Model has interaction terms. VIFs might be inflated.
##   You may check multicollinearity among predictors of a model without
##   interaction terms.

#Homogeneity
plot(lmer.bold.AS)

#normality
hist(residuals(lmer.bold.AS), col="darkgray")

shapiro.test(residuals(lmer.bold.AS))
## 
##  Shapiro-Wilk normality test
## 
## data:  residuals(lmer.bold.AS)
## W = 0.98574, p-value = 3.638e-05
qqnorm(resid(lmer.bold.AS))
qqline(resid(lmer.bold.AS))

#model fit
library(sjPlot)
plot_model(lmer.bold.AS, type = "diag")
## [[1]]
## `geom_smooth()` using formula = 'y ~ x'

## 
## [[2]]
## [[2]]$Parental_number
## `geom_smooth()` using formula = 'y ~ x'

## 
## [[2]]$Chamber_ID
## `geom_smooth()` using formula = 'y ~ x'

## 
## 
## [[3]]

## 
## [[4]]
## `geom_smooth()` using formula = 'y ~ x'

#outlier test
outlierTest(lmer.bold.AS)
## No Studentized residuals with Bonferroni p < 0.05
## Largest |rstudent|:
##     rstudent unadjusted p-value Bonferroni p
## 189 3.057359          0.0023525           NA
library(DHARMa)
plot(simulateResiduals(lmer.bold.AS))

emmeans(lmer.bold.AS, pairwise ~ Temp, adjust="tukey") 
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Temp     emmean   SE   df lower.CL upper.CL
##  elevated    467 36.1 3.30      357      576
##  zero        432 36.0 3.27      323      542
## 
## Results are averaged over the levels of: Parental_treatment, Control_CO2 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast        estimate   SE  df t.ratio p.value
##  elevated - zero       34 11.2 492   3.034  0.0025
## 
## Results are averaged over the levels of: Parental_treatment, Control_CO2 
## Degrees-of-freedom method: kenward-roger
plot(emmeans(lmer.bold.AS, pairwise ~ Temp, adjust="tukey"))
## NOTE: Results may be misleading due to involvement in interactions

emmeans(lmer.bold.AS, pairwise ~ Parental_treatment * Temp * Control_CO2, adjust="tukey") 
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
##  Parental_treatment Temp     Control_CO2 emmean   SE   df lower.CL upper.CL
##  CCCC               elevated CO             519 45.2 7.94      415      623
##  CCCH               elevated CO             470 44.6 7.61      366      574
##  HHCC               elevated CO             462 43.3 6.75      359      565
##  CCHC               elevated CO             471 44.9 7.77      367      575
##  HHHC               elevated CO             426 45.4 8.14      322      531
##  CCCC               zero     CO             416 44.1 7.24      313      520
##  CCCH               zero     CO             434 44.9 7.78      330      538
##  HHCC               zero     CO             443 43.8 7.07      340      546
##  CCHC               zero     CO             466 44.4 7.44      362      569
##  HHHC               zero     CO             428 46.5 8.95      323      534
##  CCCC               elevated control        416 43.2 6.66      313      519
##  CCCH               elevated control        447 45.0 7.87      343      552
##  HHCC               elevated control        492 44.8 7.70      388      596
##  CCHC               elevated control        436 42.9 6.53      333      540
##  HHHC               elevated control        525 47.2 9.37      419      631
##  CCCC               zero     control        409 43.4 6.78      305      512
##  CCCH               zero     control        463 43.4 6.80      360      566
##  HHCC               zero     control        444 42.3 6.17      341      547
##  CCHC               zero     control        418 42.9 6.53      315      521
##  HHHC               zero     control        404 45.1 7.91      300      508
## 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
##  contrast                                      estimate   SE    df t.ratio
##  CCCC elevated CO - CCCH elevated CO             48.716 40.0 131.9   1.218
##  CCCC elevated CO - HHCC elevated CO             56.557 38.6 116.4   1.467
##  CCCC elevated CO - CCHC elevated CO             48.142 40.3 133.4   1.196
##  CCCC elevated CO - HHHC elevated CO             92.617 40.9 116.7   2.265
##  CCCC elevated CO - CCCC zero CO                102.747 36.2 497.9   2.835
##  CCCC elevated CO - CCCH zero CO                 84.855 40.4 126.1   2.103
##  CCCC elevated CO - HHCC zero CO                 75.814 39.1 120.7   1.938
##  CCCC elevated CO - CCHC zero CO                 53.100 39.8 126.9   1.335
##  CCCC elevated CO - HHHC zero CO                 90.539 42.2 129.5   2.148
##  CCCC elevated CO - CCCC elevated control       103.196 34.9 489.7   2.960
##  CCCC elevated CO - CCCH elevated control        71.360 40.5 133.5   1.763
##  CCCC elevated CO - HHCC elevated control        26.587 40.2 130.2   0.662
##  CCCC elevated CO - CCHC elevated control        82.367 38.1 112.2   2.160
##  CCCC elevated CO - HHHC elevated control        -6.456 42.8 125.7  -0.151
##  CCCC elevated CO - CCCC zero control           110.150 35.1 489.7   3.139
##  CCCC elevated CO - CCCH zero control            55.756 38.7 115.9   1.442
##  CCCC elevated CO - HHCC zero control            75.036 37.5 106.2   2.002
##  CCCC elevated CO - CCHC zero control           101.002 38.1 112.9   2.648
##  CCCC elevated CO - HHHC zero control           114.580 40.6 113.2   2.824
##  CCCH elevated CO - HHCC elevated CO              7.841 37.9 116.9   0.207
##  CCCH elevated CO - CCHC elevated CO             -0.574 39.6 134.5  -0.014
##  CCCH elevated CO - HHHC elevated CO             43.901 40.3 117.4   1.089
##  CCCH elevated CO - CCCC zero CO                 54.032 38.8 125.5   1.392
##  CCCH elevated CO - CCCH zero CO                 36.139 36.7 500.7   0.983
##  CCCH elevated CO - HHCC zero CO                 27.098 38.5 121.2   0.704
##  CCCH elevated CO - CCHC zero CO                  4.385 39.2 128.1   0.112
##  CCCH elevated CO - HHHC zero CO                 41.823 41.6 130.1   1.006
##  CCCH elevated CO - CCCC elevated control        54.480 37.7 114.8   1.444
##  CCCH elevated CO - CCCH elevated control        22.645 36.8 493.5   0.616
##  CCCH elevated CO - HHCC elevated control       -22.129 39.6 131.1  -0.559
##  CCCH elevated CO - CCHC elevated control        33.651 37.5 112.5   0.898
##  CCCH elevated CO - HHHC elevated control       -55.172 42.2 126.2  -1.307
##  CCCH elevated CO - CCCC zero control            61.434 38.0 115.9   1.618
##  CCCH elevated CO - CCCH zero control             7.040 34.7 490.0   0.203
##  CCCH elevated CO - HHCC zero control            26.320 36.9 106.6   0.714
##  CCCH elevated CO - CCHC zero control            52.286 37.5 113.3   1.395
##  CCCH elevated CO - HHHC zero control            65.865 40.0 113.5   1.648
##  HHCC elevated CO - CCHC elevated CO             -8.415 38.2 118.5  -0.220
##  HHCC elevated CO - HHHC elevated CO             36.060 38.9 103.1   0.928
##  HHCC elevated CO - CCCC zero CO                 46.190 37.3 108.9   1.239
##  HHCC elevated CO - CCCH zero CO                 28.297 38.3 111.2   0.739
##  HHCC elevated CO - HHCC zero CO                 19.257 33.4 485.7   0.576
##  HHCC elevated CO - CCHC zero CO                 -3.457 37.7 111.5  -0.092
##  HHCC elevated CO - HHHC zero CO                 33.981 40.1 115.2   0.847
##  HHCC elevated CO - CCCC elevated control        46.639 36.2  99.1   1.288
##  HHCC elevated CO - CCCH elevated control        14.803 38.4 118.8   0.385
##  HHCC elevated CO - HHCC elevated control       -29.971 34.8 490.7  -0.862
##  HHCC elevated CO - CCHC elevated control        25.810 36.0  97.1   0.718
##  HHCC elevated CO - HHHC elevated control       -63.014 40.9 113.0  -1.542
##  HHCC elevated CO - CCCC zero control            53.593 36.5 100.5   1.470
##  HHCC elevated CO - CCCH zero control            -0.801 36.5 100.5  -0.022
##  HHCC elevated CO - HHCC zero control            18.479 31.6 485.5   0.586
##  HHCC elevated CO - CCHC zero control            44.445 36.0  97.7   1.236
##  HHCC elevated CO - HHHC zero control            58.023 38.5  99.5   1.507
##  CCHC elevated CO - HHHC elevated CO             44.475 40.6 118.7   1.096
##  CCHC elevated CO - CCCC zero CO                 54.605 39.1 127.1   1.397
##  CCHC elevated CO - CCCH zero CO                 36.712 40.0 128.4   0.918
##  CCHC elevated CO - HHCC zero CO                 27.672 38.8 123.0   0.714
##  CCHC elevated CO - CCHC zero CO                  4.958 36.3 493.4   0.137
##  CCHC elevated CO - HHHC zero CO                 42.396 41.8 131.5   1.014
##  CCHC elevated CO - CCCC elevated control        55.054 38.0 116.6   1.448
##  CCHC elevated CO - CCCH elevated control        23.218 40.2 136.5   0.578
##  CCHC elevated CO - HHCC elevated control       -21.556 39.8 132.8  -0.541
##  CCHC elevated CO - CCHC elevated control        34.225 34.3 486.4   0.997
##  CCHC elevated CO - HHHC elevated control       -54.599 42.5 127.7  -1.286
##  CCHC elevated CO - CCCC zero control            62.008 38.2 117.7   1.621
##  CCHC elevated CO - CCCH zero control             7.614 38.3 118.4   0.199
##  CCHC elevated CO - HHCC zero control            26.894 37.2 108.4   0.724
##  CCHC elevated CO - CCHC zero control            52.860 34.4 486.7   1.536
##  CCHC elevated CO - HHHC zero control            66.438 40.2 115.1   1.651
##  HHHC elevated CO - CCCC zero CO                 10.130 39.7 110.5   0.255
##  HHHC elevated CO - CCCH zero CO                 -7.762 40.6 112.4  -0.191
##  HHHC elevated CO - HHCC zero CO                -16.803 39.5 107.3  -0.426
##  HHHC elevated CO - CCHC zero CO                -39.517 40.1 112.8  -0.986
##  HHHC elevated CO - HHHC zero CO                 -2.078 38.7 490.7  -0.054
##  HHHC elevated CO - CCCC elevated control        10.579 38.7 101.7   0.273
##  HHHC elevated CO - CCCH elevated control       -21.257 40.8 119.0  -0.521
##  HHHC elevated CO - HHCC elevated control       -66.030 40.5 116.1  -1.630
##  HHHC elevated CO - CCHC elevated control       -10.250 38.5  99.8  -0.266
##  HHHC elevated CO - HHHC elevated control       -99.073 39.3 494.4  -2.524
##  HHHC elevated CO - CCCC zero control            17.533 38.9 102.8   0.450
##  HHHC elevated CO - CCCH zero control           -36.861 39.0 103.0  -0.945
##  HHHC elevated CO - HHCC zero control           -17.581 37.8  94.2  -0.465
##  HHHC elevated CO - CCHC zero control             8.385 38.5 100.4   0.218
##  HHHC elevated CO - HHHC zero control            21.963 36.9 487.0   0.594
##  CCCC zero CO - CCCH zero CO                    -17.893 39.2 119.5  -0.457
##  CCCC zero CO - HHCC zero CO                    -26.933 37.9 113.7  -0.711
##  CCCC zero CO - CCHC zero CO                    -49.647 38.5 119.7  -1.289
##  CCCC zero CO - HHHC zero CO                    -12.209 41.0 123.0  -0.298
##  CCCC zero CO - CCCC elevated control             0.449 33.7 490.2   0.013
##  CCCC zero CO - CCCH elevated control           -31.387 39.3 127.0  -0.799
##  CCCC zero CO - HHCC elevated control           -76.161 39.0 123.8  -1.952
##  CCCC zero CO - CCHC elevated control           -20.380 36.9 105.4  -0.553
##  CCCC zero CO - HHHC elevated control          -109.204 41.7 120.2  -2.619
##  CCCC zero CO - CCCC zero control                 7.403 34.0 492.6   0.218
##  CCCC zero CO - CCCH zero control               -46.991 37.4 108.5  -1.257
##  CCCC zero CO - HHCC zero control               -27.711 36.1  98.5  -0.767
##  CCCC zero CO - CCHC zero control                -1.745 36.9 105.8  -0.047
##  CCCC zero CO - HHHC zero control                11.833 39.4 106.8   0.301
##  CCCH zero CO - HHCC zero CO                     -9.041 38.9 115.9  -0.233
##  CCCH zero CO - CCHC zero CO                    -31.754 39.5 122.1  -0.803
##  CCCH zero CO - HHHC zero CO                      5.684 41.9 124.5   0.136
##  CCCH zero CO - CCCC elevated control            18.341 38.1 109.8   0.481
##  CCCH zero CO - CCCH elevated control           -13.494 37.1 498.8  -0.364
##  CCCH zero CO - HHCC elevated control           -58.268 39.9 125.4  -1.459
##  CCCH zero CO - CCHC elevated control            -2.488 37.9 107.7  -0.066
##  CCCH zero CO - HHHC elevated control           -91.311 42.6 121.5  -2.146
##  CCCH zero CO - CCCC zero control                25.296 38.4 111.0   0.659
##  CCCH zero CO - CCCH zero control               -29.098 35.0 498.1  -0.831
##  CCCH zero CO - HHCC zero control                -9.818 37.2 101.7  -0.264
##  CCCH zero CO - CCHC zero control                16.148 37.9 108.5   0.426
##  CCCH zero CO - HHHC zero control                29.726 40.3 109.0   0.737
##  HHCC zero CO - CCHC zero CO                    -22.714 38.2 116.3  -0.594
##  HHCC zero CO - HHHC zero CO                     14.725 40.7 119.7   0.362
##  HHCC zero CO - CCCC elevated control            27.382 36.8 103.5   0.744
##  HHCC zero CO - CCCH elevated control            -4.454 39.0 123.1  -0.114
##  HHCC zero CO - HHCC elevated control           -49.227 35.2 488.0  -1.397
##  HHCC zero CO - CCHC elevated control             6.553 36.5 101.4   0.179
##  HHCC zero CO - HHHC elevated control           -82.270 41.4 116.5  -1.988
##  HHCC zero CO - CCCC zero control                34.336 37.0 104.6   0.927
##  HHCC zero CO - CCCH zero control               -20.058 37.1 105.1  -0.541
##  HHCC zero CO - HHCC zero control                -0.778 32.3 489.9  -0.024
##  HHCC zero CO - CCHC zero control                25.188 36.5 101.9   0.689
##  HHCC zero CO - HHHC zero control                38.766 39.1 103.4   0.992
##  CCHC zero CO - HHHC zero CO                     37.438 41.3 125.4   0.906
##  CCHC zero CO - CCCC elevated control            50.096 37.5 109.9   1.336
##  CCHC zero CO - CCCH elevated control            18.260 39.6 129.4   0.461
##  CCHC zero CO - HHCC elevated control           -26.514 39.4 126.4  -0.673
##  CCHC zero CO - CCHC elevated control            29.267 33.8 487.8   0.866
##  CCHC zero CO - HHHC elevated control           -59.557 42.0 122.5  -1.417
##  CCHC zero CO - CCCC zero control                57.050 37.7 111.1   1.513
##  CCHC zero CO - CCCH zero control                 2.656 37.8 111.0   0.070
##  CCHC zero CO - HHCC zero control                21.936 36.5 101.0   0.600
##  CCHC zero CO - CCHC zero control                47.902 33.8 488.3   1.418
##  CCHC zero CO - HHHC zero control                61.480 39.7 109.1   1.548
##  HHHC zero CO - CCCC elevated control            12.657 40.0 114.1   0.316
##  HHHC zero CO - CCCH elevated control           -19.178 42.0 131.8  -0.456
##  HHHC zero CO - HHCC elevated control           -63.952 41.7 128.7  -1.532
##  HHHC zero CO - CCHC elevated control            -8.172 39.8 112.2  -0.206
##  HHHC zero CO - HHHC elevated control           -96.995 40.6 497.6  -2.388
##  HHHC zero CO - CCCC zero control                19.612 40.2 115.3   0.487
##  HHHC zero CO - CCCH zero control               -34.782 40.3 115.3  -0.864
##  HHHC zero CO - HHCC zero control               -15.502 39.1 106.3  -0.396
##  HHHC zero CO - CCHC zero control                10.464 39.8 112.9   0.263
##  HHHC zero CO - HHHC zero control                24.042 38.4 491.2   0.627
##  CCCC elevated control - CCCH elevated control  -31.836 38.2 116.7  -0.833
##  CCCC elevated control - HHCC elevated control  -76.609 37.9 113.4  -2.020
##  CCCC elevated control - CCHC elevated control  -20.829 35.7  95.1  -0.583
##  CCCC elevated control - HHHC elevated control -109.652 40.7 111.1  -2.694
##  CCCC elevated control - CCCC zero control        6.954 32.6 486.9   0.213
##  CCCC elevated control - CCCH zero control      -47.440 36.3  98.7  -1.306
##  CCCC elevated control - HHCC zero control      -28.160 35.0  88.8  -0.804
##  CCCC elevated control - CCHC zero control       -2.194 35.7  95.5  -0.061
##  CCCC elevated control - HHHC zero control       11.384 38.3  97.8   0.297
##  CCCH elevated control - HHCC elevated control  -44.774 40.1 133.0  -1.118
##  CCCH elevated control - CCHC elevated control   11.007 38.0 114.7   0.290
##  CCCH elevated control - HHHC elevated control  -77.817 42.7 128.0  -1.823
##  CCCH elevated control - CCCC zero control       38.790 38.4 117.7   1.009
##  CCCH elevated control - CCCH zero control      -15.604 35.2 493.7  -0.443
##  CCCH elevated control - HHCC zero control        3.676 37.3 108.2   0.098
##  CCCH elevated control - CCHC zero control       29.642 38.0 115.1   0.781
##  CCCH elevated control - HHHC zero control       43.220 40.4 115.1   1.069
##  HHCC elevated control - CCHC elevated control   55.780 37.7 111.1   1.481
##  HHCC elevated control - HHHC elevated control  -33.043 42.4 124.8  -0.780
##  HHCC elevated control - CCCC zero control       83.564 38.1 114.4   2.190
##  HHCC elevated control - CCCH zero control       29.170 38.3 115.2   0.762
##  HHCC elevated control - HHCC zero control       48.450 33.5 489.1   1.444
##  HHCC elevated control - CCHC zero control       74.416 37.7 111.9   1.975
##  HHCC elevated control - HHHC zero control       87.994 40.2 112.2   2.191
##  CCHC elevated control - HHHC elevated control  -88.823 40.4 109.1  -2.197
##  CCHC elevated control - CCCC zero control       27.783 36.0  96.2   0.772
##  CCHC elevated control - CCCH zero control      -26.611 36.1  97.0  -0.737
##  CCHC elevated control - HHCC zero control       -7.331 34.8  87.1  -0.211
##  CCHC elevated control - CCHC zero control       18.635 31.8 482.7   0.586
##  CCHC elevated control - HHHC zero control       32.214 38.1  96.0   0.846
##  HHHC elevated control - CCCC zero control      116.607 40.9 112.0   2.850
##  HHHC elevated control - CCCH zero control       62.213 41.0 112.8   1.517
##  HHHC elevated control - HHCC zero control       81.493 39.9 104.3   2.043
##  HHHC elevated control - CCHC zero control      107.459 40.5 109.8   2.655
##  HHHC elevated control - HHHC zero control      121.037 38.8 492.3   3.119
##  CCCC zero control - CCCH zero control          -54.394 36.5  99.9  -1.488
##  CCCC zero control - HHCC zero control          -35.114 35.3  90.1  -0.995
##  CCCC zero control - CCHC zero control           -9.148 36.0  96.5  -0.254
##  CCCC zero control - HHHC zero control            4.430 38.6  98.8   0.115
##  CCCH zero control - HHCC zero control           19.280 35.3  90.0   0.546
##  CCCH zero control - CCHC zero control           45.246 36.1  97.1   1.255
##  CCCH zero control - HHHC zero control           58.824 38.6  99.2   1.523
##  HHCC zero control - CCHC zero control           25.966 34.8  87.2   0.747
##  HHCC zero control - HHHC zero control           39.544 37.4  90.4   1.057
##  CCHC zero control - HHHC zero control           13.578 38.1  96.3   0.357
##  p.value
##   0.9996
##   0.9953
##   0.9997
##   0.7539
##   0.3351
##   0.8492
##   0.9196
##   0.9986
##   0.8252
##   0.2584
##   0.9661
##   1.0000
##   0.8173
##   1.0000
##   0.1688
##   0.9962
##   0.8943
##   0.4761
##   0.3544
##   1.0000
##   1.0000
##   0.9999
##   0.9976
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9961
##   1.0000
##   1.0000
##   1.0000
##   0.9989
##   0.9856
##   1.0000
##   1.0000
##   0.9974
##   0.9825
##   1.0000
##   1.0000
##   0.9994
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9990
##   1.0000
##   1.0000
##   1.0000
##   0.9915
##   0.9950
##   1.0000
##   1.0000
##   0.9994
##   0.9933
##   0.9999
##   0.9975
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9960
##   1.0000
##   1.0000
##   1.0000
##   0.9991
##   0.9854
##   1.0000
##   1.0000
##   0.9931
##   0.9822
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9845
##   1.0000
##   0.5660
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9991
##   1.0000
##   1.0000
##   1.0000
##   0.9146
##   1.0000
##   0.4975
##   1.0000
##   0.9993
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9957
##   1.0000
##   0.8260
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9979
##   1.0000
##   0.9008
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9985
##   1.0000
##   1.0000
##   1.0000
##   0.9969
##   0.9932
##   1.0000
##   1.0000
##   0.9974
##   0.9911
##   1.0000
##   1.0000
##   0.9923
##   1.0000
##   0.6698
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.8874
##   1.0000
##   0.4431
##   1.0000
##   0.9988
##   1.0000
##   1.0000
##   1.0000
##   0.9999
##   1.0000
##   0.9533
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9999
##   0.9946
##   1.0000
##   0.7999
##   1.0000
##   0.9967
##   0.9055
##   0.7992
##   0.7956
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.3375
##   0.9930
##   0.8764
##   0.4714
##   0.1777
##   0.9942
##   1.0000
##   1.0000
##   1.0000
##   1.0000
##   0.9993
##   0.9924
##   1.0000
##   0.9999
##   1.0000
## 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 20 estimates
plot(emmeans(lmer.bold.AS, pairwise ~ Parental_treatment * Temp * Control_CO2, adjust="tukey"))
## NOTE: Results may be misleading due to involvement in interactions

plot data

library(broom.mixed)
aa <- augment(lmer.bold.AS)
aa
## # A tibble: 544 × 18
##       AS Parental_treatment Temp    Control_CO2  Bold Parental_number Chamber_ID
##    <dbl> <fct>              <fct>   <fct>       <dbl> <fct>           <fct>     
##  1  376. HHHC               zero    control         4 65              A         
##  2  307. HHHC               elevat… control         4 65              D         
##  3  309. HHHC               zero    control         1 9b              D         
##  4  475. CCCC               zero    control         1 92b             C         
##  5  380. CCCH               elevat… control         1 5               B         
##  6  654. HHCC               elevat… CO              1 81              A         
##  7  434. CCCC               zero    control         1 92              C         
##  8  812. CCCH               elevat… control         2 94              A         
##  9  440. HHHC               zero    control         2 9b              B         
## 10  366. CCCC               zero    CO              2 92b             C         
## # ℹ 534 more rows
## # ℹ 11 more variables: .fitted <dbl>, .resid <dbl>, .hat <dbl>, .cooksd <dbl>,
## #   .fixed <dbl>, .mu <dbl>, .offset <dbl>, .sqrtXwt <dbl>, .sqrtrwt <dbl>,
## #   .weights <dbl>, .wtres <dbl>
graph.b <- ggplot(aa, aes(x=Bold, y=.fitted)) + geom_jitter(aes (x=Bold, y=.fitted),height = .2, width = .2, alpha=0.3) + theme_classic() + geom_smooth(method = lm, se=TRUE) +  stat_regline_equation(label.y= c(750), label.x= (c(1))) +stat_cor(aes(label = paste(..rr.label.., ..p.label.., sep = "~`,`~")), label.y= c(750), label.x= c(2)) + theme(text = element_text(size=20))
graph.b
## `geom_smooth()` using formula = 'y ~ x'

graph.a <- ggplot(aa, aes(x=Bold, y=.fitted, colour=Temp, fill= Temp)) + geom_jitter(aes (x=Bold, y=.fitted, colour = Temp),height = .2, width = .2, alpha=0.3) + theme_classic() + geom_smooth(method = lm, se=TRUE) + stat_regline_equation(label.y= c(750, 780), label.x= (c(1))) + stat_cor(aes(label = paste(..rr.label.., ..p.label.., sep = "~`,`~")), label.y= c(750, 780), label.x= (c(2.5))) + theme(text = element_text(size=20))
graph.a
## `geom_smooth()` using formula = 'y ~ x'

ggsave("ASxbold_temp.eps", graph.a, height = 6, width = 10, dpi = 320)
## `geom_smooth()` using formula = 'y ~ x'
## Warning in grid.Call.graphics(C_points, x$x, x$y, x$pch, x$size):
## semi-transparency is not supported on this device: reported only once per page
ggsave("ASxbold_temp.b.eps", graph.b, height = 6, width = 10, dpi = 320)
## `geom_smooth()` using formula = 'y ~ x'
## Warning in grid.Call.graphics(C_points, x$x, x$y, x$pch, x$size):
## semi-transparency is not supported on this device: reported only once per page