17  Adults (Morris)

Data

Description

Variable Description
Mouse

Mouse unique identifier

Stage

Developmental stage

Condition

Hypoxia condition: Normoxia (N) vs Intermittent Hypoxia (IH)

Path_Efficiency

Path Efficiency

Latency_Plat

Latency to Platform (s)

Freezing

Freezing (s)

Variable Description
Mouse

Mouse unique identifier

Stage

Developmental stage

Condition

Hypoxia condition: Normoxia (N) vs Intermittent Hypoxia (IH)

Path_Efficiency

Path Efficiency

Latency_Plat

Latency to Platform (s)

Freezing

Freezing (s)

Correlations

17.1 Path Efficiency

17.1.1 Data Exploration

Distribution:

Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 0.153 0.095 0.009 0.624 0.184 0.057 0.336 0.683 −0.983 14
IH 0.164 0.131 0.017 0.801 0.241 0.047 0.389 0.993 −0.861 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 0.153 0.095 0.009 0.624 0.184 0.057 0.336 0.683 −0.983 14
IH 0.164 0.131 0.017 0.801 0.241 0.047 0.389 0.993 −0.861 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 0.28 0.121 0.015 0.432 0.255 0.116 0.444 0.091 −1.523 14
IH 0.243 0.082 0.007 0.338 0.159 0.114 0.339 −0.255 −1.533 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 0.28 0.121 0.015 0.432 0.255 0.116 0.444 0.091 −1.523 14
IH 0.243 0.082 0.007 0.338 0.159 0.114 0.339 −0.255 −1.533 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 0.379 0.159 0.025 0.419 0.261 0.092 0.62 −0.386 −0.817 14
IH 0.287 0.104 0.011 0.364 0.202 0.151 0.46 0.259 −1.132 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 0.379 0.159 0.025 0.419 0.261 0.092 0.62 −0.386 −0.817 14
IH 0.287 0.104 0.011 0.364 0.202 0.151 0.46 0.259 −1.132 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 0.421 0.151 0.023 0.358 0.239 0.149 0.701 −0.031 −0.436 14
IH 0.288 0.154 0.024 0.533 0.257 0.114 0.572 0.403 −0.668 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 0.421 0.151 0.023 0.358 0.239 0.149 0.701 −0.031 −0.436 14
IH 0.288 0.154 0.024 0.533 0.257 0.114 0.572 0.403 −0.668 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 0.398 0.169 0.029 0.426 0.278 0.075 0.651 −0.159 −0.468 14
IH 0.247 0.067 0.005 0.273 0.078 0.146 0.391 0.781 1.625 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 0.398 0.169 0.029 0.426 0.278 0.075 0.651 −0.159 −0.468 14
IH 0.247 0.067 0.005 0.273 0.078 0.146 0.391 0.781 1.625 10

Evolution:

17.1.2 Models & Diagnostics

Exploring some Generalized Linear (Mixed) model candidates:

Model call:

```{r}
glmmTMB(formula = Path_Efficiency ~ Condition * Stage + ar1(Stage + 
    0 | Mouse), data = data, family = beta_family("logit"), REML = TRUE, 
    ziformula = ~0, dispformula = ~1)
```

Performance:

performance::performance(mod)
AIC AICc BIC R2_conditional R2_marginal ICC RMSE Sigma
-128.75 -125.32 -92.52 0.71 0.71 0 0.07 20.99
AIC AICc BIC R2_conditional R2_marginal ICC RMSE Sigma
-128.75 -125.32 -92.52 0.71 0.71 0 0.07 20.99

Residuals:

performance::check_model(
  mod, panel = FALSE,
  check = c("pp_check", "qq", "reqq", "linearity", "homogeneity")
)

Predictions:

Simulating data from the model for pseudo “Posterior Predictive” plots.

Simulated data vs observed data:

Simulated statistics vs observed ones:

Potential outliers:

Model call:

```{r}
glmmTMB(formula = Path_Efficiency ~ Condition * Stage + (Stage || 
    Mouse), data = data, family = beta_family("logit"), REML = TRUE, 
    ziformula = ~0, dispformula = ~1)
```

Performance:

performance::performance(mod)
AIC AICc BIC R2_conditional R2_marginal RMSE Sigma
-121.08 -115.79 -76.48 0.65 0.10 15.49
AIC AICc BIC R2_conditional R2_marginal RMSE Sigma
-121.08 -115.79 -76.48 0.65 0.10 15.49

Residuals:

performance::check_model(
  mod, panel = FALSE,
  check = c("pp_check", "qq", "reqq", "linearity", "homogeneity")
)

Predictions:

Simulating data from the model for pseudo “Posterior Predictive” plots.

Simulated data vs observed data:

Simulated statistics vs observed ones:

Potential outliers:

17.1.3 Effects Analysis

```{r}
glmmTMB(formula = Path_Efficiency ~ Condition * Stage + ar1(Stage + 
    0 | Mouse), data = data, family = beta_family("logit"), REML = TRUE, 
    ziformula = ~0, dispformula = ~1)
```

