Vesicular-Glutamate Transporter 2
❖ Data
❖ Description
Variable
Description
Mouse
Condition
Hypoxia condition: Normoxia (N) vs Intermittent Hypoxia (IH)
Z
Bregma coordinates (Ant, Med, Post)
A_VGLUT_MF
Vglut2-labelled Mossy fiber area in the IGL (10^-4 μm^(2))
A_VGLUT_CF
Vglut2-labelled Climbing fiber area in the ML (10^-4 μm^(2))
A_DD_per_cell
Purkinje dendrite area per Purkinje cell body (10^-4 μm^(2))
Vol_DD_per_cell
Purkinje dendrite volume per Purkinje cell body (10^-4 μm^(3))
A_ML
Molecular layer area (10^-4 μm^(2))
Thick_ML
Molecular layer thickness (μm)
N_CC
Number of Purkinje cell bodies (per 413x10^3 μm^(3))
Variable
Description
Mouse
Condition
Hypoxia condition: Normoxia (N) vs Intermittent Hypoxia (IH)
Z
Bregma coordinates (Ant, Med, Post)
A_VGLUT_MF
Vglut2-labelled Mossy fiber area in the IGL (10^-4 μm^(2))
A_VGLUT_CF
Vglut2-labelled Climbing fiber area in the ML (10^-4 μm^(2))
A_DD_per_cell
Purkinje dendrite area per Purkinje cell body (10^-4 μm^(2))
Vol_DD_per_cell
Purkinje dendrite volume per Purkinje cell body (10^-4 μm^(3))
A_ML
Molecular layer area (10^-4 μm^(2))
Thick_ML
Molecular layer thickness (μm)
N_CC
Number of Purkinje cell bodies (per 413x10^3 μm^(3))
❖ Correlations
Vglut2-labelled Mossy fiber area (IGL)
Data Exploration
❖ Distribution:
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
7.939
2.242
5.026
0.282
2.767
2.61
13.123
0.191
0.184
41
IH
8.377
1.752
3.071
0.209
1.946
4.587
13.023
0.322
1.371
32
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
7.939
2.242
5.026
0.282
2.767
2.61
13.123
0.191
0.184
41
IH
8.377
1.752
3.071
0.209
1.946
4.587
13.023
0.322
1.371
32
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
7.893
1.856
3.446
0.235
1.582
4.754
13.249
0.923
1.303
43
IH
9.658
3.054
9.329
0.316
3.93
4.399
17.734
0.963
1.082
32
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
7.893
1.856
3.446
0.235
1.582
4.754
13.249
0.923
1.303
43
IH
9.658
3.054
9.329
0.316
3.93
4.399
17.734
0.963
1.082
32
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
8.094
1.875
3.517
0.232
2.661
4.435
12.632
−0.078
−0.124
36
IH
10.712
2.254
5.081
0.21
2.943
4.988
13.967
−0.709
0.216
26
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
8.094
1.875
3.517
0.232
2.661
4.435
12.632
−0.078
−0.124
36
IH
10.712
2.254
5.081
0.21
2.943
4.988
13.967
−0.709
0.216
26
Models & Diagnostics
Exploring some Generalized Linear (Mixed) model candidates:
❖ Model call:
```{r}
glmmTMB (formula = A_VGLUT_MF ~ Condition * Z + (1 | Mouse), data = data,
family = Gamma ("log" ), REML = TRUE , ziformula = ~ 0 , dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
961.52
962.24
988.30
0.16
0.15
8.46e-03
2.15
0.25
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
961.52
962.24
988.30
0.16
0.15
8.46e-03
2.15
0.25
❖ 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 = A_VGLUT_MF ~ Condition * Z + (1 | Mouse), data = data,
family = gaussian ("log" ), REML = TRUE , ziformula = ~ 0 , dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
970.77
971.49
997.55
2.50e-03
2.37e-03
1.32e-04
2.15
2.18
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
970.77
971.49
997.55
2.50e-03
2.37e-03
1.32e-04
2.15
2.18
❖ 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:
Effects Analysis
```{r}
glmmTMB (formula = A_VGLUT_MF ~ Condition * Z + (1 | Mouse), data = data,
family = Gamma ("log" ), REML = TRUE , ziformula = ~ 0 , dispformula = ~ 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)
8.716
0.174
(8.38, 9.06)
108.287
< .001
Condition1
0.915
0.018
(0.88, 0.95)
-4.448
< .001
Z1
0.937
0.024
(0.89, 0.98)
-2.572
0.010 **
Z2
1.001
0.025
(0.95, 1.05)
0.024
0.981
Condition1 * Z1
1.065
0.027
(1.01, 1.12)
2.501
0.012 *
Condition1 * Z2
0.988
0.025
(0.94, 1.04)
-0.479
0.632
Model: A_VGLUT_MF ~ Condition * Z (210 Observations)
Parameter
Coefficient
SE
95% CI
z
p
(Intercept)
8.716
0.174
(8.38, 9.06)
108.287
< .001
Condition1
0.915
0.018
(0.88, 0.95)
-4.448
< .001
Z1
0.937
0.024
(0.89, 0.98)
-2.572
0.010 **
Z2
1.001
0.025
(0.95, 1.05)
0.024
0.981
Condition1 * Z1
1.065
0.027
(1.01, 1.12)
2.501
0.012 *
Condition1 * Z2
0.988
0.025
(0.94, 1.04)
-0.479
0.632
Model: A_VGLUT_MF ~ Condition * Z (210 Observations)
❖ Main effects (Wald Chi-Square) :
car :: Anova ( mod , type = 3 )
term
statistic
df
p.value
Condition
19.79
1
<0.001 ***
Z
8.29
2
0.020 *
Condition:Z
6.79
2
0.030 *
term
statistic
df
p.value
Condition
19.79
1
<0.001 ***
Z
8.29
2
0.020 *
Condition:Z
6.79
2
0.030 *
❖ Main effects (Likelihood Ratio Test) :
LRT ( mod , pred = "Condition" )
model
df
aic
bic
log_lik
deviance
chisq
chi_df
pr_chisq
mod_reduced
5
937.90
954.64
-463.95
927.90
mod_full
8
926.42
953.20
-455.21
910.42
17.49
3
<0.001 ***
model
df
aic
bic
log_lik
deviance
chisq
chi_df
pr_chisq
mod_reduced
5
937.90
954.64
-463.95
927.90
mod_full
8
926.42
953.20
-455.21
910.42
17.49
3
<0.001 ***
Our LRT()
method removes the predictor plus all its interactions
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
7.975
0.208
208
7.574
8.396
IH
9.527
0.288
208
8.975
10.113
Condition
response
SE
df
lower.CL
upper.CL
N
7.975
0.208
208
7.574
8.396
IH
9.527
0.288
208
8.975
10.113
- Results are averaged over the levels of: Z
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
❖ Contrasts:
emmeans ( mod , specs = pred , 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.837
0.033
208
0.774
0.906
1
−4.448
<0.001 ***
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.837
0.033
208
0.774
0.906
1
−4.448
<0.001 ***
- Results are averaged over the levels of: Z
- 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" )
Z
response
SE
df
lower.CL
upper.CL
Ant
8.166
0.258
208
7.672
8.691
Med
8.721
0.272
208
8.201
9.275
Post
9.298
0.318
208
8.692
9.947
Z
response
SE
df
lower.CL
upper.CL
Ant
8.166
0.258
208
7.672
8.691
Med
8.721
0.272
208
8.201
9.275
Post
9.298
0.318
208
8.692
9.947
- 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 = "pairwise" , adjust = "none" , infer = TRUE )
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
0.936
0.04
208
0.86
1.019
1
−1.535
0.126
Ant / Post
0.878
0.04
208
0.803
0.96
1
−2.877
0.004 **
Med / Post
0.938
0.042
208
0.86
1.024
1
−1.446
0.150
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
0.936
0.04
208
0.86
1.019
1
−1.535
0.126
Ant / Post
0.878
0.04
208
0.803
0.96
1
−2.877
0.004 **
Med / Post
0.938
0.042
208
0.86
1.024
1
−1.446
0.150
- 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
7.953
0.332
208
7.324
8.636
IH
8.384
0.396
208
7.638
9.204
Condition
response
SE
df
lower.CL
upper.CL
N
7.953
0.332
208
7.324
8.636
IH
8.384
0.396
208
7.638
9.204
Condition
response
SE
df
lower.CL
upper.CL
N
7.885
0.321
208
7.277
8.544
IH
9.647
0.455
208
8.79
10.587
Condition
response
SE
df
lower.CL
upper.CL
N
7.885
0.321
208
7.277
8.544
IH
9.647
0.455
208
8.79
10.587
Condition
response
SE
df
lower.CL
upper.CL
N
8.087
0.357
208
7.413
8.822
IH
10.691
0.557
208
9.648
11.848
Condition
response
SE
df
lower.CL
upper.CL
N
8.087
0.357
208
7.413
8.822
IH
10.691
0.557
208
9.648
11.848
- 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.949
0.06
208
0.838
1.074
1
−0.84
0.402
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.949
0.06
208
0.838
1.074
1
−0.84
0.402
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.817
0.051
208
0.723
0.924
1
−3.242
0.001 **
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.817
0.051
208
0.723
0.924
1
−3.242
0.001 **
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.756
0.052
208
0.661
0.865
1
−4.097
<0.001 ***
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.756
0.052
208
0.661
0.865
1
−4.097
<0.001 ***
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
emmeans ( mod , specs = emmeans_formula , type = "response" ) |>
contrast ( interaction = "pairwise" , by = NULL , adjust = "none" , infer = T )
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.16
0.099
208
0.982
1.372
1
1.753
0.081
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.16
0.099
208
0.982
1.372
1
1.753
0.081
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.254
0.112
208
1.052
1.495
1
2.536
0.012 *
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.254
0.112
208
1.052
1.495
1
2.536
0.012 *
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.081
0.096
208
0.907
1.287
1
0.875
0.383
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.081
0.096
208
0.907
1.287
1
0.875
0.383
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
❖ Boxplot:
Vglut2-labelled Climbing fiber area (ML)
Data Exploration
❖ Distribution:
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
3.379
2.888
8.341
0.855
2.461
0.211
12.796
1.847
3.639
38
IH
6.929
5.357
28.696
0.773
5.334
0.702
29.153
2.319
7.987
35
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
3.379
2.888
8.341
0.855
2.461
0.211
12.796
1.847
3.639
38
IH
6.929
5.357
28.696
0.773
5.334
0.702
29.153
2.319
7.987
35
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
3.08
1.942
3.772
0.631
2.328
0.752
11.91
2.211
9.116
43
IH
6.574
6.98
48.718
1.062
5.179
0.204
31.623
2.629
7.592
32
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
3.08
1.942
3.772
0.631
2.328
0.752
11.91
2.211
9.116
43
IH
6.574
6.98
48.718
1.062
5.179
0.204
31.623
2.629
7.592
32
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
3.077
2.15
4.624
0.699
2.483
0.368
10.502
1.586
3.518
35
IH
8.758
6.616
43.775
0.755
8.047
0.387
26.488
1.194
1.177
26
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
3.077
2.15
4.624
0.699
2.483
0.368
10.502
1.586
3.518
35
IH
8.758
6.616
43.775
0.755
8.047
0.387
26.488
1.194
1.177
26
Models & Diagnostics
Exploring some Generalized Linear (Mixed) model candidates:
❖ Model call:
```{r}
glmmTMB (formula = A_VGLUT_CF ~ Condition * Z + (1 | Mouse), data = data,
family = Gamma ("log" ), REML = TRUE , ziformula = ~ 0 , dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
1051.68
1052.40
1078.42
0.29
0.23
0.07
4.41
0.74
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
1051.68
1052.40
1078.42
0.29
0.23
0.07
4.41
0.74
❖ 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 = A_VGLUT_CF ~ Condition * Z + (1 | Mouse), data = data,
family = gaussian ("log" ), REML = TRUE , ziformula = ~ 0 , dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
1255.13
1255.85
1281.87
9.14e-03
8.42e-03
7.26e-04
4.43
4.52
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
1255.13
1255.85
1281.87
9.14e-03
8.42e-03
7.26e-04
4.43
4.52
❖ 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:
Effects Analysis
```{r}
glmmTMB (formula = A_VGLUT_CF ~ Condition * Z + (1 | Mouse), data = data,
family = Gamma ("log" ), REML = TRUE , ziformula = ~ 0 , dispformula = ~ 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)
4.764
0.445
(3.97, 5.72)
16.727
< .001
Condition1
0.657
0.061
(0.55, 0.79)
-4.507
< .001
Z1
1.024
0.077
(0.88, 1.19)
0.315
0.753
Z2
0.931
0.068
(0.81, 1.07)
-0.980
0.327
Condition1 * Z1
1.039
0.078
(0.90, 1.21)
0.512
0.609
Condition1 * Z2
1.066
0.078
(0.92, 1.23)
0.872
0.383
Model: A_VGLUT_CF ~ Condition * Z (209 Observations)
Parameter
Coefficient
SE
95% CI
z
p
(Intercept)
4.764
0.445
(3.97, 5.72)
16.727
< .001
Condition1
0.657
0.061
(0.55, 0.79)
-4.507
< .001
Z1
1.024
0.077
(0.88, 1.19)
0.315
0.753
Z2
0.931
0.068
(0.81, 1.07)
-0.980
0.327
Condition1 * Z1
1.039
0.078
(0.90, 1.21)
0.512
0.609
Condition1 * Z2
1.066
0.078
(0.92, 1.23)
0.872
0.383
Model: A_VGLUT_CF ~ Condition * Z (209 Observations)
❖ Main effects (Wald Chi-Square) :
car :: Anova ( mod , type = 3 )
term
statistic
df
p.value
Condition
20.32
1
<0.001 ***
Z
0.98
2
0.610
Condition:Z
1.86
2
0.400
term
statistic
df
p.value
Condition
20.32
1
<0.001 ***
Z
0.98
2
0.610
Condition:Z
1.86
2
0.400
❖ Main effects (Likelihood Ratio Test) :
LRT ( mod , pred = "Condition" )
model
df
aic
bic
log_lik
deviance
chisq
chi_df
pr_chisq
mod_reduced
5
1038.53
1055.24
-514.26
1028.53
mod_full
8
1031.37
1058.11
-507.69
1015.37
13.15
3
0.004 **
model
df
aic
bic
log_lik
deviance
chisq
chi_df
pr_chisq
mod_reduced
5
1038.53
1055.24
-514.26
1028.53
mod_full
8
1031.37
1058.11
-507.69
1015.37
13.15
3
0.004 **
Our LRT()
method removes the predictor plus all its interactions
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
3.128
0.384
207
2.456
3.984
IH
7.254
1.02
207
5.498
9.572
Condition
response
SE
df
lower.CL
upper.CL
N
3.128
0.384
207
2.456
3.984
IH
7.254
1.02
207
5.498
9.572
- Results are averaged over the levels of: Z
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
❖ Contrasts:
emmeans ( mod , specs = pred , 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.431
0.08
207
0.298
0.623
1
−4.507
<0.001 ***
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.431
0.08
207
0.298
0.623
1
−4.507
<0.001 ***
- Results are averaged over the levels of: Z
- 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" )
Z
response
SE
df
lower.CL
upper.CL
Ant
4.878
0.575
207
3.866
6.156
Med
4.436
0.518
207
3.524
5.584
Post
4.995
0.622
207
3.908
6.384
Z
response
SE
df
lower.CL
upper.CL
Ant
4.878
0.575
207
3.866
6.156
Med
4.436
0.518
207
3.524
5.584
Post
4.995
0.622
207
3.908
6.384
- 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 = "pairwise" , adjust = "none" , infer = TRUE )
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
1.1
0.139
207
0.856
1.412
1
0.75
0.454
Ant / Post
0.977
0.131
207
0.75
1.272
1
−0.177
0.860
Med / Post
0.888
0.115
207
0.688
1.146
1
−0.919
0.359
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
1.1
0.139
207
0.856
1.412
1
0.75
0.454
Ant / Post
0.977
0.131
207
0.75
1.272
1
−0.177
0.860
Med / Post
0.888
0.115
207
0.688
1.146
1
−0.919
0.359
- 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
3.33
0.53
207
2.434
4.556
IH
7.147
1.246
207
5.069
10.078
Condition
response
SE
df
lower.CL
upper.CL
N
3.33
0.53
207
2.434
4.556
IH
7.147
1.246
207
5.069
10.078
Condition
response
SE
df
lower.CL
upper.CL
N
3.105
0.473
207
2.299
4.192
IH
6.338
1.125
207
4.467
8.993
Condition
response
SE
df
lower.CL
upper.CL
N
3.105
0.473
207
2.299
4.192
IH
6.338
1.125
207
4.467
8.993
Condition
response
SE
df
lower.CL
upper.CL
N
2.961
0.477
207
2.154
4.068
IH
8.427
1.593
207
5.806
12.233
Condition
response
SE
df
lower.CL
upper.CL
N
2.961
0.477
207
2.154
4.068
IH
8.427
1.593
207
5.806
12.233
- 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.466
0.11
207
0.293
0.742
1
−3.237
0.001 **
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.466
0.11
207
0.293
0.742
1
−3.237
0.001 **
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.49
0.115
207
0.309
0.777
1
−3.047
0.003 **
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.49
0.115
207
0.309
0.777
1
−3.047
0.003 **
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.351
0.087
207
0.215
0.573
1
−4.218
<0.001 ***
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.351
0.087
207
0.215
0.573
1
−4.218
<0.001 ***
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
emmeans ( mod , specs = emmeans_formula , type = "response" ) |>
contrast ( interaction = "pairwise" , by = NULL , adjust = "none" , infer = T )
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.951
0.243
207
0.575
1.572
1
−0.197
0.844
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.951
0.243
207
0.575
1.572
1
−0.197
0.844
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.326
0.353
207
0.784
2.242
1
1.059
0.291
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.326
0.353
207
0.784
2.242
1
1.059
0.291
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.394
0.36
207
0.838
2.32
1
1.287
0.199
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.394
0.36
207
0.838
2.32
1
1.287
0.199
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
❖ Boxplot:
Purkinje dendrite area (per Purkinje cell body)
Data Exploration
❖ Distribution:
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
1.143
0.389
0.151
0.34
0.445
0.109
2.006
−0.105
0.408
40
IH
1.333
0.549
0.302
0.412
0.639
0.562
3.305
1.492
3.586
35
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
1.143
0.389
0.151
0.34
0.445
0.109
2.006
−0.105
0.408
40
IH
1.333
0.549
0.302
0.412
0.639
0.562
3.305
1.492
3.586
35
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
1.347
0.612
0.374
0.454
0.578
0.369
3.386
1.49
2.888
41
IH
1.155
0.405
0.164
0.35
0.499
0.479
2.445
0.898
2.178
31
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
1.347
0.612
0.374
0.454
0.578
0.369
3.386
1.49
2.888
41
IH
1.155
0.405
0.164
0.35
0.499
0.479
2.445
0.898
2.178
31
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
1.449
0.732
0.535
0.505
0.593
0.265
4.611
2.508
9.047
39
IH
1.204
0.541
0.292
0.449
0.715
0.497
2.45
0.999
−0.104
27
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
1.449
0.732
0.535
0.505
0.593
0.265
4.611
2.508
9.047
39
IH
1.204
0.541
0.292
0.449
0.715
0.497
2.45
0.999
−0.104
27
Models & Diagnostics
Exploring some Generalized Linear (Mixed) model candidates:
❖ Model call:
```{r}
glmmTMB (formula = A_DD_per_cell ~ Condition * Z + (1 | Mouse),
data = data, family = Gamma ("log" ), REML = TRUE , ziformula = ~ 0 ,
dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
337.15
337.86
364.04
0.10
0.04
0.06
0.53
0.40
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
337.15
337.86
364.04
0.10
0.04
0.06
0.53
0.40
❖ 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 = A_DD_per_cell ~ Condition * Z + (1 | Mouse),
data = data, family = gaussian ("log" ), REML = TRUE , ziformula = ~ 0 ,
dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
389.93
390.63
416.82
0.05
0.02
0.03
0.53
0.55
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
389.93
390.63
416.82
0.05
0.02
0.03
0.53
0.55
❖ 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:
Effects Analysis
```{r}
glmmTMB (formula = A_DD_per_cell ~ Condition * Z + (1 | Mouse),
data = data, family = Gamma ("log" ), REML = TRUE , ziformula = ~ 0 ,
dispformula = ~ 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)
1.264
0.060
(1.15, 1.39)
4.920
< .001
Condition1
1.030
0.049
(0.94, 1.13)
0.626
0.531
Z1
0.969
0.038
(0.90, 1.05)
-0.819
0.413
Z2
0.988
0.039
(0.92, 1.07)
-0.299
0.765
Condition1 * Z1
0.912
0.036
(0.84, 0.99)
-2.338
0.019 *
Condition1 * Z2
1.045
0.041
(0.97, 1.13)
1.123
0.261
Model: A_DD_per_cell ~ Condition * Z (213 Observations)
Parameter
Coefficient
SE
95% CI
z
p
(Intercept)
1.264
0.060
(1.15, 1.39)
4.920
< .001
Condition1
1.030
0.049
(0.94, 1.13)
0.626
0.531
Z1
0.969
0.038
(0.90, 1.05)
-0.819
0.413
Z2
0.988
0.039
(0.92, 1.07)
-0.299
0.765
Condition1 * Z1
0.912
0.036
(0.84, 0.99)
-2.338
0.019 *
Condition1 * Z2
1.045
0.041
(0.97, 1.13)
1.123
0.261
Model: A_DD_per_cell ~ Condition * Z (213 Observations)
❖ Main effects (Wald Chi-Square) :
car :: Anova ( mod , type = 3 )
term
statistic
df
p.value
Condition
0.39
1
0.530
Z
1.27
2
0.530
Condition:Z
5.47
2
0.060
term
statistic
df
p.value
Condition
0.39
1
0.530
Z
1.27
2
0.530
Condition:Z
5.47
2
0.060
❖ Main effects (Likelihood Ratio Test) :
LRT ( mod , pred = "Condition" )
model
df
aic
bic
log_lik
deviance
chisq
chi_df
pr_chisq
mod_reduced
5
309.34
326.14
-149.67
299.34
mod_full
8
309.09
335.98
-146.55
293.09
6.24
3
0.100
model
df
aic
bic
log_lik
deviance
chisq
chi_df
pr_chisq
mod_reduced
5
309.34
326.14
-149.67
299.34
mod_full
8
309.09
335.98
-146.55
293.09
6.24
3
0.100
Our LRT()
method removes the predictor plus all its interactions
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.303
0.081
211
1.151
1.473
IH
1.227
0.088
211
1.065
1.414
Condition
response
SE
df
lower.CL
upper.CL
N
1.303
0.081
211
1.151
1.473
IH
1.227
0.088
211
1.065
1.414
- Results are averaged over the levels of: Z
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
❖ Contrasts:
emmeans ( mod , specs = pred , type = "response" ) |>
contrast ( method = "pairwise" , adjust = "none" , infer = TRUE )
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.062
0.101
211
0.88
1.281
1
0.626
0.532
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.062
0.101
211
0.88
1.281
1
0.626
0.532
- Results are averaged over the levels of: Z
- 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" )
Z
response
SE
df
lower.CL
upper.CL
Ant
1.224
0.074
211
1.086
1.38
Med
1.25
0.077
211
1.107
1.41
Post
1.321
0.084
211
1.165
1.497
Z
response
SE
df
lower.CL
upper.CL
Ant
1.224
0.074
211
1.086
1.38
Med
1.25
0.077
211
1.107
1.41
Post
1.321
0.084
211
1.165
1.497
- 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 = "pairwise" , adjust = "none" , infer = TRUE )
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
0.98
0.066
211
0.859
1.118
1
−0.302
0.763
Ant / Post
0.927
0.064
211
0.809
1.062
1
−1.096
0.275
Med / Post
0.946
0.066
211
0.825
1.085
1
−0.799
0.425
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
0.98
0.066
211
0.859
1.118
1
−0.302
0.763
Ant / Post
0.927
0.064
211
0.809
1.062
1
−1.096
0.275
Med / Post
0.946
0.066
211
0.825
1.085
1
−0.799
0.425
- 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
1.151
0.093
211
0.98
1.351
IH
1.303
0.118
211
1.09
1.557
Condition
response
SE
df
lower.CL
upper.CL
N
1.151
0.093
211
0.98
1.351
IH
1.303
0.118
211
1.09
1.557
Condition
response
SE
df
lower.CL
upper.CL
N
1.345
0.109
211
1.148
1.577
IH
1.161
0.108
211
0.967
1.393
Condition
response
SE
df
lower.CL
upper.CL
N
1.345
0.109
211
1.148
1.577
IH
1.161
0.108
211
0.967
1.393
Condition
response
SE
df
lower.CL
upper.CL
N
1.427
0.117
211
1.214
1.678
IH
1.222
0.119
211
1.009
1.48
Condition
response
SE
df
lower.CL
upper.CL
N
1.427
0.117
211
1.214
1.678
IH
1.222
0.119
211
1.009
1.48
- 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.883
0.108
211
0.695
1.123
1
−1.02
0.309
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.883
0.108
211
0.695
1.123
1
−1.02
0.309
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.159
0.142
211
0.91
1.477
1
1.202
0.231
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.159
0.142
211
0.91
1.477
1
1.202
0.231
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.168
0.149
211
0.909
1.502
1
1.22
0.224
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.168
0.149
211
0.909
1.502
1
1.22
0.224
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
emmeans ( mod , specs = emmeans_formula , type = "response" ) |>
contrast ( interaction = "pairwise" , by = NULL , adjust = "none" , infer = T )
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.762
0.102
211
0.585
0.993
1
−2.024
0.044 *
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.762
0.102
211
0.585
0.993
1
−2.024
0.044 *
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.756
0.105
211
0.575
0.995
1
−2.007
0.046 *
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.756
0.105
211
0.575
0.995
1
−2.007
0.046 *
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.992
0.138
211
0.755
1.305
1
−0.056
0.955
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.992
0.138
211
0.755
1.305
1
−0.056
0.955
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
❖ Boxplot:
Purkinje dendrite volume (per Purkinje cell body)
Data Exploration
❖ Distribution:
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
0.759
0.25
0.063
0.329
0.285
0.321
1.637
1.025
2.557
41
IH
1.196
0.6
0.36
0.501
1.012
0.447
2.5
0.763
−0.592
35
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
0.759
0.25
0.063
0.329
0.285
0.321
1.637
1.025
2.557
41
IH
1.196
0.6
0.36
0.501
1.012
0.447
2.5
0.763
−0.592
35
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
0.757
0.371
0.138
0.491
0.452
0.126
1.921
1.26
2.163
43
IH
1.015
0.515
0.265
0.507
0.393
0.45
2.375
1.342
0.951
31
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
0.757
0.371
0.138
0.491
0.452
0.126
1.921
1.26
2.163
43
IH
1.015
0.515
0.265
0.507
0.393
0.45
2.375
1.342
0.951
31
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
0.761
0.323
0.105
0.425
0.414
0.147
1.689
0.723
0.775
39
IH
1.234
0.516
0.266
0.418
0.884
0.44
2.087
0.089
−1.109
28
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
0.761
0.323
0.105
0.425
0.414
0.147
1.689
0.723
0.775
39
IH
1.234
0.516
0.266
0.418
0.884
0.44
2.087
0.089
−1.109
28
Models & Diagnostics
Exploring some Generalized Linear (Mixed) model candidates:
❖ Model call:
```{r}
glmmTMB (formula = Vol_DD_per_cell ~ Condition * Z + (1 | Mouse),
data = data, family = Gamma ("log" ), REML = TRUE , ziformula = ~ 0 ,
dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
RMSE
Sigma
227.18
227.87
254.22
0.19
0.43
0.44
AIC
AICc
BIC
R2_conditional
R2_marginal
RMSE
Sigma
227.18
227.87
254.22
0.19
0.43
0.44
❖ 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 = Vol_DD_per_cell ~ Condition * Z + (1 | Mouse),
data = data, family = gaussian ("log" ), REML = TRUE , ziformula = ~ 0 ,
dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
RMSE
Sigma
291.16
291.86
318.20
0.19
0.43
0.43
AIC
AICc
BIC
R2_conditional
R2_marginal
RMSE
Sigma
291.16
291.86
318.20
0.19
0.43
0.43
❖ 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:
Effects Analysis
```{r}
glmmTMB (formula = Vol_DD_per_cell ~ Condition * Z + (1 | Mouse),
data = data, family = Gamma ("log" ), REML = TRUE , ziformula = ~ 0 ,
dispformula = ~ 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.932
0.028
(0.88, 0.99)
-2.337
0.019 *
Condition1
0.814
0.025
(0.77, 0.86)
-6.795
< .001
Z1
1.023
0.043
(0.94, 1.11)
0.531
0.595
Z2
0.941
0.040
(0.87, 1.02)
-1.438
0.150
Condition1 * Z1
0.978
0.041
(0.90, 1.06)
-0.532
0.595
Condition1 * Z2
1.061
0.045
(0.98, 1.15)
1.384
0.166
Model: Vol_DD_per_cell ~ Condition * Z (217 Observations)
Parameter
Coefficient
SE
95% CI
z
p
(Intercept)
0.932
0.028
(0.88, 0.99)
-2.337
0.019 *
Condition1
0.814
0.025
(0.77, 0.86)
-6.795
< .001
Z1
1.023
0.043
(0.94, 1.11)
0.531
0.595
Z2
0.941
0.040
(0.87, 1.02)
-1.438
0.150
Condition1 * Z1
0.978
0.041
(0.90, 1.06)
-0.532
0.595
Condition1 * Z2
1.061
0.045
(0.98, 1.15)
1.384
0.166
Model: Vol_DD_per_cell ~ Condition * Z (217 Observations)
❖ Main effects (Wald Chi-Square) :
car :: Anova ( mod , type = 3 )
term
statistic
df
p.value
Condition
46.18
1
<0.001 ***
Z
2.09
2
0.350
Condition:Z
1.93
2
0.380
term
statistic
df
p.value
Condition
46.18
1
<0.001 ***
Z
2.09
2
0.350
Condition:Z
1.93
2
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
5
212.36
229.26
-101.18
202.36
mod_full
8
198.25
225.29
-91.13
182.25
20.11
3
<0.001 ***
model
df
aic
bic
log_lik
deviance
chisq
chi_df
pr_chisq
mod_reduced
5
212.36
229.26
-101.18
202.36
mod_full
8
198.25
225.29
-91.13
182.25
20.11
3
<0.001 ***
Our LRT()
method removes the predictor plus all its interactions
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.759
0.03
215
0.702
0.821
IH
1.144
0.052
215
1.046
1.252
Condition
response
SE
df
lower.CL
upper.CL
N
0.759
0.03
215
0.702
0.821
IH
1.144
0.052
215
1.046
1.252
- Results are averaged over the levels of: Z
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
❖ Contrasts:
emmeans ( mod , specs = pred , 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.663
0.04
215
0.589
0.747
1
−6.795
<0.001 ***
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.663
0.04
215
0.589
0.747
1
−6.795
<0.001 ***
- Results are averaged over the levels of: Z
- 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" )
Z
response
SE
df
lower.CL
upper.CL
Ant
0.953
0.048
215
0.862
1.053
Med
0.877
0.045
215
0.792
0.971
Post
0.969
0.053
215
0.87
1.078
Z
response
SE
df
lower.CL
upper.CL
Ant
0.953
0.048
215
0.862
1.053
Med
0.877
0.045
215
0.792
0.971
Post
0.969
0.053
215
0.87
1.078
- 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 = "pairwise" , adjust = "none" , infer = TRUE )
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
1.087
0.079
215
0.942
1.254
1
1.152
0.250
Ant / Post
0.984
0.073
215
0.85
1.139
1
−0.222
0.825
Med / Post
0.905
0.068
215
0.78
1.049
1
−1.33
0.185
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
1.087
0.079
215
0.942
1.254
1
1.152
0.250
Ant / Post
0.984
0.073
215
0.85
1.139
1
−0.222
0.825
Med / Post
0.905
0.068
215
0.78
1.049
1
−1.33
0.185
- 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.759
0.052
215
0.663
0.869
IH
1.196
0.089
215
1.033
1.385
Condition
response
SE
df
lower.CL
upper.CL
N
0.759
0.052
215
0.663
0.869
IH
1.196
0.089
215
1.033
1.385
Condition
response
SE
df
lower.CL
upper.CL
N
0.757
0.051
215
0.664
0.864
IH
1.015
0.08
215
0.869
1.186
Condition
response
SE
df
lower.CL
upper.CL
N
0.757
0.051
215
0.664
0.864
IH
1.015
0.08
215
0.869
1.186
Condition
response
SE
df
lower.CL
upper.CL
N
0.761
0.054
215
0.662
0.874
IH
1.234
0.102
215
1.047
1.453
Condition
response
SE
df
lower.CL
upper.CL
N
0.761
0.054
215
0.662
0.874
IH
1.234
0.102
215
1.047
1.453
- 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.634
0.064
215
0.52
0.774
1
−4.498
<0.001 ***
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.634
0.064
215
0.52
0.774
1
−4.498
<0.001 ***
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.746
0.077
215
0.608
0.915
1
−2.826
0.005 **
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.746
0.077
215
0.608
0.915
1
−2.826
0.005 **
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.617
0.067
215
0.498
0.764
1
−4.438
<0.001 ***
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.617
0.067
215
0.498
0.764
1
−4.438
<0.001 ***
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
emmeans ( mod , specs = emmeans_formula , type = "response" ) |>
contrast ( interaction = "pairwise" , by = NULL , adjust = "none" , infer = T )
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.85
0.123
215
0.639
1.131
1
−1.121
0.263
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.85
0.123
215
0.639
1.131
1
−1.121
0.263
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.029
0.153
215
0.767
1.379
1
0.19
0.849
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.029
0.153
215
0.767
1.379
1
0.19
0.849
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.21
0.182
215
0.9
1.627
1
1.268
0.206
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.21
0.182
215
0.9
1.627
1
1.268
0.206
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
❖ Boxplot:
Molecular layer area
Data Exploration
❖ Distribution:
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
2.616
0.367
0.135
0.14
0.456
1.695
3.167
−1.055
0.297
41
IH
2.733
0.256
0.065
0.094
0.37
2.148
3.149
−0.669
−0.155
36
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
2.616
0.367
0.135
0.14
0.456
1.695
3.167
−1.055
0.297
41
IH
2.733
0.256
0.065
0.094
0.37
2.148
3.149
−0.669
−0.155
36
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
2.697
0.297
0.088
0.11
0.306
1.653
3.079
−1.385
2.465
43
IH
2.63
0.333
0.111
0.127
0.417
1.745
3.024
−1.008
0.409
32
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
2.697
0.297
0.088
0.11
0.306
1.653
3.079
−1.385
2.465
43
IH
2.63
0.333
0.111
0.127
0.417
1.745
3.024
−1.008
0.409
32
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
2.749
0.296
0.088
0.108
0.39
1.802
3.12
−1.321
2.033
39
IH
2.701
0.321
0.103
0.119
0.494
1.943
3.096
−1
−0.046
28
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
2.749
0.296
0.088
0.108
0.39
1.802
3.12
−1.321
2.033
39
IH
2.701
0.321
0.103
0.119
0.494
1.943
3.096
−1
−0.046
28
Models & Diagnostics
Exploring some Generalized Linear (Mixed) model candidates:
❖ Model call:
```{r}
glmmTMB (formula = A_ML ~ Condition * Z + (1 | Mouse), data = data,
family = Gamma ("log" ), REML = TRUE , ziformula = ~ 0 , dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
190.47
191.15
217.58
0.03
0.02
8.78e-03
0.31
0.12
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
190.47
191.15
217.58
0.03
0.02
8.78e-03
0.31
0.12
❖ 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 = A_ML ~ Condition * Z + (1 | Mouse), data = data,
family = gaussian ("log" ), REML = TRUE , ziformula = ~ 0 , dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
167.92
168.61
195.03
5.32e-03
3.28e-03
2.05e-03
0.31
0.31
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
167.92
168.61
195.03
5.32e-03
3.28e-03
2.05e-03
0.31
0.31
❖ 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:
Effects Analysis
```{r}
glmmTMB (formula = A_ML ~ Condition * Z + (1 | Mouse), data = data,
family = Gamma ("log" ), REML = TRUE , ziformula = ~ 0 , dispformula = ~ 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.687
0.026
(2.64, 2.74)
103.920
< .001
Condition1
1.000
0.010
(0.98, 1.02)
-0.030
0.976
Z1
0.995
0.012
(0.97, 1.02)
-0.454
0.650
Z2
0.991
0.012
(0.97, 1.01)
-0.737
0.461
Condition1 * Z1
0.980
0.012
(0.96, 1.00)
-1.723
0.085
Condition1 * Z2
1.012
0.012
(0.99, 1.04)
1.043
0.297
Model: A_ML ~ Condition * Z (219 Observations)
Parameter
Coefficient
SE
95% CI
z
p
(Intercept)
2.687
0.026
(2.64, 2.74)
103.920
< .001
Condition1
1.000
0.010
(0.98, 1.02)
-0.030
0.976
Z1
0.995
0.012
(0.97, 1.02)
-0.454
0.650
Z2
0.991
0.012
(0.97, 1.01)
-0.737
0.461
Condition1 * Z1
0.980
0.012
(0.96, 1.00)
-1.723
0.085
Condition1 * Z2
1.012
0.012
(0.99, 1.04)
1.043
0.297
Model: A_ML ~ Condition * Z (219 Observations)
❖ Main effects (Wald Chi-Square) :
car :: Anova ( mod , type = 3 )
term
statistic
df
p.value
Condition
9.22e-04
1
0.980
Z
1.36
2
0.510
Condition:Z
3.04
2
0.220
term
statistic
df
p.value
Condition
9.22e-04
1
0.980
Z
1.36
2
0.510
Condition:Z
3.04
2
0.220
❖ Main effects (Likelihood Ratio Test) :
LRT ( mod , pred = "Condition" )
model
df
aic
bic
log_lik
deviance
chisq
chi_df
pr_chisq
mod_reduced
5
143.92
160.87
-66.96
133.92
mod_full
8
146.40
173.51
-65.20
130.40
3.52
3
0.320
model
df
aic
bic
log_lik
deviance
chisq
chi_df
pr_chisq
mod_reduced
5
143.92
160.87
-66.96
133.92
mod_full
8
146.40
173.51
-65.20
130.40
3.52
3
0.320
Our LRT()
method removes the predictor plus all its interactions
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
2.686
0.034
217
2.621
2.753
IH
2.688
0.038
217
2.613
2.765
Condition
response
SE
df
lower.CL
upper.CL
N
2.686
0.034
217
2.621
2.753
IH
2.688
0.038
217
2.613
2.765
- Results are averaged over the levels of: Z
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
❖ Contrasts:
emmeans ( mod , specs = pred , 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.999
0.019
217
0.963
1.038
1
−0.03
0.976
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.999
0.019
217
0.963
1.038
1
−0.03
0.976
- Results are averaged over the levels of: Z
- 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" )
Z
response
SE
df
lower.CL
upper.CL
Ant
2.673
0.04
217
2.596
2.752
Med
2.664
0.04
217
2.586
2.744
Post
2.725
0.043
217
2.641
2.812
Z
response
SE
df
lower.CL
upper.CL
Ant
2.673
0.04
217
2.596
2.752
Med
2.664
0.04
217
2.586
2.744
Post
2.725
0.043
217
2.641
2.812
- 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 = "pairwise" , adjust = "none" , infer = TRUE )
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
1.003
0.02
217
0.964
1.044
1
0.168
0.867
Ant / Post
0.981
0.02
217
0.941
1.022
1
−0.932
0.352
Med / Post
0.977
0.021
217
0.938
1.019
1
−1.088
0.278
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
1.003
0.02
217
0.964
1.044
1
0.168
0.867
Ant / Post
0.981
0.02
217
0.941
1.022
1
−0.932
0.352
Med / Post
0.977
0.021
217
0.938
1.019
1
−1.088
0.278
- 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
2.617
0.053
217
2.515
2.723
IH
2.729
0.06
217
2.614
2.85
Condition
response
SE
df
lower.CL
upper.CL
N
2.617
0.053
217
2.515
2.723
IH
2.729
0.06
217
2.614
2.85
Condition
response
SE
df
lower.CL
upper.CL
N
2.696
0.053
217
2.593
2.803
IH
2.632
0.06
217
2.516
2.753
Condition
response
SE
df
lower.CL
upper.CL
N
2.696
0.053
217
2.593
2.803
IH
2.632
0.06
217
2.516
2.753
Condition
response
SE
df
lower.CL
upper.CL
N
2.747
0.057
217
2.638
2.861
IH
2.703
0.066
217
2.577
2.836
Condition
response
SE
df
lower.CL
upper.CL
N
2.747
0.057
217
2.638
2.861
IH
2.703
0.066
217
2.577
2.836
- 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.959
0.029
217
0.904
1.017
1
−1.4
0.163
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.959
0.029
217
0.904
1.017
1
−1.4
0.163
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.025
0.031
217
0.965
1.087
1
0.802
0.423
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.025
0.031
217
0.965
1.087
1
0.802
0.423
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.016
0.033
217
0.954
1.082
1
0.501
0.617
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.016
0.033
217
0.954
1.082
1
0.501
0.617
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
emmeans ( mod , specs = emmeans_formula , type = "response" ) |>
contrast ( interaction = "pairwise" , by = NULL , adjust = "none" , infer = T )
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.936
0.038
217
0.863
1.015
1
−1.616
0.108
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.936
0.038
217
0.863
1.015
1
−1.616
0.108
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.944
0.04
217
0.868
1.026
1
−1.366
0.173
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.944
0.04
217
0.868
1.026
1
−1.366
0.173
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.008
0.042
217
0.928
1.095
1
0.195
0.846
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.008
0.042
217
0.928
1.095
1
0.195
0.846
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
❖ Boxplot:
Molecular layer thickness
Data Exploration
❖ Distribution:
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
134.994
18.948
359.011
0.14
23.557
87.509
163.477
−1.055
0.297
41
IH
141.071
13.205
174.359
0.094
19.086
110.876
162.531
−0.669
−0.155
36
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
134.994
18.948
359.011
0.14
23.557
87.509
163.477
−1.055
0.297
41
IH
141.071
13.205
174.359
0.094
19.086
110.876
162.531
−0.669
−0.155
36
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
139.183
15.339
235.29
0.11
15.799
85.333
158.936
−1.385
2.465
43
IH
135.74
17.201
295.878
0.127
21.499
90.063
156.097
−1.008
0.409
32
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
139.183
15.339
235.29
0.11
15.799
85.333
158.936
−1.385
2.465
43
IH
135.74
17.201
295.878
0.127
21.499
90.063
156.097
−1.008
0.409
32
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
141.88
15.27
233.172
0.108
20.151
92.996
161.017
−1.321
2.033
39
IH
139.42
16.558
274.177
0.119
25.52
100.281
159.787
−1
−0.046
28
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
141.88
15.27
233.172
0.108
20.151
92.996
161.017
−1.321
2.033
39
IH
139.42
16.558
274.177
0.119
25.52
100.281
159.787
−1
−0.046
28
Models & Diagnostics
Exploring some Generalized Linear (Mixed) model candidates:
❖ Model call:
```{r}
glmmTMB (formula = Thick_ML ~ Condition * Z + (1 | Mouse), data = data,
family = Gamma ("log" ), REML = TRUE , ziformula = ~ 0 , dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
1917.84
1918.52
1944.95
0.03
0.02
8.78e-03
15.86
0.12
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
1917.84
1918.52
1944.95
0.03
0.02
8.78e-03
15.86
0.12
❖ 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 = Thick_ML ~ Condition * Z + (1 | Mouse), data = data,
family = gaussian ("log" ), REML = TRUE , ziformula = ~ 0 , dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
1895.29
1895.98
1922.40
2.01e-06
1.24e-06
7.70e-07
15.82
16.10
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
1895.29
1895.98
1922.40
2.01e-06
1.24e-06
7.70e-07
15.82
16.10
❖ 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:
Effects Analysis
```{r}
glmmTMB (formula = Thick_ML ~ Condition * Z + (1 | Mouse), data = data,
family = Gamma ("log" ), REML = TRUE , ziformula = ~ 0 , dispformula = ~ 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)
138.686
1.319
(136.12, 141.30)
518.550
< .001
Condition1
1.000
0.010
(0.98, 1.02)
-0.030
0.976
Z1
0.995
0.012
(0.97, 1.02)
-0.454
0.650
Z2
0.991
0.012
(0.97, 1.01)
-0.737
0.461
Condition1 * Z1
0.980
0.012
(0.96, 1.00)
-1.723
0.085
Condition1 * Z2
1.012
0.012
(0.99, 1.04)
1.043
0.297
Model: Thick_ML ~ Condition * Z (219 Observations)
Parameter
Coefficient
SE
95% CI
z
p
(Intercept)
138.686
1.319
(136.12, 141.30)
518.550
< .001
Condition1
1.000
0.010
(0.98, 1.02)
-0.030
0.976
Z1
0.995
0.012
(0.97, 1.02)
-0.454
0.650
Z2
0.991
0.012
(0.97, 1.01)
-0.737
0.461
Condition1 * Z1
0.980
0.012
(0.96, 1.00)
-1.723
0.085
Condition1 * Z2
1.012
0.012
(0.99, 1.04)
1.043
0.297
Model: Thick_ML ~ Condition * Z (219 Observations)
❖ Main effects (Wald Chi-Square) :
car :: Anova ( mod , type = 3 )
term
statistic
df
p.value
Condition
9.22e-04
1
0.980
Z
1.36
2
0.510
Condition:Z
3.04
2
0.220
term
statistic
df
p.value
Condition
9.22e-04
1
0.980
Z
1.36
2
0.510
Condition:Z
3.04
2
0.220
❖ Main effects (Likelihood Ratio Test) :
LRT ( mod , pred = "Condition" )
model
df
aic
bic
log_lik
deviance
chisq
chi_df
pr_chisq
mod_reduced
5
1871.29
1888.24
-930.65
1861.29
mod_full
8
1873.77
1900.89
-928.89
1857.77
3.52
3
0.320
model
df
aic
bic
log_lik
deviance
chisq
chi_df
pr_chisq
mod_reduced
5
1871.29
1888.24
-930.65
1861.29
mod_full
8
1873.77
1900.89
-928.89
1857.77
3.52
3
0.320
Our LRT()
method removes the predictor plus all its interactions
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
138.646
1.739
217
135.26
142.116
IH
138.726
1.984
217
134.87
142.692
Condition
response
SE
df
lower.CL
upper.CL
N
138.646
1.739
217
135.26
142.116
IH
138.726
1.984
217
134.87
142.692
- Results are averaged over the levels of: Z
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
❖ Contrasts:
emmeans ( mod , specs = pred , 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.999
0.019
217
0.963
1.038
1
−0.03
0.976
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.999
0.019
217
0.963
1.038
1
−0.03
0.976
- Results are averaged over the levels of: Z
- 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" )
Z
response
SE
df
lower.CL
upper.CL
Ant
137.946
2.044
217
133.977
142.034
Med
137.478
2.072
217
133.455
141.623
Post
140.653
2.237
217
136.313
145.132
Z
response
SE
df
lower.CL
upper.CL
Ant
137.946
2.044
217
133.977
142.034
Med
137.478
2.072
217
133.455
141.623
Post
140.653
2.237
217
136.313
145.132
- 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 = "pairwise" , adjust = "none" , infer = TRUE )
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
1.003
0.02
217
0.964
1.044
1
0.168
0.867
Ant / Post
0.981
0.02
217
0.941
1.022
1
−0.932
0.352
Med / Post
0.977
0.021
217
0.938
1.019
1
−1.088
0.278
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
1.003
0.02
217
0.964
1.044
1
0.168
0.867
Ant / Post
0.981
0.02
217
0.941
1.022
1
−0.932
0.352
Med / Post
0.977
0.021
217
0.938
1.019
1
−1.088
0.278
- 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
135.083
2.728
217
129.812
140.568
IH
140.871
3.087
217
134.916
147.089
Condition
response
SE
df
lower.CL
upper.CL
N
135.083
2.728
217
129.812
140.568
IH
140.871
3.087
217
134.916
147.089
Condition
response
SE
df
lower.CL
upper.CL
N
139.153
2.74
217
133.855
144.66
IH
135.824
3.104
217
129.843
142.081
Condition
response
SE
df
lower.CL
upper.CL
N
139.153
2.74
217
133.855
144.66
IH
135.824
3.104
217
129.843
142.081
Condition
response
SE
df
lower.CL
upper.CL
N
141.784
2.927
217
136.132
147.671
IH
139.531
3.393
217
133.001
146.382
Condition
response
SE
df
lower.CL
upper.CL
N
141.784
2.927
217
136.132
147.671
IH
139.531
3.393
217
133.001
146.382
- 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.959
0.029
217
0.904
1.017
1
−1.4
0.163
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.959
0.029
217
0.904
1.017
1
−1.4
0.163
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.025
0.031
217
0.965
1.087
1
0.802
0.423
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.025
0.031
217
0.965
1.087
1
0.802
0.423
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.016
0.033
217
0.954
1.082
1
0.501
0.617
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.016
0.033
217
0.954
1.082
1
0.501
0.617
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
emmeans ( mod , specs = emmeans_formula , type = "response" ) |>
contrast ( interaction = "pairwise" , by = NULL , adjust = "none" , infer = T )
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.936
0.038
217
0.863
1.015
1
−1.616
0.108
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.936
0.038
217
0.863
1.015
1
−1.616
0.108
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.944
0.04
217
0.868
1.026
1
−1.366
0.173
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.944
0.04
217
0.868
1.026
1
−1.366
0.173
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.008
0.042
217
0.928
1.095
1
0.195
0.846
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.008
0.042
217
0.928
1.095
1
0.195
0.846
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
❖ Boxplot:
Number of Purkinje cell bodies
Data Exploration
❖ Distribution:
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
9.805
1.913
3.661
0.195
2.5
7
17
1.373
3.766
41
IH
9.457
1.975
3.903
0.209
3
5
14
0.262
0.001
35
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
9.805
1.913
3.661
0.195
2.5
7
17
1.373
3.766
41
IH
9.457
1.975
3.903
0.209
3
5
14
0.262
0.001
35
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
10.349
2.654
7.042
0.256
4
5
16
0.31
−0.288
43
IH
9.968
1.853
3.432
0.186
2
6
15
0.286
0.66
31
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
10.349
2.654
7.042
0.256
4
5
16
0.31
−0.288
43
IH
9.968
1.853
3.432
0.186
2
6
15
0.286
0.66
31
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
9.41
3.168
10.038
0.337
2
4
18
0.968
1.003
39
IH
9.786
3.071
9.434
0.314
3
5
21
1.845
5.682
28
Condition
Mean
SD
Variance
CoV
IQR
Min
Max
Skewness
Kurtosis
n
N
9.41
3.168
10.038
0.337
2
4
18
0.968
1.003
39
IH
9.786
3.071
9.434
0.314
3
5
21
1.845
5.682
28
Models & Diagnostics
Exploring some Generalized Linear (Mixed) model candidates:
❖ Model call:
```{r}
glmmTMB (formula = N_CC ~ Condition * Z + (1 | Mouse), data = data,
family = genpois ("log" ), control = glmmTMBControl (optimizer = optim,
optArgs = list (method = "BFGS" )), REML = TRUE , ziformula = ~ 0 ,
dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
Score_log
Score_spherical
1052.49
1053.18
1079.53
0.02
0.02
4.61e-04
2.46
0.67
-2.35
0.07
AIC
AICc
BIC
R2_conditional
R2_marginal
ICC
RMSE
Sigma
Score_log
Score_spherical
1052.49
1053.18
1079.53
0.02
0.02
4.61e-04
2.46
0.67
-2.35
0.07
❖ Residuals:
performance :: check_model (
mod , panel = FALSE ,
check = c ( "pp_check" , "qq" , "reqq" , "linearity" , "homogeneity" )
)
# Overdispersion test
dispersion ratio = 0.930
Pearson's Chi-Squared = 200.051
p-value = 0.76
❖ 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 = N_CC ~ Condition * Z + (1 | Mouse), data = data,
family = nbinom2 ("log" ), control = glmmTMBControl (optimizer = optim,
optArgs = list (method = "BFGS" )), REML = TRUE , ziformula = ~ 0 ,
dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
RMSE
Sigma
Score_log
Score_spherical
1069.24
1069.94
1096.28
0.01
2.46
1.20e+09
-3.04
0.07
AIC
AICc
BIC
R2_conditional
R2_marginal
RMSE
Sigma
Score_log
Score_spherical
1069.24
1069.94
1096.28
0.01
2.46
1.20e+09
-3.04
0.07
❖ Residuals:
performance :: check_model (
mod , panel = FALSE ,
check = c ( "pp_check" , "qq" , "reqq" , "linearity" , "homogeneity" )
)
# Overdispersion test
dispersion ratio = 0.625
Pearson's Chi-Squared = 134.424
p-value = 1
❖ 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 = N_CC ~ Condition * Z + (1 | Mouse), data = data,
family = poisson ("log" ), control = glmmTMBControl (optimizer = optim,
optArgs = list (method = "BFGS" )), REML = TRUE , ziformula = ~ 0 ,
dispformula = ~ 1 )
```
❖ Performance:
AIC
AICc
BIC
R2_conditional
R2_marginal
RMSE
Sigma
Score_log
Score_spherical
1067.24
1067.78
1090.90
0.01
2.46
1
-2.35
0.07
AIC
AICc
BIC
R2_conditional
R2_marginal
RMSE
Sigma
Score_log
Score_spherical
1067.24
1067.78
1090.90
0.01
2.46
1
-2.35
0.07
❖ Residuals:
performance :: check_model (
mod , panel = FALSE ,
check = c ( "pp_check" , "qq" , "reqq" , "linearity" , "homogeneity" )
)
# Overdispersion test
dispersion ratio = 0.622
Pearson's Chi-Squared = 134.433
p-value = 1
❖ Predictions:
Simulating data from the model for pseudo “Posterior Predictive” plots.
♦ Simulated data vs observed data:
♦ Simulated statistics vs observed ones:
❖ Potential outliers:
Effects Analysis
```{r}
glmmTMB (formula = N_CC ~ Condition * Z + (1 | Mouse), data = data,
family = genpois ("log" ), control = glmmTMBControl (optimizer = optim,
optArgs = list (method = "BFGS" )), REML = TRUE , ziformula = ~ 0 ,
dispformula = ~ 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)
9.788
0.177
(9.45, 10.14)
126.010
< .001
Condition1
1.007
0.018
(0.97, 1.04)
0.400
0.689
Z1
0.977
0.025
(0.93, 1.03)
-0.906
0.365
Z2
1.034
0.026
(0.98, 1.09)
1.324
0.186
Condition1 * Z1
1.011
0.025
(0.96, 1.06)
0.428
0.668
Condition1 * Z2
1.015
0.025
(0.97, 1.07)
0.609
0.543
Model: N_CC ~ Condition * Z (217 Observations)
Parameter
Coefficient
SE
95% CI
z
p
(Intercept)
9.788
0.177
(9.45, 10.14)
126.010
< .001
Condition1
1.007
0.018
(0.97, 1.04)
0.400
0.689
Z1
0.977
0.025
(0.93, 1.03)
-0.906
0.365
Z2
1.034
0.026
(0.98, 1.09)
1.324
0.186
Condition1 * Z1
1.011
0.025
(0.96, 1.06)
0.428
0.668
Condition1 * Z2
1.015
0.025
(0.97, 1.07)
0.609
0.543
Model: N_CC ~ Condition * Z (217 Observations)
❖ Main effects (Wald Chi-Square) :
car :: Anova ( mod , type = 3 )
term
statistic
df
p.value
Condition
0.16
1
0.690
Z
1.86
2
0.390
Condition:Z
1.03
2
0.600
term
statistic
df
p.value
Condition
0.16
1
0.690
Z
1.86
2
0.390
Condition:Z
1.03
2
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
5
1012.57
1029.47
-501.28
1002.57
mod_full
8
1017.28
1044.32
-500.64
1001.28
1.28
3
0.730
model
df
aic
bic
log_lik
deviance
chisq
chi_df
pr_chisq
mod_reduced
5
1012.57
1029.47
-501.28
1002.57
mod_full
8
1017.28
1044.32
-500.64
1001.28
1.28
3
0.730
Our LRT()
method removes the predictor plus all its interactions
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
9.859
0.233
215
9.409
10.33
IH
9.717
0.265
215
9.208
10.255
Condition
response
SE
df
lower.CL
upper.CL
N
9.859
0.233
215
9.409
10.33
IH
9.717
0.265
215
9.208
10.255
- Results are averaged over the levels of: Z
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
❖ Contrasts:
emmeans ( mod , specs = pred , type = "response" ) |>
contrast ( method = "pairwise" , adjust = "none" , infer = TRUE )
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.015
0.037
215
0.945
1.089
1
0.4
0.689
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.015
0.037
215
0.945
1.089
1
0.4
0.689
- Results are averaged over the levels of: Z
- 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" )
Z
response
SE
df
lower.CL
upper.CL
Ant
9.567
0.293
215
9.007
10.161
Med
10.118
0.308
215
9.529
10.744
Post
9.687
0.315
215
9.085
10.328
Z
response
SE
df
lower.CL
upper.CL
Ant
9.567
0.293
215
9.007
10.161
Med
10.118
0.308
215
9.529
10.744
Post
9.687
0.315
215
9.085
10.328
- 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 = "pairwise" , adjust = "none" , infer = TRUE )
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
0.945
0.041
215
0.869
1.029
1
−1.302
0.194
Ant / Post
0.988
0.044
215
0.905
1.078
1
−0.279
0.780
Med / Post
1.045
0.046
215
0.957
1.14
1
0.982
0.327
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
Ant / Med
0.945
0.041
215
0.869
1.029
1
−1.302
0.194
Ant / Post
0.988
0.044
215
0.905
1.078
1
−0.279
0.780
Med / Post
1.045
0.046
215
0.957
1.14
1
0.982
0.327
- 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
9.74
0.4
215
8.982
10.562
IH
9.396
0.426
215
8.594
10.274
Condition
response
SE
df
lower.CL
upper.CL
N
9.74
0.4
215
8.982
10.562
IH
9.396
0.426
215
8.594
10.274
Condition
response
SE
df
lower.CL
upper.CL
N
10.348
0.402
215
9.586
11.171
IH
9.893
0.464
215
9.019
10.852
Condition
response
SE
df
lower.CL
upper.CL
N
10.348
0.402
215
9.586
11.171
IH
9.893
0.464
215
9.019
10.852
Condition
response
SE
df
lower.CL
upper.CL
N
9.506
0.403
215
8.744
10.334
IH
9.87
0.484
215
8.961
10.872
Condition
response
SE
df
lower.CL
upper.CL
N
9.506
0.403
215
8.744
10.334
IH
9.87
0.484
215
8.961
10.872
- 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
1.037
0.063
215
0.919
1.169
1
0.588
0.557
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.037
0.063
215
0.919
1.169
1
0.588
0.557
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.046
0.064
215
0.928
1.179
1
0.738
0.461
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.046
0.064
215
0.928
1.179
1
0.738
0.461
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.963
0.062
215
0.848
1.094
1
−0.583
0.560
contrast
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.963
0.062
215
0.848
1.094
1
−0.583
0.560
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
emmeans ( mod , specs = emmeans_formula , type = "response" ) |>
contrast ( interaction = "pairwise" , by = NULL , adjust = "none" , infer = T )
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.991
0.085
215
0.836
1.174
1
−0.105
0.917
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
0.991
0.085
215
0.836
1.174
1
−0.105
0.917
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.076
0.095
215
0.904
1.282
1
0.83
0.408
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.076
0.095
215
0.904
1.282
1
0.83
0.408
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.086
0.096
215
0.912
1.293
1
0.933
0.352
Condition
ratio
SE
df
lower.CL
upper.CL
null
t.ratio
p.value
N / IH
1.086
0.096
215
0.912
1.293
1
0.933
0.352
- Confidence level used: 0.95
- Intervals are back-transformed from the log scale
- Tests are performed on the log scale
❖ Boxplot: