Chapter 7 Raw data modelling (LMM) using population

#exclude the acclimation time-point
calotriton_resp1_subset<-calotriton_resp1 %>%
  filter(time_point!="0")


#Create linear model formula
formula <- formula(o2_normalized ~ time_point*temperature*population+(1|individual))

#Fit the linear model
model <- lmer(formula, data = calotriton_resp1_subset)
boundary (singular) fit: see help('isSingular')
#Print the model summary
summary(model)
Linear mixed model fit by REML ['lmerMod']
Formula: o2_normalized ~ time_point * temperature * population + (1 |      individual)
   Data: calotriton_resp1_subset

REML criterion at convergence: -540.2

Scaled residuals: 
    Min      1Q  Median      3Q     Max 
-1.9238 -0.5697  0.1368  0.6823  1.8585 

Random effects:
 Groups     Name        Variance Std.Dev. 
 individual (Intercept) 0.00e+00 0.0000000
 Residual               9.37e-08 0.0003061
Number of obs: 58, groups:  individual, 31

Fixed effects:
                                                Estimate Std. Error t value
(Intercept)                                    8.460e-04  1.767e-04   4.787
time_point2                                   -2.513e-05  2.338e-04  -0.108
temperature20                                  3.534e-04  2.338e-04   1.512
populationGoizueta                             2.336e-04  2.235e-04   1.045
populationHarpea                              -3.588e-04  2.499e-04  -1.436
populationLeitzaran                            1.300e-05  2.499e-04   0.052
time_point2:temperature20                     -3.960e-04  3.186e-04  -1.243
time_point2:populationGoizueta                -2.728e-04  3.112e-04  -0.877
time_point2:populationHarpea                   3.292e-04  3.422e-04   0.962
time_point2:populationLeitzaran                4.449e-04  3.643e-04   1.221
temperature20:populationGoizueta              -8.314e-04  3.112e-04  -2.672
temperature20:populationHarpea                 2.267e-04  3.306e-04   0.686
temperature20:populationLeitzaran              6.616e-05  3.306e-04   0.200
time_point2:temperature20:populationGoizueta   1.275e-03  4.365e-04   2.920
time_point2:temperature20:populationHarpea     1.560e-04  4.676e-04   0.334
time_point2:temperature20:populationLeitzaran -3.016e-04  4.758e-04  -0.634

Correlation matrix not shown by default, as p = 16 > 12.
Use print(x, correlation=TRUE)  or
    vcov(x)        if you need it
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
MuMIn::r.squaredGLMM(model)
           R2m       R2c
[1,] 0.3534154 0.3534154

7.1 Raw data modelling (LMM) without interaction

#Create linear model formula
formula3 <- formula(o2_normalized ~ time_point*temperature+population+(1|individual))

#Fit the linear model
model3 <- lmer(formula3, data = calotriton_resp1_subset)
boundary (singular) fit: see help('isSingular')
#Print the model summary
summary(model3)
Linear mixed model fit by REML ['lmerMod']
Formula: o2_normalized ~ time_point * temperature + population + (1 |      individual)
   Data: calotriton_resp1_subset

REML criterion at convergence: -650.5

Scaled residuals: 
     Min       1Q   Median       3Q      Max 
-2.07343 -0.72830  0.05987  0.69854  2.38744 

Random effects:
 Groups     Name        Variance  Std.Dev. 
 individual (Intercept) 0.000e+00 0.0000000
 Residual               1.205e-07 0.0003472
Number of obs: 58, groups:  individual, 31

Fixed effects:
                            Estimate Std. Error t value
(Intercept)                8.195e-04  1.240e-04   6.611
time_point2                2.876e-05  1.342e-04   0.214
temperature20              1.782e-04  1.275e-04   1.398
populationGoizueta         1.699e-05  1.234e-04   0.138
populationHarpea          -3.175e-05  1.317e-04  -0.241
populationLeitzaran        1.705e-04  1.321e-04   1.290
time_point2:temperature20 -5.430e-05  1.834e-04  -0.296

Correlation of Fixed Effects:
            (Intr) tm_pn2 tmpr20 ppltnG ppltnH ppltnL
time_point2 -0.566                                   
temperatr20 -0.567  0.506                            
populatnGzt -0.582  0.067  0.067                     
populatnHrp -0.510  0.034 -0.003  0.497              
popltnLtzrn -0.510  0.075 -0.003  0.495  0.464       
tm_pnt2:t20  0.409 -0.732 -0.693 -0.048  0.000 -0.055
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
MuMIn::r.squaredGLMM(model3)
            R2m        R2c
[1,] 0.09324329 0.09324329