17.1.3.1 Coefficients

❖ All effects (Wald):

parameters::parameters(
  mod, component = "conditional", effects = "fixed",
  exponentiate = should_exp(mod), p_adjust = "none", summary = TRUE, digits = 3
)
Parameter Coefficient SE 95% CI z p
(Intercept) 0.384 0.032 (0.33, 0.45) -11.423 < .001
Condition1 1.190 0.098 (1.01, 1.40) 2.116 0.034 *
Stage1 0.488 0.058 (0.39, 0.62) -5.985 < .001
Stage2 0.931 0.097 (0.76, 1.14) -0.691 0.490
Stage3 1.287 0.127 (1.06, 1.56) 2.567 0.010 **
Stage4 1.397 0.140 (1.15, 1.70) 3.323 < .001
Condition1 * Stage1 0.823 0.099 (0.65, 1.04) -1.623 0.105
Condition1 * Stage2 0.912 0.095 (0.74, 1.12) -0.886 0.376
Condition1 * Stage3 1.018 0.100 (0.84, 1.23) 0.181 0.856
Condition1 * Stage4 1.131 0.113 (0.93, 1.38) 1.227 0.220
Model: Path_Efficiency ~ Condition * Stage (120 Observations)
Parameter Coefficient SE 95% CI z p
(Intercept) 0.384 0.032 (0.33, 0.45) -11.423 < .001
Condition1 1.190 0.098 (1.01, 1.40) 2.116 0.034 *
Stage1 0.488 0.058 (0.39, 0.62) -5.985 < .001
Stage2 0.931 0.097 (0.76, 1.14) -0.691 0.490
Stage3 1.287 0.127 (1.06, 1.56) 2.567 0.010 **
Stage4 1.397 0.140 (1.15, 1.70) 3.323 < .001
Condition1 * Stage1 0.823 0.099 (0.65, 1.04) -1.623 0.105
Condition1 * Stage2 0.912 0.095 (0.74, 1.12) -0.886 0.376
Condition1 * Stage3 1.018 0.100 (0.84, 1.23) 0.181 0.856
Condition1 * Stage4 1.131 0.113 (0.93, 1.38) 1.227 0.220
Model: Path_Efficiency ~ Condition * Stage (120 Observations)

❖ Main effects (Wald Chi-Square):

car::Anova(mod, type = 3)
term statistic df p.value
Condition 4.48 1 0.030 *
Stage 39.05 4 <0.001 ***
Condition:Stage 4.24 4 0.380
term statistic df p.value
Condition 4.48 1 0.030 *
Stage 39.05 4 <0.001 ***
Condition:Stage 4.24 4 0.380

❖ Main effects (Likelihood Ratio Test):

LRT(mod, pred = "Condition")
model df aic bic log_lik deviance chisq chi_df pr_chisq
mod_reduced 8 -159.15 -136.85 87.58 -175.15
mod_full 13 -158.68 -122.44 92.34 -184.68 9.53 5 0.090
model df aic bic log_lik deviance chisq chi_df pr_chisq
mod_reduced 8 -159.15 -136.85 87.58 -175.15
mod_full 13 -158.68 -122.44 92.34 -184.68 9.53 5 0.090
Important

Our LRT() method removes the predictor plus all its interactions

17.1.3.2 Marginal Effects

Marginal means & Contrasts for each predictor:

Marginal Means:

emmeans(mod, specs = pred, type = "response")
Condition response SE df lower.CL upper.CL
N 0.314 0.023 117 0.27 0.361
IH 0.244 0.023 117 0.201 0.294
Condition response SE df lower.CL upper.CL
N 0.314 0.023 117 0.27 0.361
IH 0.244 0.023 117 0.201 0.294
- Results are averaged over the levels of: Stage
- Confidence level used: 0.95
- Intervals are back-transformed from the logit scale

Contrasts:

emmeans(mod, specs = pred, type = "response") |> 
  contrast(method = "consec", adjust = "none", infer = TRUE)
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
IH / N 0.707 0.116 117 0.511 0.978 1 −2.116 0.036 *
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
IH / N 0.707 0.116 117 0.511 0.978 1 −2.116 0.036 *
- Results are averaged over the levels of: Stage
- Confidence level used: 0.95
- Intervals are back-transformed from the log odds ratio scale
- Tests are performed on the log odds ratio scale

Boxplot:

Marginal Means:

emmeans(mod, specs = pred, type = "response")
Stage response SE df lower.CL upper.CL
P56 0.158 0.02 117 0.123 0.201
P57 0.263 0.026 117 0.215 0.319
P58 0.331 0.029 117 0.276 0.391
P59 0.349 0.029 117 0.293 0.41
P60 0.32 0.029 117 0.266 0.38
Stage response SE df lower.CL upper.CL
P56 0.158 0.02 117 0.123 0.201
P57 0.263 0.026 117 0.215 0.319
P58 0.331 0.029 117 0.276 0.391
P59 0.349 0.029 117 0.293 0.41
P60 0.32 0.029 117 0.266 0.38
- Results are averaged over the levels of: Condition
- Confidence level used: 0.95
- Intervals are back-transformed from the logit scale

Contrasts:

emmeans(mod, specs = pred, type = "response") |> 
  contrast(method = "consec", adjust = "none", infer = TRUE)
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
P57 / P56 1.907 0.321 117 1.366 2.663 1 3.83 <0.001 ***
P58 / P57 1.383 0.215 117 1.017 1.881 1 2.087 0.039 *
P59 / P58 1.085 0.164 117 0.804 1.463 1 0.539 0.591
P60 / P59 0.877 0.134 117 0.648 1.186 1 −0.862 0.390
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
P57 / P56 1.907 0.321 117 1.366 2.663 1 3.83 <0.001 ***
P58 / P57 1.383 0.215 117 1.017 1.881 1 2.087 0.039 *
P59 / P58 1.085 0.164 117 0.804 1.463 1 0.539 0.591
P60 / P59 0.877 0.134 117 0.648 1.186 1 −0.862 0.390
- Results are averaged over the levels of: Condition
- Confidence level used: 0.95
- Intervals are back-transformed from the log odds ratio scale
- Tests are performed on the log odds ratio scale

Boxplot:

Marginal Means:

emmeans(mod, specs = emmeans_formula, type = "response")
Condition response SE df lower.CL upper.CL
N 0.155 0.025 117 0.111 0.212
IH 0.161 0.03 117 0.11 0.229
Condition response SE df lower.CL upper.CL
N 0.155 0.025 117 0.111 0.212
IH 0.161 0.03 117 0.11 0.229
Condition response SE df lower.CL upper.CL
N 0.28 0.035 117 0.216 0.353
IH 0.248 0.039 117 0.179 0.332
Condition response SE df lower.CL upper.CL
N 0.28 0.035 117 0.216 0.353
IH 0.248 0.039 117 0.179 0.332
Condition response SE df lower.CL upper.CL
N 0.375 0.039 117 0.302 0.454
IH 0.29 0.042 117 0.215 0.379
Condition response SE df lower.CL upper.CL
N 0.375 0.039 117 0.302 0.454
IH 0.29 0.042 117 0.215 0.379
Condition response SE df lower.CL upper.CL
N 0.419 0.04 117 0.343 0.5
IH 0.285 0.041 117 0.211 0.373
Condition response SE df lower.CL upper.CL
N 0.419 0.04 117 0.343 0.5
IH 0.285 0.041 117 0.211 0.373
Condition response SE df lower.CL upper.CL
N 0.393 0.039 117 0.319 0.473
IH 0.255 0.039 117 0.185 0.34
Condition response SE df lower.CL upper.CL
N 0.393 0.039 117 0.319 0.473
IH 0.255 0.039 117 0.185 0.34
- Confidence level used: 0.95
- Intervals are back-transformed from the logit scale

Contrasts:

emmeans(mod, specs = emmeans_formula, type = "response") |> 
  contrast(method = "pairwise", adjust = "none", infer = TRUE)
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.96 0.28 117 0.539 1.71 1 −0.141 0.888
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.96 0.28 117 0.539 1.71 1 −0.141 0.888
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 1.177 0.316 117 0.692 2.004 1 0.609 0.544
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 1.177 0.316 117 0.692 2.004 1 0.609 0.544
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 1.466 0.382 117 0.876 2.456 1 1.471 0.144
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 1.466 0.382 117 0.876 2.456 1 1.471 0.144
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 1.81 0.469 117 1.083 3.023 1 2.289 0.024 *
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 1.81 0.469 117 1.083 3.023 1 2.289 0.024 *
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 1.893 0.499 117 1.123 3.192 1 2.419 0.017 *
contrast odds.ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 1.893 0.499 117 1.123 3.192 1 2.419 0.017 *
- Confidence level used: 0.95
- Intervals are back-transformed from the log odds ratio scale
- Tests are performed on the log odds ratio scale

Temporal plot:


17.2 Latency to Platform

17.2.1 Data Exploration

Distribution:

Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 44.752 9.35 87.424 0.209 12.231 23.9 60 −0.542 0.653 14
IH 45.938 14.126 199.551 0.308 29.15 28.75 60 −0.15 −2.21 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 44.752 9.35 87.424 0.209 12.231 23.9 60 −0.542 0.653 14
IH 45.938 14.126 199.551 0.308 29.15 28.75 60 −0.15 −2.21 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 31.6 10.934 119.549 0.346 14.819 11.85 47.325 −0.465 −0.348 14
IH 36.498 6.822 46.538 0.187 10.775 26.725 48.4 0.331 −0.783 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 31.6 10.934 119.549 0.346 14.819 11.85 47.325 −0.465 −0.348 14
IH 36.498 6.822 46.538 0.187 10.775 26.725 48.4 0.331 −0.783 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 24.268 10.688 114.236 0.44 9.281 12.925 56.175 2.177 6.257 14
IH 35.822 11.924 142.172 0.333 23.938 21.375 54.025 0.014 −1.567 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 24.268 10.688 114.236 0.44 9.281 12.925 56.175 2.177 6.257 14
IH 35.822 11.924 142.172 0.333 23.938 21.375 54.025 0.014 −1.567 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 19.282 8.346 69.66 0.433 8.288 9.65 42.575 1.792 4.133 14
IH 34.237 13.006 169.168 0.38 23.131 17.625 55.65 0.231 −1.304 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 19.282 8.346 69.66 0.433 8.288 9.65 42.575 1.792 4.133 14
IH 34.237 13.006 169.168 0.38 23.131 17.625 55.65 0.231 −1.304 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 19.462 12.761 162.839 0.656 11.55 8.9 60 2.724 8.78 14
IH 31.928 9.676 93.623 0.303 15.462 18.525 45.975 0.058 −1.102 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 19.462 12.761 162.839 0.656 11.55 8.9 60 2.724 8.78 14
IH 31.928 9.676 93.623 0.303 15.462 18.525 45.975 0.058 −1.102 10

Evolution:

17.2.2 Models & Diagnostics

Exploring some Generalized Linear (Mixed) model candidates:

Model call:

```{r}
glmmTMB(formula = Latency_Plat ~ Condition * Stage + ar1(Stage + 
    0 | Mouse), data = data, family = Gamma("log"), REML = TRUE, 
    ziformula = ~0, dispformula = ~1)
```

Performance:

performance::performance(mod)
AIC AICc BIC R2_conditional R2_marginal ICC RMSE Sigma
942.49 945.92 978.73 0.62 0.62 0 6.24 0.26
AIC AICc BIC R2_conditional R2_marginal ICC RMSE Sigma
942.49 945.92 978.73 0.62 0.62 0 6.24 0.26

Residuals:

performance::check_model(
  mod, panel = FALSE,
  check = c("pp_check", "qq", "reqq", "linearity", "homogeneity")
)

Predictions:

Simulating data from the model for pseudo “Posterior Predictive” plots.

Simulated data vs observed data:

Simulated statistics vs observed ones:

Potential outliers:

Model call:

```{r}
glmmTMB(formula = Latency_Plat ~ Condition * Stage + (Stage || 
    Mouse), data = data, family = Gamma("log"), REML = TRUE, 
    ziformula = ~0, dispformula = ~1)
```

Performance:

performance::performance(mod)
AIC AICc BIC R2_conditional R2_marginal RMSE Sigma
948.71 954.00 993.31 0.57 7.41 0.28
AIC AICc BIC R2_conditional R2_marginal RMSE Sigma
948.71 954.00 993.31 0.57 7.41 0.28

Residuals:

performance::check_model(
  mod, panel = FALSE,
  check = c("pp_check", "qq", "reqq", "linearity", "homogeneity")
)

Predictions:

Simulating data from the model for pseudo “Posterior Predictive” plots.

Simulated data vs observed data:

Simulated statistics vs observed ones:

Potential outliers:

17.2.3 Effects Analysis

```{r}
glmmTMB(formula = Latency_Plat ~ Condition * Stage + ar1(Stage + 
    0 | Mouse), data = data, family = Gamma("log"), REML = TRUE, 
    ziformula = ~0, dispformula = ~1)
```

17.2.3.1 Coefficients

❖ All effects (Wald):

parameters::parameters(
  mod, component = "conditional", effects = "fixed",
  exponentiate = should_exp(mod), p_adjust = "none", summary = TRUE, digits = 3
)
Parameter Coefficient SE 95% CI z p
(Intercept) 29.883 1.482 (27.11, 32.93) 68.496 < .001
Condition1 0.839 0.041 (0.76, 0.92) -3.607 < .001
Stage1 1.494 0.089 (1.33, 1.68) 6.766 < .001
Stage2 1.109 0.061 (1.00, 1.24) 1.878 0.060
Stage3 0.946 0.051 (0.85, 1.05) -1.034 0.301
Stage4 0.817 0.045 (0.73, 0.91) -3.658 < .001
Condition1 * Stage1 1.181 0.070 (1.05, 1.33) 2.786 0.005 **
Condition1 * Stage2 1.090 0.061 (0.98, 1.22) 1.549 0.121
Condition1 * Stage3 0.973 0.052 (0.88, 1.08) -0.510 0.610
Condition1 * Stage4 0.891 0.049 (0.80, 0.99) -2.078 0.038 *
Model: Latency_Plat ~ Condition * Stage (120 Observations)
Parameter Coefficient SE 95% CI z p
(Intercept) 29.883 1.482 (27.11, 32.93) 68.496 < .001
Condition1 0.839 0.041 (0.76, 0.92) -3.607 < .001
Stage1 1.494 0.089 (1.33, 1.68) 6.766 < .001
Stage2 1.109 0.061 (1.00, 1.24) 1.878 0.060
Stage3 0.946 0.051 (0.85, 1.05) -1.034 0.301
Stage4 0.817 0.045 (0.73, 0.91) -3.658 < .001
Condition1 * Stage1 1.181 0.070 (1.05, 1.33) 2.786 0.005 **
Condition1 * Stage2 1.090 0.061 (0.98, 1.22) 1.549 0.121
Condition1 * Stage3 0.973 0.052 (0.88, 1.08) -0.510 0.610
Condition1 * Stage4 0.891 0.049 (0.80, 0.99) -2.078 0.038 *
Model: Latency_Plat ~ Condition * Stage (120 Observations)

❖ Main effects (Wald Chi-Square):

car::Anova(mod, type = 3)
term statistic df p.value
Condition 13.01 1 <0.001 ***
Stage 54.14 4 <0.001 ***
Condition:Stage 11.63 4 0.020 *
term statistic df p.value
Condition 13.01 1 <0.001 ***
Stage 54.14 4 <0.001 ***
Condition:Stage 11.63 4 0.020 *

❖ Main effects (Likelihood Ratio Test):

LRT(mod, pred = "Condition")
model df aic bic log_lik deviance chisq chi_df pr_chisq
mod_reduced 8 912.35 934.65 -448.18 896.35
mod_full 13 900.61 936.85 -437.31 874.61 21.74 5 <0.001 ***
model df aic bic log_lik deviance chisq chi_df pr_chisq
mod_reduced 8 912.35 934.65 -448.18 896.35
mod_full 13 900.61 936.85 -437.31 874.61 21.74 5 <0.001 ***
Important

Our LRT() method removes the predictor plus all its interactions

17.2.3.2 Marginal Effects

Marginal means & Contrasts for each predictor:

Marginal Means:

emmeans(mod, specs = pred, type = "response")
Condition response SE df lower.CL upper.CL
N 25.077 1.593 117 22.113 28.439
IH 35.609 2.667 117 30.7 41.302
Condition response SE df lower.CL upper.CL
N 25.077 1.593 117 22.113 28.439
IH 35.609 2.667 117 30.7 41.302
- Results are averaged over the levels of: Stage
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale

Contrasts:

emmeans(mod, specs = pred, type = "response") |> 
  contrast(method = "consec", adjust = "none", infer = TRUE)
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
IH / N 1.42 0.138 117 1.171 1.721 1 3.607 <0.001 ***
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
IH / N 1.42 0.138 117 1.171 1.721 1 3.607 <0.001 ***
- Results are averaged over the levels of: Stage
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale

Boxplot:

Marginal Means:

emmeans(mod, specs = pred, type = "response")
Stage response SE df lower.CL upper.CL
P56 44.659 3.375 117 38.452 51.869
P57 33.153 2.486 117 28.578 38.461
P58 28.263 2.125 117 24.354 32.8
P59 24.415 1.838 117 21.034 28.339
P60 23.322 1.763 117 20.079 27.089
Stage response SE df lower.CL upper.CL
P56 44.659 3.375 117 38.452 51.869
P57 33.153 2.486 117 28.578 38.461
P58 28.263 2.125 117 24.354 32.8
P59 24.415 1.838 117 21.034 28.339
P60 23.322 1.763 117 20.079 27.089
- Results are averaged over the levels of: Condition
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale

Contrasts:

emmeans(mod, specs = pred, type = "response") |> 
  contrast(method = "consec", adjust = "none", infer = TRUE)
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
P57 / P56 0.742 0.063 117 0.628 0.878 1 −3.518 <0.001 ***
P58 / P57 0.853 0.072 117 0.721 1.008 1 −1.888 0.061
P59 / P58 0.864 0.073 117 0.731 1.021 1 −1.733 0.086
P60 / P59 0.955 0.081 117 0.808 1.129 1 −0.541 0.589
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
P57 / P56 0.742 0.063 117 0.628 0.878 1 −3.518 <0.001 ***
P58 / P57 0.853 0.072 117 0.721 1.008 1 −1.888 0.061
P59 / P58 0.864 0.073 117 0.731 1.021 1 −1.733 0.086
P60 / P59 0.955 0.081 117 0.808 1.129 1 −0.541 0.589
- Results are averaged over the levels of: Condition
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale

Boxplot:

Marginal Means:

emmeans(mod, specs = emmeans_formula, type = "response")
Condition response SE df lower.CL upper.CL
N 44.248 4.267 117 36.555 53.559
IH 45.075 5.206 117 35.859 56.659
Condition response SE df lower.CL upper.CL
N 44.248 4.267 117 36.555 53.559
IH 45.075 5.206 117 35.859 56.659
Condition response SE df lower.CL upper.CL
N 30.322 2.953 117 25.003 36.772
IH 36.249 4.126 117 28.934 45.414
Condition response SE df lower.CL upper.CL
N 30.322 2.953 117 25.003 36.772
IH 36.249 4.126 117 28.934 45.414
Condition response SE df lower.CL upper.CL
N 23.076 2.23 117 19.056 27.944
IH 34.617 3.962 117 27.596 43.424
Condition response SE df lower.CL upper.CL
N 23.076 2.23 117 19.056 27.944
IH 34.617 3.962 117 27.596 43.424
Condition response SE df lower.CL upper.CL
N 18.264 1.764 117 15.085 22.114
IH 32.637 3.743 117 26.005 40.96
Condition response SE df lower.CL upper.CL
N 18.264 1.764 117 15.085 22.114
IH 32.637 3.743 117 26.005 40.96
Condition response SE df lower.CL upper.CL
N 17.539 1.715 117 14.45 21.287
IH 31.012 3.543 117 24.733 38.886
Condition response SE df lower.CL upper.CL
N 17.539 1.715 117 14.45 21.287
IH 31.012 3.543 117 24.733 38.886
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale

Contrasts:

emmeans(mod, specs = emmeans_formula, type = "response") |> 
  contrast(method = "pairwise", adjust = "none", infer = TRUE)
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.982 0.147 117 0.73 1.321 1 −0.124 0.902
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.982 0.147 117 0.73 1.321 1 −0.124 0.902
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.836 0.125 117 0.622 1.125 1 −1.193 0.235
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.836 0.125 117 0.622 1.125 1 −1.193 0.235
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.667 0.099 117 0.496 0.896 1 −2.717 0.008 **
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.667 0.099 117 0.496 0.896 1 −2.717 0.008 **
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.56 0.084 117 0.416 0.752 1 −3.887 <0.001 ***
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.56 0.084 117 0.416 0.752 1 −3.887 <0.001 ***
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.566 0.085 117 0.421 0.761 1 −3.811 <0.001 ***
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.566 0.085 117 0.421 0.761 1 −3.811 <0.001 ***
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale

Temporal plot:


17.3 Freezing Time:

17.3.1 Data Exploration

Distribution:

Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 0.684 0.598 0.357 0.875 0.837 0.01 1.875 0.862 −0.051 14
IH 1.326 1.782 3.176 1.344 1.781 0.01 5.75 2.047 4.26 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 0.684 0.598 0.357 0.875 0.837 0.01 1.875 0.862 −0.051 14
IH 1.326 1.782 3.176 1.344 1.781 0.01 5.75 2.047 4.26 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 1.253 1.552 2.409 1.239 1.45 0.01 5.9 2.351 6.253 14
IH 2.855 1.615 2.607 0.566 3.194 0.75 5.025 0.1 −1.72 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 1.253 1.552 2.409 1.239 1.45 0.01 5.9 2.351 6.253 14
IH 2.855 1.615 2.607 0.566 3.194 0.75 5.025 0.1 −1.72 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 2.309 2.48 6.148 1.074 1.769 0.525 10.3 2.899 9.466 14
IH 6.907 6.375 40.641 0.923 8.162 0.95 20.55 1.245 1.033 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 2.309 2.48 6.148 1.074 1.769 0.525 10.3 2.899 9.466 14
IH 6.907 6.375 40.641 0.923 8.162 0.95 20.55 1.245 1.033 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 3.296 2.728 7.443 0.828 3.994 0.35 9.225 1.041 0.146 14
IH 8.135 4.117 16.951 0.506 5.325 1.675 16.15 0.212 0.673 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 3.296 2.728 7.443 0.828 3.994 0.35 9.225 1.041 0.146 14
IH 8.135 4.117 16.951 0.506 5.325 1.675 16.15 0.212 0.673 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 3.22 3.359 11.28 1.043 3.319 0.425 13.35 2.345 6.511 14
IH 9.428 6.196 38.392 0.657 10.181 3.5 21.85 0.941 0.022 10
Condition Mean SD Variance CoV IQR Min Max Skewness Kurtosis n
N 3.22 3.359 11.28 1.043 3.319 0.425 13.35 2.345 6.511 14
IH 9.428 6.196 38.392 0.657 10.181 3.5 21.85 0.941 0.022 10

Evolution:

17.3.2 Models & Diagnostics

Exploring some Generalized Linear (Mixed) model candidates:

Model call:

```{r}
glmmTMB(formula = Freezing ~ Condition * Stage + ar1(Stage + 
    0 | Mouse), data = data, family = Gamma("log"), REML = TRUE, 
    ziformula = ~0, dispformula = ~1)
```

Performance:

performance::performance(mod)
AIC AICc BIC R2_conditional R2_marginal ICC RMSE Sigma
509.15 512.58 545.38 0.51 0.51 0 2.39 0.82
AIC AICc BIC R2_conditional R2_marginal ICC RMSE Sigma
509.15 512.58 545.38 0.51 0.51 0 2.39 0.82

Residuals:

performance::check_model(
  mod, panel = FALSE,
  check = c("pp_check", "qq", "reqq", "linearity", "homogeneity")
)

Predictions:

Simulating data from the model for pseudo “Posterior Predictive” plots.

Simulated data vs observed data:

Simulated statistics vs observed ones:

Potential outliers:

Model call:

```{r}
glmmTMB(formula = Freezing ~ Condition * Stage + (Stage || Mouse), 
    data = data, family = Gamma("log"), REML = TRUE, ziformula = ~0, 
    dispformula = ~1)
```

Performance:

performance::performance(mod)
AIC AICc BIC R2_conditional R2_marginal RMSE Sigma
513.31 518.59 557.91 0.54 2.11 0.79
AIC AICc BIC R2_conditional R2_marginal RMSE Sigma
513.31 518.59 557.91 0.54 2.11 0.79

Residuals:

performance::check_model(
  mod, panel = FALSE,
  check = c("pp_check", "qq", "reqq", "linearity", "homogeneity")
)

Predictions:

Simulating data from the model for pseudo “Posterior Predictive” plots.

Simulated data vs observed data:

Simulated statistics vs observed ones:

Potential outliers:

17.3.3 Effects Analysis

```{r}
glmmTMB(formula = Freezing ~ Condition * Stage + ar1(Stage + 
    0 | Mouse), data = data, family = Gamma("log"), REML = TRUE, 
    ziformula = ~0, dispformula = ~1)
```

17.3.3.1 Coefficients

❖ All effects (Wald):

parameters::parameters(
  mod, component = "conditional", effects = "fixed",
  exponentiate = should_exp(mod), p_adjust = "none", summary = TRUE, digits = 3
)
Parameter Coefficient SE 95% CI z p
(Intercept) 2.400 0.351 (1.80, 3.20) 5.982 < .001
Condition1 0.632 0.087 (0.48, 0.83) -3.331 < .001
Stage1 0.310 0.054 (0.22, 0.44) -6.767 < .001
Stage2 0.666 0.107 (0.49, 0.91) -2.539 0.011 *
Stage3 1.332 0.210 (0.98, 1.81) 1.819 0.069
Stage4 1.838 0.292 (1.35, 2.51) 3.838 < .001
Condition1 * Stage1 1.312 0.224 (0.94, 1.83) 1.592 0.111
Condition1 * Stage2 0.960 0.155 (0.70, 1.32) -0.251 0.802
Condition1 * Stage3 0.949 0.149 (0.70, 1.29) -0.336 0.737
Condition1 * Stage4 0.966 0.152 (0.71, 1.31) -0.220 0.826
Model: Freezing ~ Condition * Stage (120 Observations)
Parameter Coefficient SE 95% CI z p
(Intercept) 2.400 0.351 (1.80, 3.20) 5.982 < .001
Condition1 0.632 0.087 (0.48, 0.83) -3.331 < .001
Stage1 0.310 0.054 (0.22, 0.44) -6.767 < .001
Stage2 0.666 0.107 (0.49, 0.91) -2.539 0.011 *
Stage3 1.332 0.210 (0.98, 1.81) 1.819 0.069
Stage4 1.838 0.292 (1.35, 2.51) 3.838 < .001
Condition1 * Stage1 1.312 0.224 (0.94, 1.83) 1.592 0.111
Condition1 * Stage2 0.960 0.155 (0.70, 1.32) -0.251 0.802
Condition1 * Stage3 0.949 0.149 (0.70, 1.29) -0.336 0.737
Condition1 * Stage4 0.966 0.152 (0.71, 1.31) -0.220 0.826
Model: Freezing ~ Condition * Stage (120 Observations)

❖ Main effects (Wald Chi-Square):

car::Anova(mod, type = 3)
term statistic df p.value
Condition 11.10 1 <0.001 ***
Stage 66.84 4 <0.001 ***
Condition:Stage 2.75 4 0.600
term statistic df p.value
Condition 11.10 1 <0.001 ***
Stage 66.84 4 <0.001 ***
Condition:Stage 2.75 4 0.600

❖ Main effects (Likelihood Ratio Test):

LRT(mod, pred = "Condition")
model df aic bic log_lik deviance chisq chi_df pr_chisq
mod_reduced 8 491.37 513.67 -237.69 475.37
mod_full 13 488.17 524.41 -231.08 462.17 13.20 5 0.020 *
model df aic bic log_lik deviance chisq chi_df pr_chisq
mod_reduced 8 491.37 513.67 -237.69 475.37
mod_full 13 488.17 524.41 -231.08 462.17 13.20 5 0.020 *
Important

Our LRT() method removes the predictor plus all its interactions

17.3.3.2 Marginal Effects

Marginal means & Contrasts for each predictor:

Marginal Means:

emmeans(mod, specs = pred, type = "response")
Condition response SE df lower.CL upper.CL
N 1.517 0.281 117 1.051 2.188
IH 3.797 0.819 117 2.477 5.82
Condition response SE df lower.CL upper.CL
N 1.517 0.281 117 1.051 2.188
IH 3.797 0.819 117 2.477 5.82
- Results are averaged over the levels of: Stage
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale

Contrasts:

emmeans(mod, specs = pred, type = "response") |> 
  contrast(method = "consec", adjust = "none", infer = TRUE)
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
IH / N 2.503 0.69 117 1.451 4.319 1 3.331 0.001 **
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
IH / N 2.503 0.69 117 1.451 4.319 1 3.331 0.001 **
- Results are averaged over the levels of: Stage
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale

Boxplot:

Marginal Means:

emmeans(mod, specs = pred, type = "response")
Stage response SE df lower.CL upper.CL
P56 0.745 0.176 117 0.466 1.189
P57 1.597 0.343 117 1.044 2.445
P58 3.197 0.682 117 2.095 4.878
P59 4.412 0.927 117 2.909 6.69
P60 4.743 1.027 117 3.089 7.282
Stage response SE df lower.CL upper.CL
P56 0.745 0.176 117 0.466 1.189
P57 1.597 0.343 117 1.044 2.445
P58 3.197 0.682 117 2.095 4.878
P59 4.412 0.927 117 2.909 6.69
P60 4.743 1.027 117 3.089 7.282
- Results are averaged over the levels of: Condition
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale

Contrasts:

emmeans(mod, specs = pred, type = "response") |> 
  contrast(method = "consec", adjust = "none", infer = TRUE)
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
P57 / P56 2.145 0.565 117 1.272 3.615 1 2.894 0.005 **
P58 / P57 2.001 0.498 117 1.223 3.275 1 2.791 0.006 **
P59 / P58 1.38 0.342 117 0.845 2.254 1 1.3 0.196
P60 / P59 1.075 0.266 117 0.659 1.754 1 0.293 0.770
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
P57 / P56 2.145 0.565 117 1.272 3.615 1 2.894 0.005 **
P58 / P57 2.001 0.498 117 1.223 3.275 1 2.791 0.006 **
P59 / P58 1.38 0.342 117 0.845 2.254 1 1.3 0.196
P60 / P59 1.075 0.266 117 0.659 1.754 1 0.293 0.770
- Results are averaged over the levels of: Condition
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale

Boxplot:

Marginal Means:

emmeans(mod, specs = emmeans_formula, type = "response")
Condition response SE df lower.CL upper.CL
N 0.618 0.176 117 0.351 1.086
IH 0.898 0.32 117 0.444 1.818
Condition response SE df lower.CL upper.CL
N 0.618 0.176 117 0.351 1.086
IH 0.898 0.32 117 0.444 1.818
Condition response SE df lower.CL upper.CL
N 0.969 0.276 117 0.552 1.704
IH 2.632 0.84 117 1.399 4.952
Condition response SE df lower.CL upper.CL
N 0.969 0.276 117 0.552 1.704
IH 2.632 0.84 117 1.399 4.952
Condition response SE df lower.CL upper.CL
N 1.917 0.523 117 1.117 3.29
IH 5.332 1.729 117 2.805 10.136
Condition response SE df lower.CL upper.CL
N 1.917 0.523 117 1.117 3.29
IH 5.332 1.729 117 2.805 10.136
Condition response SE df lower.CL upper.CL
N 2.694 0.737 117 1.567 4.631
IH 7.224 2.294 117 3.852 13.549
Condition response SE df lower.CL upper.CL
N 2.694 0.737 117 1.567 4.631
IH 7.224 2.294 117 3.852 13.549
Condition response SE df lower.CL upper.CL
N 2.596 0.726 117 1.492 4.516
IH 8.665 2.794 117 4.575 16.408
Condition response SE df lower.CL upper.CL
N 2.596 0.726 117 1.492 4.516
IH 8.665 2.794 117 4.575 16.408
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale

Contrasts:

emmeans(mod, specs = emmeans_formula, type = "response") |> 
  contrast(method = "pairwise", adjust = "none", infer = TRUE)
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.688 0.302 117 0.288 1.64 1 −0.853 0.396
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.688 0.302 117 0.288 1.64 1 −0.853 0.396
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.368 0.157 117 0.159 0.856 1 −2.347 0.021 *
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.368 0.157 117 0.159 0.856 1 −2.347 0.021 *
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.359 0.151 117 0.156 0.827 1 −2.431 0.017 *
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.359 0.151 117 0.156 0.827 1 −2.431 0.017 *
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.373 0.156 117 0.163 0.853 1 −2.361 0.020 *
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.373 0.156 117 0.163 0.853 1 −2.361 0.020 *
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.3 0.126 117 0.13 0.689 1 −2.868 0.005 **
contrast ratio SE df lower.CL upper.CL null t.ratio p.value
N / IH 0.3 0.126 117 0.13 0.689 1 −2.868 0.005 **
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale

Temporal plot: