Additionnal content for "Group Cohesiveness in Robotic Swarms"

Rebecca Stower, Elisabetta Zibetti and David St-Onge

#Session Paramters

options(scipen=999, digits = 2)

Import Data

Descriptive Stats

dat_dvs <- dat %>%
  select(synchro, group, react, figure, suivre)
dat_dvs <- as.data.frame(dat_dvs)

round(stat.desc(dat_dvs, norm = TRUE), digits = 2)
##              synchro   group   react  figure  suivre
## nbr.val       877.00  878.00  873.00  879.00  874.00
## nbr.null        0.00    0.00    0.00    0.00    0.00
## nbr.na          5.00    4.00    9.00    3.00    8.00
## min             1.00    1.00    1.00    1.00    1.00
## max             5.00    5.00    5.00    5.00    5.00
## range           4.00    4.00    4.00    4.00    4.00
## sum          3555.00 3254.00 3319.00 3265.00 2692.00
## median          5.00    4.00    4.00    4.00    3.00
## mean            4.05    3.71    3.80    3.71    3.08
## SE.mean         0.04    0.05    0.05    0.05    0.05
## CI.mean.0.95    0.08    0.09    0.09    0.09    0.09
## var             1.51    1.95    1.89    1.83    2.02
## std.dev         1.23    1.39    1.37    1.35    1.42
## coef.var        0.30    0.38    0.36    0.36    0.46
## skewness       -1.23   -0.77   -0.99   -0.70   -0.01
## skew.2SE       -7.43   -4.66   -5.96   -4.26   -0.06
## kurtosis        0.41   -0.74   -0.32   -0.77   -1.34
## kurt.2SE        1.23   -2.25   -0.97   -2.33   -4.05
## normtest.W      0.75    0.81    0.78    0.83    0.88
## normtest.p      0.00    0.00    0.00    0.00    0.00
dat_animation <- dat %>%
  select(animation, synchro, group, react, figure, suivre) %>%
  group_by(animation) %>%
  skim(animation, synchro, group, react, figure, suivre) %>%
  select(skim_variable, animation, numeric.mean)

dat_animation
## # A tibble: 45 x 3
##    skim_variable animation      numeric.mean
##    <chr>         <chr>                 <dbl>
##  1 synchro       battery_2              4.20
##  2 synchro       battery_3              4.38
##  3 synchro       broken_comm            3.69
##  4 synchro       close_comm             3.36
##  5 synchro       init_comm_1            4.36
##  6 synchro       init_comm_2            4.41
##  7 synchro       intervention_1         3.73
##  8 synchro       intervention_2         3.78
##  9 synchro       no_problem             4.54
## 10 group         battery_2              3.92
## # ... with 35 more rows

Correlations

dat_cor <- dat %>%
  select(init_com, fin_com, no_prob, intervention, battery, com_interrupted, synchro, group, react, figure, suivre)
dat_cor <- as.data.frame(dat_cor)

cor_matrix <- cor_mat(dat_cor, vars = NULL, method = "kendall", alternative = "two.sided", conf.level = 0.95)

cor_mark_significant(cor_matrix, cutpoints = c(0, 1e-04, 0.001, 0.01, 0.05, 1),
  symbols = c("****", "***", "**", "*", ""))
##            rowname init_com  fin_com  no_prob intervention   battery
## 1         init_com                                                  
## 2          fin_com  0.087**                                         
## 3          no_prob 0.17**** 0.29****                                
## 4     intervention  0.075**   0.066*  -0.061*                       
## 5          battery   -0.027 0.17****   -0.011     0.31****          
## 6  com_interrupted   -0.014 0.21**** 0.15****     0.15****  0.31****
## 7          synchro 0.23****     0.04 0.13****       -0.036   -0.1***
## 8            group 0.18****  -0.068*   0.056*      0.073**    -0.022
## 9            react  0.2****    0.023    0.045        0.011    -0.053
## 10          figure 0.12****   -0.036 0.095***       -0.008 -0.094***
## 11          suivre 0.11****    0.046 0.092***       -0.001    0.0014
##    com_interrupted  synchro    group    react   figure suivre
## 1                                                            
## 2                                                            
## 3                                                            
## 4                                                            
## 5                                                            
## 6                                                            
## 7        -0.12****                                           
## 8        -0.11**** 0.46****                                  
## 9          -0.063* 0.48**** 0.38****                         
## 10       -0.11**** 0.49**** 0.42****  0.4****                
## 11          -0.015 0.23**** 0.31**** 0.39**** 0.23****

LMM

dat_melt <- melt(dat, id.vars = c("subject", "animation", "activite_corporelle", "jeux_videos", "animation_numerique"), measure.vars = c("synchro", "group", "react", "figure", "suivre"))

dat_melt <- dat_melt %>%
  mutate(animation = fct_relevel(animation, c("init_comm_1", "intervention_1", "battery_2", "init_comm_2", "intervention_2", "battery_3", "no_problem", "broken_comm", "close_comm")))

model_tendance <- lmer(value ~ animation + variable + activite_corporelle + jeux_videos + animation_numerique + (1 | subject), data = dat_melt)

qqnorm(resid(model_tendance))

summary(model_tendance)
## Linear mixed model fit by REML ['lmerMod']
## Formula: value ~ animation + variable + activite_corporelle + jeux_videos +  
##     animation_numerique + (1 | subject)
##    Data: dat_melt
## 
## REML criterion at convergence: 13995
## 
## Scaled residuals: 
##    Min     1Q Median     3Q    Max 
## -3.135 -0.572  0.193  0.677  3.292 
## 
## Random effects:
##  Groups   Name        Variance Std.Dev.
##  subject  (Intercept) 0.399    0.631   
##  Residual             1.331    1.154   
## Number of obs: 4381, groups:  subject, 98
## 
## Fixed effects:
##                         Estimate Std. Error t value
## (Intercept)               4.0725     0.1814   22.45
## animationintervention_1  -0.1006     0.0741   -1.36
## animationbattery_2        0.2468     0.0739    3.34
## animationinit_comm_2      0.1614     0.0739    2.18
## animationintervention_2  -0.2257     0.0739   -3.05
## animationbattery_3        0.2533     0.0738    3.43
## animationno_problem       0.3708     0.0739    5.02
## animationbroken_comm     -0.3509     0.0740   -4.74
## animationclose_comm      -0.7418     0.0739  -10.03
## variablegroup            -0.3451     0.0551   -6.27
## variablereact            -0.2491     0.0552   -4.52
## variablefigure           -0.3377     0.0551   -6.13
## variablesuivre           -0.9720     0.0551  -17.63
## activite_corporelle       0.0495     0.0407    1.22
## jeux_videos              -0.0450     0.0404   -1.11
## animation_numerique       0.0324     0.0437    0.74
## 
## Correlation matrix not shown by default, as p = 16 > 12.
## Use print(x, correlation=TRUE)  or
##     vcov(x)        if you need it
summ(model_tendance, confint = TRUE)
## MODEL INFO:
## Observations: 4381
## Dependent Variable: value
## Type: Mixed effects linear regression 
## 
## MODEL FIT:
## AIC = 14031.15, BIC = 14146.08
## Pseudo-R² (fixed effects) = 0.12
## Pseudo-R² (total) = 0.32 
## 
## FIXED EFFECTS:
## -------------------------------------------------------------------------------
##                                  Est.    2.5%   97.5%   t val.      d.f.      p
## ----------------------------- ------- ------- ------- -------- --------- ------
## (Intercept)                      4.07    3.72    4.43    22.45    119.04   0.00
## animationintervention_1         -0.10   -0.25    0.04    -1.36   4271.29   0.17
## animationbattery_2               0.25    0.10    0.39     3.34   4271.12   0.00
## animationinit_comm_2             0.16    0.02    0.31     2.18   4271.12   0.03
## animationintervention_2         -0.23   -0.37   -0.08    -3.05   4271.14   0.00
## animationbattery_3               0.25    0.11    0.40     3.43   4271.09   0.00
## animationno_problem              0.37    0.23    0.52     5.02   4271.13   0.00
## animationbroken_comm            -0.35   -0.50   -0.21    -4.74   4271.50   0.00
## animationclose_comm             -0.74   -0.89   -0.60   -10.03   4271.13   0.00
## variablegroup                   -0.35   -0.45   -0.24    -6.27   4271.11   0.00
## variablereact                   -0.25   -0.36   -0.14    -4.52   4271.13   0.00
## variablefigure                  -0.34   -0.45   -0.23    -6.13   4271.10   0.00
## variablesuivre                  -0.97   -1.08   -0.86   -17.63   4271.12   0.00
## activite_corporelle              0.05   -0.03    0.13     1.22     94.07   0.23
## jeux_videos                     -0.05   -0.12    0.03    -1.11     94.03   0.27
## animation_numerique              0.03   -0.05    0.12     0.74     94.04   0.46
## -------------------------------------------------------------------------------
## 
## p values calculated using Satterthwaite d.f.
## 
## RANDOM EFFECTS:
## ------------------------------------
##   Group      Parameter    Std. Dev. 
## ---------- ------------- -----------
##  subject    (Intercept)     0.63    
##  Residual                   1.15    
## ------------------------------------
## 
## Grouping variables:
## ---------------------------
##   Group    # groups   ICC  
## --------- ---------- ------
##  subject      98      0.23 
## ---------------------------
tendance_lrt <- drop1(model_tendance, test = "Chisq")
tendance_lrt
## Single term deletions
## 
## Model:
## value ~ animation + variable + activite_corporelle + jeux_videos + 
##     animation_numerique + (1 | subject)
##                     npar   AIC LRT             Pr(Chi)    
## <none>                   13966                            
## animation              8 14305 354 <0.0000000000000002 ***
## variable               4 14285 327 <0.0000000000000002 ***
## activite_corporelle    1 13966   2                0.22    
## jeux_videos            1 13966   1                0.26    
## animation_numerique    1 13965   1                0.45    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
tendance_variable <- emmeans(model_tendance, "animation")
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 4381' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 4381)' or larger];
## but be warned that this may result in large computation time and memory use.
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'lmerTest.limit = 4381' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 4381)' or larger];
## but be warned that this may result in large computation time and memory use.
tendance_variable
##  animation      emmean    SE  df asymp.LCL asymp.UCL
##  init_comm_1       3.7 0.082 Inf       3.6       3.9
##  intervention_1    3.6 0.083 Inf       3.5       3.8
##  battery_2         4.0 0.082 Inf       3.8       4.1
##  init_comm_2       3.9 0.082 Inf       3.7       4.0
##  intervention_2    3.5 0.082 Inf       3.3       3.7
##  battery_3         4.0 0.082 Inf       3.8       4.1
##  no_problem        4.1 0.082 Inf       3.9       4.2
##  broken_comm       3.4 0.083 Inf       3.2       3.5
##  close_comm        3.0 0.082 Inf       2.8       3.1
## 
## Results are averaged over the levels of: variable 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95
variable_pairs <- pairs(tendance_variable)

print(summary(variable_pairs, adjust = "fdr", infer = c(TRUE, TRUE)), digits = 2)
##  contrast                        estimate    SE  df asymp.LCL asymp.UCL z.ratio
##  init_comm_1 - intervention_1        0.10 0.074 Inf     -0.14      0.34   1.400
##  init_comm_1 - battery_2            -0.25 0.074 Inf     -0.48     -0.01  -3.300
##  init_comm_1 - init_comm_2          -0.16 0.074 Inf     -0.40      0.07  -2.200
##  init_comm_1 - intervention_2        0.23 0.074 Inf     -0.01      0.46   3.100
##  init_comm_1 - battery_3            -0.25 0.074 Inf     -0.49     -0.02  -3.400
##  init_comm_1 - no_problem           -0.37 0.074 Inf     -0.61     -0.13  -5.000
##  init_comm_1 - broken_comm           0.35 0.074 Inf      0.11      0.59   4.700
##  init_comm_1 - close_comm            0.74 0.074 Inf      0.51      0.98  10.000
##  intervention_1 - battery_2         -0.35 0.074 Inf     -0.58     -0.11  -4.700
##  intervention_1 - init_comm_2       -0.26 0.074 Inf     -0.50     -0.03  -3.500
##  intervention_1 - intervention_2     0.13 0.074 Inf     -0.11      0.36   1.700
##  intervention_1 - battery_3         -0.35 0.074 Inf     -0.59     -0.12  -4.800
##  intervention_1 - no_problem        -0.47 0.074 Inf     -0.71     -0.23  -6.400
##  intervention_1 - broken_comm        0.25 0.074 Inf      0.01      0.49   3.400
##  intervention_1 - close_comm         0.64 0.074 Inf      0.40      0.88   8.600
##  battery_2 - init_comm_2             0.09 0.074 Inf     -0.15      0.32   1.200
##  battery_2 - intervention_2          0.47 0.074 Inf      0.24      0.71   6.400
##  battery_2 - battery_3              -0.01 0.074 Inf     -0.24      0.23  -0.100
##  battery_2 - no_problem             -0.12 0.074 Inf     -0.36      0.11  -1.700
##  battery_2 - broken_comm             0.60 0.074 Inf      0.36      0.83   8.100
##  battery_2 - close_comm              0.99 0.074 Inf      0.75      1.22  13.400
##  init_comm_2 - intervention_2        0.39 0.074 Inf      0.15      0.62   5.200
##  init_comm_2 - battery_3            -0.09 0.074 Inf     -0.33      0.14  -1.200
##  init_comm_2 - no_problem           -0.21 0.074 Inf     -0.45      0.03  -2.800
##  init_comm_2 - broken_comm           0.51 0.074 Inf      0.28      0.75   6.900
##  init_comm_2 - close_comm            0.90 0.074 Inf      0.67      1.14  12.200
##  intervention_2 - battery_3         -0.48 0.074 Inf     -0.72     -0.24  -6.500
##  intervention_2 - no_problem        -0.60 0.074 Inf     -0.83     -0.36  -8.100
##  intervention_2 - broken_comm        0.13 0.074 Inf     -0.11      0.36   1.700
##  intervention_2 - close_comm         0.52 0.074 Inf      0.28      0.75   7.000
##  battery_3 - no_problem             -0.12 0.074 Inf     -0.35      0.12  -1.600
##  battery_3 - broken_comm             0.60 0.074 Inf      0.37      0.84   8.200
##  battery_3 - close_comm              1.00 0.074 Inf      0.76      1.23  13.500
##  no_problem - broken_comm            0.72 0.074 Inf      0.49      0.96   9.700
##  no_problem - close_comm             1.11 0.074 Inf      0.88      1.35  15.000
##  broken_comm - close_comm            0.39 0.074 Inf      0.15      0.63   5.300
##  p.value
##   0.1900
##   <.0001
##   0.0400
##   <.0001
##   <.0001
##   <.0001
##   <.0001
##   <.0001
##   <.0001
##   <.0001
##   0.1100
##   <.0001
##   <.0001
##   <.0001
##   <.0001
##   0.2500
##   <.0001
##   0.9300
##   0.1100
##   <.0001
##   <.0001
##   <.0001
##   0.2300
##   0.0100
##   <.0001
##   <.0001
##   <.0001
##   <.0001
##   0.1100
##   <.0001
##   0.1300
##   <.0001
##   <.0001
##   <.0001
##   <.0001
##   <.0001
## 
## Results are averaged over the levels of: variable 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## Conf-level adjustment: bonferroni method for 36 estimates 
## P value adjustment: fdr method for 36 tests
dat_gg <- dat_melt %>%
  select(animation, value) %>%
  mutate(animation = fct_relevel(animation, c("no_problem", "battery_2", "battery_3", "init_comm_2", "init_comm_1", "intervention_1", "intervention_2",  "broken_comm", "close_comm")))

dat_gg %>%
  dplyr::group_by(animation) %>%
  skim(value)
Data summary
Name Piped data
Number of rows 4410
Number of columns 2
_______________________
Column type frequency:
numeric 1
________________________
Group variables animation

Variable type: numeric

skim_variable animation n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
value no_problem 3 0.99 4.1 1.4 1 4 5 5 5 ▂▁▁▃▇
value battery_2 2 1.00 4.0 1.4 1 3 5 5 5 ▂▁▂▃▇
value battery_3 0 1.00 4.0 1.3 1 3 5 5 5 ▂▁▂▃▇
value init_comm_2 2 1.00 3.9 1.3 1 3 4 5 5 ▂▁▂▅▇
value init_comm_1 3 0.99 3.7 1.4 1 3 4 5 5 ▃▂▂▅▇
value intervention_1 8 0.98 3.6 1.4 1 3 4 5 5 ▃▂▃▇▇
value intervention_2 3 0.99 3.5 1.4 1 2 4 5 5 ▃▃▃▆▇
value broken_comm 5 0.99 3.4 1.3 1 2 3 4 5 ▃▅▇▇▇
value close_comm 3 0.99 3.0 1.2 1 2 3 4 5 ▂▇▆▅▃
pwc_animation <- dat_melt %>%
  wilcox_test(value ~ animation, paired = TRUE, p.adjust.method = "fdr", detailed = TRUE) %>%
  arrange(p.adj)

gg_animations <- ggplot(dat_gg, aes(x = animation, y = value)) +
  stat_summary(fun = mean, geom = "bar", fill = "#A11A5BFF", alpha = 0.8, color = "#A11A5BFF", size = 1, width = 0.75, na.rm = TRUE) +
  stat_summary(fun.data = mean_cl_boot, geom = "errorbar", na.rm = TRUE, position=position_dodge(1), color = "#03051AFF", width=.2, size=0.8) +
  xlab("Animation") + 
  ylab("Mean Group Cohesiveness") +
  scale_x_discrete(labels = c(init_comm_1 = "Seq. 1", intervention_1 = "Seq. 2", battery_2 = "Seq. 3", init_comm_2 = "Seq. 4", intervention_2 = "Seq. 5", battery_3 = "Seq. 6", no_problem = "Seq. 7", broken_comm = "Seq. 8", close_comm = "Seq. 9")) +
  scale_y_continuous(breaks = seq(1,5,by = 1)) +
  theme(axis.text = element_text(size=16)) +
  theme(axis.title = element_text(size=16, face = "bold")) +
  theme(axis.text.y = element_text(colour = "black")) +
  theme(axis.text.x = element_text(colour = "black"))

gg_animations

Interaction

model_interact <- lmer(value ~ animation*variable + activite_corporelle + jeux_videos + animation_numerique + (1 | subject), data = dat_melt)
summ(model_interact)
## MODEL INFO:
## Observations: 4381
## Dependent Variable: value
## Type: Mixed effects linear regression 
## 
## MODEL FIT:
## AIC = 13960.97, BIC = 14280.22
## Pseudo-R² (fixed effects) = 0.15
## Pseudo-R² (total) = 0.35 
## 
## FIXED EFFECTS:
## ------------------------------------------------------------------------------
##                                                 Est.   S.E.   t val.      d.f.
## -------------------------------------------- ------- ------ -------- ---------
## (Intercept)                                     4.33   0.21    21.12    193.35
## animationintervention_1                        -0.63   0.16    -3.89   4239.12
## animationbattery_2                             -0.15   0.16    -0.95   4239.05
## animationinit_comm_2                            0.05   0.16     0.32   4239.05
## animationintervention_2                        -0.57   0.16    -3.50   4239.11
## animationbattery_3                              0.02   0.16     0.13   4239.05
## animationno_problem                             0.18   0.16     1.14   4239.05
## animationbroken_comm                           -0.66   0.16    -4.10   4239.13
## animationclose_comm                            -0.99   0.16    -6.10   4239.18
## variablegroup                                  -0.57   0.16    -3.53   4239.05
## variablereact                                  -0.57   0.16    -3.53   4239.05
## variablefigure                                 -0.43   0.16    -2.65   4239.05
## variablesuivre                                 -1.66   0.16   -10.16   4239.25
## activite_corporelle                             0.05   0.04     1.22     94.06
## jeux_videos                                    -0.04   0.04    -1.10     94.03
## animation_numerique                             0.03   0.04     0.73     94.04
## animationintervention_1:variablegroup           0.87   0.23     3.78   4239.12
## animationbattery_2:variablegroup                0.29   0.23     1.25   4239.05
## animationinit_comm_2:variablegroup             -0.05   0.23    -0.22   4239.05
## animationintervention_2:variablegroup           0.97   0.23     4.21   4239.15
## animationbattery_3:variablegroup                0.02   0.23     0.09   4239.05
## animationno_problem:variablegroup               0.29   0.23     1.25   4239.05
## animationbroken_comm:variablegroup             -0.05   0.23    -0.21   4239.05
## animationclose_comm:variablegroup              -0.27   0.23    -1.19   4239.11
## animationintervention_1:variablereact           0.58   0.23     2.50   4239.15
## animationbattery_2:variablereact                0.61   0.23     2.66   4239.08
## animationinit_comm_2:variablereact              0.20   0.23     0.87   4239.08
## animationintervention_2:variablereact           0.26   0.23     1.14   4239.08
## animationbattery_3:variablereact                0.55   0.23     2.41   4239.05
## animationno_problem:variablereact              -0.11   0.23    -0.50   4239.12
## animationbroken_comm:variablereact              0.39   0.23     1.68   4239.05
## animationclose_comm:variablereact               0.43   0.23     1.88   4239.11
## animationintervention_1:variablefigure          0.53   0.23     2.31   4239.12
## animationbattery_2:variablefigure              -0.02   0.23    -0.09   4239.08
## animationinit_comm_2:variablefigure             0.10   0.23     0.45   4239.05
## animationintervention_2:variablefigure         -0.20   0.23    -0.86   4239.08
## animationbattery_3:variablefigure              -0.19   0.23    -0.85   4239.05
## animationno_problem:variablefigure              0.32   0.23     1.38   4239.05
## animationbroken_comm:variablefigure             0.09   0.23     0.39   4239.05
## animationclose_comm:variablefigure              0.20   0.23     0.85   4239.11
## animationintervention_1:variablesuivre          0.69   0.23     2.99   4239.15
## animationbattery_2:variablesuivre               1.14   0.23     4.95   4239.15
## animationinit_comm_2:variablesuivre             0.31   0.23     1.36   4239.19
## animationintervention_2:variablesuivre          0.70   0.23     3.06   4239.17
## animationbattery_3:variablesuivre               0.80   0.23     3.48   4239.15
## animationno_problem:variablesuivre              0.45   0.23     1.96   4239.18
## animationbroken_comm:variablesuivre             1.15   0.23     5.00   4239.15
## animationclose_comm:variablesuivre              0.91   0.23     3.96   4239.24
## ------------------------------------------------------------------------------
##  
## ---------------------------------------------------
##                                                   p
## -------------------------------------------- ------
## (Intercept)                                    0.00
## animationintervention_1                        0.00
## animationbattery_2                             0.34
## animationinit_comm_2                           0.75
## animationintervention_2                        0.00
## animationbattery_3                             0.90
## animationno_problem                            0.26
## animationbroken_comm                           0.00
## animationclose_comm                            0.00
## variablegroup                                  0.00
## variablereact                                  0.00
## variablefigure                                 0.01
## variablesuivre                                 0.00
## activite_corporelle                            0.23
## jeux_videos                                    0.27
## animation_numerique                            0.47
## animationintervention_1:variablegroup          0.00
## animationbattery_2:variablegroup               0.21
## animationinit_comm_2:variablegroup             0.82
## animationintervention_2:variablegroup          0.00
## animationbattery_3:variablegroup               0.93
## animationno_problem:variablegroup              0.21
## animationbroken_comm:variablegroup             0.84
## animationclose_comm:variablegroup              0.23
## animationintervention_1:variablereact          0.01
## animationbattery_2:variablereact               0.01
## animationinit_comm_2:variablereact             0.39
## animationintervention_2:variablereact          0.25
## animationbattery_3:variablereact               0.02
## animationno_problem:variablereact              0.62
## animationbroken_comm:variablereact             0.09
## animationclose_comm:variablereact              0.06
## animationintervention_1:variablefigure         0.02
## animationbattery_2:variablefigure              0.93
## animationinit_comm_2:variablefigure            0.66
## animationintervention_2:variablefigure         0.39
## animationbattery_3:variablefigure              0.40
## animationno_problem:variablefigure             0.17
## animationbroken_comm:variablefigure            0.70
## animationclose_comm:variablefigure             0.39
## animationintervention_1:variablesuivre         0.00
## animationbattery_2:variablesuivre              0.00
## animationinit_comm_2:variablesuivre            0.17
## animationintervention_2:variablesuivre         0.00
## animationbattery_3:variablesuivre              0.00
## animationno_problem:variablesuivre             0.05
## animationbroken_comm:variablesuivre            0.00
## animationclose_comm:variablesuivre             0.00
## ---------------------------------------------------
## 
## p values calculated using Satterthwaite d.f.
## 
## RANDOM EFFECTS:
## ------------------------------------
##   Group      Parameter    Std. Dev. 
## ---------- ------------- -----------
##  subject    (Intercept)     0.63    
##  Residual                   1.13    
## ------------------------------------
## 
## Grouping variables:
## ---------------------------
##   Group    # groups   ICC  
## --------- ---------- ------
##  subject      98      0.24 
## ---------------------------
Anova(model_interact, type = 3)
## Analysis of Deviance Table (Type III Wald chisquare tests)
## 
## Response: value
##                      Chisq Df          Pr(>Chisq)    
## (Intercept)         446.22  1 <0.0000000000000002 ***
## animation           103.17  8 <0.0000000000000002 ***
## variable            112.10  4 <0.0000000000000002 ***
## activite_corporelle   1.49  1                0.22    
## jeux_videos           1.21  1                0.27    
## animation_numerique   0.54  1                0.46    
## animation:variable  195.31 32 <0.0000000000000002 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(model_interact, test = "Chisq")
## Single term deletions
## 
## Model:
## value ~ animation * variable + activite_corporelle + jeux_videos + 
##     animation_numerique + (1 | subject)
##                     npar   AIC   LRT             Pr(Chi)    
## <none>                   13837                              
## activite_corporelle    1 13837   1.5                0.22    
## jeux_videos            1 13837   1.3                0.26    
## animation_numerique    1 13836   0.6                0.46    
## animation:variable    32 13966 192.9 <0.0000000000000002 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(model_tendance, model_interact)
## refitting model(s) with ML (instead of REML)
## Data: dat_melt
## Models:
## model_tendance: value ~ animation + variable + activite_corporelle + jeux_videos + animation_numerique + (1 | subject)
## model_interact: value ~ animation * variable + activite_corporelle + jeux_videos + animation_numerique + (1 | subject)
##                npar   AIC   BIC logLik deviance Chisq Df          Pr(>Chisq)
## model_tendance   18 13966 14081  -6965    13930                             
## model_interact   50 13837 14157  -6869    13737   193 32 <0.0000000000000002
##                   
## model_tendance    
## model_interact ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emm_posthoc <- emmeans(model_interact, pairwise ~ variable | animation, pbkrtest.limit = 4381)
emm_posthoc
## $emmeans
## animation = init_comm_1:
##  variable emmean    SE   df lower.CL upper.CL
##  synchro     4.4 0.131 1214      4.1      4.6
##  group       3.8 0.131 1214      3.5      4.0
##  react       3.8 0.131 1214      3.5      4.0
##  figure      3.9 0.131 1214      3.7      4.2
##  suivre      2.7 0.133 1261      2.4      3.0
## 
## animation = intervention_1:
##  variable emmean    SE   df lower.CL upper.CL
##  synchro     3.7 0.132 1229      3.5      4.0
##  group       4.0 0.132 1229      3.8      4.3
##  react       3.7 0.133 1277      3.5      4.0
##  figure      3.8 0.132 1229      3.6      4.1
##  suivre      2.8 0.132 1229      2.5      3.0
## 
## animation = battery_2:
##  variable emmean    SE   df lower.CL upper.CL
##  synchro     4.2 0.131 1214      3.9      4.5
##  group       3.9 0.131 1214      3.7      4.2
##  react       4.2 0.132 1229      4.0      4.5
##  figure      3.8 0.132 1229      3.5      4.0
##  suivre      3.7 0.131 1214      3.4      3.9
## 
## animation = init_comm_2:
##  variable emmean    SE   df lower.CL upper.CL
##  synchro     4.4 0.131 1214      4.2      4.7
##  group       3.8 0.131 1214      3.5      4.0
##  react       4.0 0.132 1229      3.8      4.3
##  figure      4.1 0.131 1214      3.8      4.3
##  suivre      3.1 0.132 1229      2.8      3.3
## 
## animation = intervention_2:
##  variable emmean    SE   df lower.CL upper.CL
##  synchro     3.8 0.132 1229      3.5      4.0
##  group       4.2 0.132 1245      3.9      4.4
##  react       3.5 0.131 1214      3.2      3.7
##  figure      3.2 0.131 1214      2.9      3.4
##  suivre      2.8 0.131 1214      2.6      3.1
## 
## animation = battery_3:
##  variable emmean    SE   df lower.CL upper.CL
##  synchro     4.4 0.131 1214      4.1      4.6
##  group       3.8 0.131 1214      3.6      4.1
##  react       4.4 0.131 1214      4.1      4.6
##  figure      3.8 0.131 1214      3.5      4.0
##  suivre      3.5 0.131 1214      3.3      3.8
## 
## animation = no_problem:
##  variable emmean    SE   df lower.CL upper.CL
##  synchro     4.5 0.131 1214      4.3      4.8
##  group       4.3 0.131 1214      4.0      4.5
##  react       3.9 0.132 1245      3.6      4.1
##  figure      4.4 0.131 1214      4.2      4.7
##  suivre      3.3 0.132 1229      3.1      3.6
## 
## animation = broken_comm:
##  variable emmean    SE   df lower.CL upper.CL
##  synchro     3.7 0.132 1229      3.4      4.0
##  group       3.1 0.132 1229      2.8      3.3
##  react       3.5 0.132 1229      3.2      3.8
##  figure      3.4 0.132 1229      3.1      3.6
##  suivre      3.2 0.132 1229      2.9      3.4
## 
## animation = close_comm:
##  variable emmean    SE   df lower.CL upper.CL
##  synchro     3.4 0.132 1245      3.1      3.6
##  group       2.5 0.131 1214      2.3      2.8
##  react       3.2 0.131 1214      3.0      3.5
##  figure      3.1 0.131 1214      2.9      3.4
##  suivre      2.6 0.132 1229      2.4      2.9
## 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## 
## $contrasts
## animation = init_comm_1:
##  contrast         estimate    SE   df t.ratio p.value
##  synchro - group      0.57 0.162 4239   3.500  <.0001
##  synchro - react      0.57 0.162 4239   3.500  <.0001
##  synchro - figure     0.43 0.162 4239   2.600  0.0600
##  synchro - suivre     1.66 0.163 4239  10.200  <.0001
##  group - react        0.00 0.162 4239   0.000  1.0000
##  group - figure      -0.14 0.162 4239  -0.900  0.9000
##  group - suivre       1.09 0.163 4239   6.700  <.0001
##  react - figure      -0.14 0.162 4239  -0.900  0.9000
##  react - suivre       1.09 0.163 4239   6.700  <.0001
##  figure - suivre      1.23 0.163 4239   7.500  <.0001
## 
## animation = intervention_1:
##  contrast         estimate    SE   df t.ratio p.value
##  synchro - group     -0.30 0.163 4239  -1.800  0.3600
##  synchro - react      0.00 0.164 4239   0.000  1.0000
##  synchro - figure    -0.10 0.163 4239  -0.600  0.9700
##  synchro - suivre     0.97 0.163 4239   6.000  <.0001
##  group - react        0.29 0.164 4239   1.800  0.3800
##  group - figure       0.19 0.163 4239   1.200  0.7500
##  group - suivre       1.27 0.163 4239   7.800  <.0001
##  react - figure      -0.10 0.164 4239  -0.600  0.9800
##  react - suivre       0.97 0.164 4239   5.900  <.0001
##  figure - suivre      1.07 0.163 4239   6.600  <.0001
## 
## animation = battery_2:
##  contrast         estimate    SE   df t.ratio p.value
##  synchro - group      0.29 0.162 4239   1.800  0.3900
##  synchro - react     -0.04 0.162 4239  -0.200  1.0000
##  synchro - figure     0.45 0.162 4239   2.800  0.0400
##  synchro - suivre     0.52 0.162 4239   3.200  0.0100
##  group - react       -0.32 0.162 4239  -2.000  0.2700
##  group - figure       0.16 0.162 4239   1.000  0.8500
##  group - suivre       0.23 0.162 4239   1.500  0.5900
##  react - figure       0.49 0.163 4239   3.000  0.0200
##  react - suivre       0.56 0.162 4239   3.400  0.0100
##  figure - suivre      0.07 0.162 4239   0.400  0.9900
## 
## animation = init_comm_2:
##  contrast         estimate    SE   df t.ratio p.value
##  synchro - group      0.62 0.162 4239   3.800  <.0001
##  synchro - react      0.37 0.162 4239   2.300  0.1500
##  synchro - figure     0.33 0.162 4239   2.000  0.2600
##  synchro - suivre     1.34 0.162 4239   8.300  <.0001
##  group - react       -0.25 0.162 4239  -1.500  0.5400
##  group - figure      -0.30 0.162 4239  -1.800  0.3600
##  group - suivre       0.72 0.162 4239   4.400  <.0001
##  react - figure      -0.05 0.162 4239  -0.300  1.0000
##  react - suivre       0.97 0.163 4239   6.000  <.0001
##  figure - suivre      1.02 0.162 4239   6.300  <.0001
## 
## animation = intervention_2:
##  contrast         estimate    SE   df t.ratio p.value
##  synchro - group     -0.40 0.163 4239  -2.400  0.1100
##  synchro - react      0.31 0.162 4239   1.900  0.3100
##  synchro - figure     0.63 0.162 4239   3.900  <.0001
##  synchro - suivre     0.95 0.162 4239   5.900  <.0001
##  group - react        0.71 0.163 4239   4.300  <.0001
##  group - figure       1.02 0.163 4239   6.300  <.0001
##  group - suivre       1.35 0.163 4239   8.300  <.0001
##  react - figure       0.32 0.162 4239   2.000  0.2900
##  react - suivre       0.64 0.162 4239   4.000  <.0001
##  figure - suivre      0.33 0.162 4239   2.000  0.2600
## 
## animation = battery_3:
##  contrast         estimate    SE   df t.ratio p.value
##  synchro - group      0.55 0.162 4239   3.400  0.0100
##  synchro - react      0.02 0.162 4239   0.100  1.0000
##  synchro - figure     0.62 0.162 4239   3.800  <.0001
##  synchro - suivre     0.86 0.162 4239   5.300  <.0001
##  group - react       -0.53 0.162 4239  -3.300  0.0100
##  group - figure       0.07 0.162 4239   0.400  0.9900
##  group - suivre       0.31 0.162 4239   1.900  0.3200
##  react - figure       0.60 0.162 4239   3.700  <.0001
##  react - suivre       0.84 0.162 4239   5.200  <.0001
##  figure - suivre      0.23 0.162 4239   1.500  0.5900
## 
## animation = no_problem:
##  contrast         estimate    SE   df t.ratio p.value
##  synchro - group      0.29 0.162 4239   1.800  0.3900
##  synchro - react      0.69 0.163 4239   4.200  <.0001
##  synchro - figure     0.11 0.162 4239   0.700  0.9600
##  synchro - suivre     1.21 0.162 4239   7.400  <.0001
##  group - react        0.40 0.163 4239   2.500  0.1000
##  group - figure      -0.17 0.162 4239  -1.100  0.8200
##  group - suivre       0.92 0.162 4239   5.700  <.0001
##  react - figure      -0.57 0.163 4239  -3.500  <.0001
##  react - suivre       0.52 0.163 4239   3.200  0.0100
##  figure - suivre      1.09 0.162 4239   6.700  <.0001
## 
## animation = broken_comm:
##  contrast         estimate    SE   df t.ratio p.value
##  synchro - group      0.62 0.163 4239   3.800  <.0001
##  synchro - react      0.19 0.163 4239   1.100  0.7800
##  synchro - figure     0.34 0.163 4239   2.100  0.2200
##  synchro - suivre     0.51 0.163 4239   3.100  0.0200
##  group - react       -0.43 0.163 4239  -2.700  0.0600
##  group - figure      -0.28 0.163 4239  -1.700  0.4300
##  group - suivre      -0.11 0.163 4239  -0.700  0.9600
##  react - figure       0.15 0.163 4239   1.000  0.8800
##  react - suivre       0.32 0.163 4239   2.000  0.2800
##  figure - suivre      0.16 0.163 4239   1.000  0.8500
## 
## animation = close_comm:
##  contrast         estimate    SE   df t.ratio p.value
##  synchro - group      0.85 0.163 4239   5.200  <.0001
##  synchro - react      0.14 0.163 4239   0.900  0.9100
##  synchro - figure     0.23 0.163 4239   1.400  0.6100
##  synchro - suivre     0.75 0.163 4239   4.600  <.0001
##  group - react       -0.70 0.162 4239  -4.400  <.0001
##  group - figure      -0.61 0.162 4239  -3.800  <.0001
##  group - suivre      -0.10 0.162 4239  -0.600  0.9700
##  react - figure       0.09 0.162 4239   0.600  0.9800
##  react - suivre       0.60 0.162 4239   3.700  <.0001
##  figure - suivre      0.51 0.162 4239   3.200  0.0100
## 
## Degrees-of-freedom method: kenward-roger 
## P value adjustment: tukey method for comparing a family of 5 estimates
emm_posthoc_corrected <- summary(emm_posthoc, adjust = "fdr", infer = c(TRUE, TRUE))
emm_posthoc_corrected
## $emmeans
## animation = init_comm_1:
##  variable emmean    SE   df lower.CL upper.CL t.ratio p.value
##  synchro     4.4 0.131 1214      4.0      4.7  33.000  <.0001
##  group       3.8 0.131 1214      3.4      4.1  29.000  <.0001
##  react       3.8 0.131 1214      3.4      4.1  29.000  <.0001
##  figure      3.9 0.131 1214      3.6      4.3  30.000  <.0001
##  suivre      2.7 0.133 1261      2.4      3.0  20.000  <.0001
## 
## animation = intervention_1:
##  variable emmean    SE   df lower.CL upper.CL t.ratio p.value
##  synchro     3.7 0.132 1229      3.4      4.1  28.000  <.0001
##  group       4.0 0.132 1229      3.7      4.4  31.000  <.0001
##  react       3.7 0.133 1277      3.4      4.1  28.000  <.0001
##  figure      3.8 0.132 1229      3.5      4.2  29.000  <.0001
##  suivre      2.8 0.132 1229      2.4      3.1  21.000  <.0001
## 
## animation = battery_2:
##  variable emmean    SE   df lower.CL upper.CL t.ratio p.value
##  synchro     4.2 0.131 1214      3.9      4.5  32.000  <.0001
##  group       3.9 0.131 1214      3.6      4.3  30.000  <.0001
##  react       4.2 0.132 1229      3.9      4.6  32.000  <.0001
##  figure      3.8 0.132 1229      3.4      4.1  29.000  <.0001
##  suivre      3.7 0.131 1214      3.3      4.0  28.000  <.0001
## 
## animation = init_comm_2:
##  variable emmean    SE   df lower.CL upper.CL t.ratio p.value
##  synchro     4.4 0.131 1214      4.1      4.7  34.000  <.0001
##  group       3.8 0.131 1214      3.4      4.1  29.000  <.0001
##  react       4.0 0.132 1229      3.7      4.4  31.000  <.0001
##  figure      4.1 0.131 1214      3.7      4.4  31.000  <.0001
##  suivre      3.1 0.132 1229      2.7      3.4  23.000  <.0001
## 
## animation = intervention_2:
##  variable emmean    SE   df lower.CL upper.CL t.ratio p.value
##  synchro     3.8 0.132 1229      3.5      4.1  29.000  <.0001
##  group       4.2 0.132 1245      3.8      4.5  32.000  <.0001
##  react       3.5 0.131 1214      3.1      3.8  27.000  <.0001
##  figure      3.2 0.131 1214      2.8      3.5  24.000  <.0001
##  suivre      2.8 0.131 1214      2.5      3.2  22.000  <.0001
## 
## animation = battery_3:
##  variable emmean    SE   df lower.CL upper.CL t.ratio p.value
##  synchro     4.4 0.131 1214      4.0      4.7  33.000  <.0001
##  group       3.8 0.131 1214      3.5      4.2  29.000  <.0001
##  react       4.4 0.131 1214      4.0      4.7  33.000  <.0001
##  figure      3.8 0.131 1214      3.4      4.1  29.000  <.0001
##  suivre      3.5 0.131 1214      3.2      3.9  27.000  <.0001
## 
## animation = no_problem:
##  variable emmean    SE   df lower.CL upper.CL t.ratio p.value
##  synchro     4.5 0.131 1214      4.2      4.9  35.000  <.0001
##  group       4.3 0.131 1214      3.9      4.6  32.000  <.0001
##  react       3.9 0.132 1245      3.5      4.2  29.000  <.0001
##  figure      4.4 0.131 1214      4.1      4.8  34.000  <.0001
##  suivre      3.3 0.132 1229      3.0      3.7  25.000  <.0001
## 
## animation = broken_comm:
##  variable emmean    SE   df lower.CL upper.CL t.ratio p.value
##  synchro     3.7 0.132 1229      3.4      4.0  28.000  <.0001
##  group       3.1 0.132 1229      2.7      3.4  23.000  <.0001
##  react       3.5 0.132 1229      3.2      3.8  27.000  <.0001
##  figure      3.4 0.132 1229      3.0      3.7  25.000  <.0001
##  suivre      3.2 0.132 1229      2.8      3.5  24.000  <.0001
## 
## animation = close_comm:
##  variable emmean    SE   df lower.CL upper.CL t.ratio p.value
##  synchro     3.4 0.132 1245      3.0      3.7  25.000  <.0001
##  group       2.5 0.131 1214      2.2      2.9  19.000  <.0001
##  react       3.2 0.131 1214      2.9      3.6  25.000  <.0001
##  figure      3.1 0.131 1214      2.8      3.5  24.000  <.0001
##  suivre      2.6 0.132 1229      2.3      3.0  20.000  <.0001
## 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## Conf-level adjustment: bonferroni method for 5 estimates 
## P value adjustment: fdr method for 5 tests 
## 
## $contrasts
## animation = init_comm_1:
##  contrast         estimate    SE   df lower.CL upper.CL t.ratio p.value
##  synchro - group      0.57 0.162 4239     0.12     1.03   3.500  <.0001
##  synchro - react      0.57 0.162 4239     0.12     1.03   3.500  <.0001
##  synchro - figure     0.43 0.162 4239    -0.03     0.88   2.600  0.0100
##  synchro - suivre     1.66 0.163 4239     1.20     2.12  10.200  <.0001
##  group - react        0.00 0.162 4239    -0.45     0.45   0.000  1.0000
##  group - figure      -0.14 0.162 4239    -0.60     0.31  -0.900  0.4200
##  group - suivre       1.09 0.163 4239     0.63     1.54   6.700  <.0001
##  react - figure      -0.14 0.162 4239    -0.60     0.31  -0.900  0.4200
##  react - suivre       1.09 0.163 4239     0.63     1.54   6.700  <.0001
##  figure - suivre      1.23 0.163 4239     0.77     1.69   7.500  <.0001
## 
## animation = intervention_1:
##  contrast         estimate    SE   df lower.CL upper.CL t.ratio p.value
##  synchro - group     -0.30 0.163 4239    -0.75     0.16  -1.800  0.1200
##  synchro - react      0.00 0.164 4239    -0.46     0.46   0.000  0.9800
##  synchro - figure    -0.10 0.163 4239    -0.56     0.35  -0.600  0.6100
##  synchro - suivre     0.97 0.163 4239     0.51     1.43   6.000  <.0001
##  group - react        0.29 0.164 4239    -0.17     0.75   1.800  0.1200
##  group - figure       0.19 0.163 4239    -0.26     0.65   1.200  0.3300
##  group - suivre       1.27 0.163 4239     0.81     1.72   7.800  <.0001
##  react - figure      -0.10 0.164 4239    -0.56     0.36  -0.600  0.6100
##  react - suivre       0.97 0.164 4239     0.51     1.43   5.900  <.0001
##  figure - suivre      1.07 0.163 4239     0.61     1.53   6.600  <.0001
## 
## animation = battery_2:
##  contrast         estimate    SE   df lower.CL upper.CL t.ratio p.value
##  synchro - group      0.29 0.162 4239    -0.17     0.74   1.800  0.1300
##  synchro - react     -0.04 0.162 4239    -0.49     0.42  -0.200  0.8100
##  synchro - figure     0.45 0.162 4239    -0.01     0.91   2.800  0.0100
##  synchro - suivre     0.52 0.162 4239     0.07     0.97   3.200  0.0100
##  group - react       -0.32 0.162 4239    -0.78     0.13  -2.000  0.0900
##  group - figure       0.16 0.162 4239    -0.29     0.62   1.000  0.3900
##  group - suivre       0.23 0.162 4239    -0.22     0.69   1.500  0.2100
##  react - figure       0.49 0.163 4239     0.03     0.94   3.000  0.0100
##  react - suivre       0.56 0.162 4239     0.10     1.01   3.400  0.0100
##  figure - suivre      0.07 0.162 4239    -0.38     0.53   0.400  0.7400
## 
## animation = init_comm_2:
##  contrast         estimate    SE   df lower.CL upper.CL t.ratio p.value
##  synchro - group      0.62 0.162 4239     0.17     1.08   3.800  <.0001
##  synchro - react      0.37 0.162 4239    -0.08     0.83   2.300  0.0400
##  synchro - figure     0.33 0.162 4239    -0.13     0.78   2.000  0.0600
##  synchro - suivre     1.34 0.162 4239     0.89     1.80   8.300  <.0001
##  group - react       -0.25 0.162 4239    -0.71     0.21  -1.500  0.1400
##  group - figure      -0.30 0.162 4239    -0.75     0.16  -1.800  0.0800
##  group - suivre       0.72 0.162 4239     0.27     1.18   4.400  <.0001
##  react - figure      -0.05 0.162 4239    -0.50     0.41  -0.300  0.7800
##  react - suivre       0.97 0.163 4239     0.51     1.43   6.000  <.0001
##  figure - suivre      1.02 0.162 4239     0.56     1.47   6.300  <.0001
## 
## animation = intervention_2:
##  contrast         estimate    SE   df lower.CL upper.CL t.ratio p.value
##  synchro - group     -0.40 0.163 4239    -0.85     0.06  -2.400  0.0200
##  synchro - react      0.31 0.162 4239    -0.15     0.77   1.900  0.0600
##  synchro - figure     0.63 0.162 4239     0.17     1.08   3.900  <.0001
##  synchro - suivre     0.95 0.162 4239     0.50     1.41   5.900  <.0001
##  group - react        0.71 0.163 4239     0.25     1.16   4.300  <.0001
##  group - figure       1.02 0.163 4239     0.57     1.48   6.300  <.0001
##  group - suivre       1.35 0.163 4239     0.89     1.81   8.300  <.0001
##  react - figure       0.32 0.162 4239    -0.14     0.77   2.000  0.0600
##  react - suivre       0.64 0.162 4239     0.19     1.10   4.000  <.0001
##  figure - suivre      0.33 0.162 4239    -0.13     0.78   2.000  0.0500
## 
## animation = battery_3:
##  contrast         estimate    SE   df lower.CL upper.CL t.ratio p.value
##  synchro - group      0.55 0.162 4239     0.10     1.01   3.400  <.0001
##  synchro - react      0.02 0.162 4239    -0.43     0.47   0.100  0.9000
##  synchro - figure     0.62 0.162 4239     0.17     1.08   3.800  <.0001
##  synchro - suivre     0.86 0.162 4239     0.40     1.31   5.300  <.0001
##  group - react       -0.53 0.162 4239    -0.98    -0.08  -3.300  <.0001
##  group - figure       0.07 0.162 4239    -0.38     0.53   0.400  0.7300
##  group - suivre       0.31 0.162 4239    -0.15     0.76   1.900  0.0800
##  react - figure       0.60 0.162 4239     0.15     1.06   3.700  <.0001
##  react - suivre       0.84 0.162 4239     0.38     1.29   5.200  <.0001
##  figure - suivre      0.23 0.162 4239    -0.22     0.69   1.500  0.1800
## 
## animation = no_problem:
##  contrast         estimate    SE   df lower.CL upper.CL t.ratio p.value
##  synchro - group      0.29 0.162 4239    -0.17     0.74   1.800  0.1000
##  synchro - react      0.69 0.163 4239     0.23     1.14   4.200  <.0001
##  synchro - figure     0.11 0.162 4239    -0.34     0.57   0.700  0.4900
##  synchro - suivre     1.21 0.162 4239     0.75     1.66   7.400  <.0001
##  group - react        0.40 0.163 4239    -0.06     0.86   2.500  0.0200
##  group - figure      -0.17 0.162 4239    -0.63     0.28  -1.100  0.3200
##  group - suivre       0.92 0.162 4239     0.46     1.38   5.700  <.0001
##  react - figure      -0.57 0.163 4239    -1.03    -0.12  -3.500  <.0001
##  react - suivre       0.52 0.163 4239     0.06     0.98   3.200  <.0001
##  figure - suivre      1.09 0.162 4239     0.64     1.55   6.700  <.0001
## 
## animation = broken_comm:
##  contrast         estimate    SE   df lower.CL upper.CL t.ratio p.value
##  synchro - group      0.62 0.163 4239     0.16     1.08   3.800  <.0001
##  synchro - react      0.19 0.163 4239    -0.27     0.64   1.100  0.3600
##  synchro - figure     0.34 0.163 4239    -0.12     0.80   2.100  0.0900
##  synchro - suivre     0.51 0.163 4239     0.05     0.96   3.100  0.0100
##  group - react       -0.43 0.163 4239    -0.89     0.02  -2.700  0.0300
##  group - figure      -0.28 0.163 4239    -0.73     0.18  -1.700  0.1400
##  group - suivre      -0.11 0.163 4239    -0.57     0.34  -0.700  0.4900
##  react - figure       0.15 0.163 4239    -0.30     0.61   1.000  0.3800
##  react - suivre       0.32 0.163 4239    -0.14     0.78   2.000  0.1000
##  figure - suivre      0.16 0.163 4239    -0.29     0.62   1.000  0.3800
## 
## animation = close_comm:
##  contrast         estimate    SE   df lower.CL upper.CL t.ratio p.value
##  synchro - group      0.85 0.163 4239     0.39     1.30   5.200  <.0001
##  synchro - react      0.14 0.163 4239    -0.32     0.60   0.900  0.4800
##  synchro - figure     0.23 0.163 4239    -0.22     0.69   1.400  0.2200
##  synchro - suivre     0.75 0.163 4239     0.29     1.20   4.600  <.0001
##  group - react       -0.70 0.162 4239    -1.16    -0.25  -4.400  <.0001
##  group - figure      -0.61 0.162 4239    -1.07    -0.16  -3.800  <.0001
##  group - suivre      -0.10 0.162 4239    -0.56     0.36  -0.600  0.5700
##  react - figure       0.09 0.162 4239    -0.36     0.55   0.600  0.5700
##  react - suivre       0.60 0.162 4239     0.15     1.06   3.700  <.0001
##  figure - suivre      0.51 0.162 4239     0.06     0.97   3.200  <.0001
## 
## Degrees-of-freedom method: kenward-roger 
## Confidence level used: 0.95 
## Conf-level adjustment: bonferroni method for 10 estimates 
## P value adjustment: fdr method for 10 tests

Graph of Interaction

gg_interact <- cat_plot(model_interact, pred = animation, modx = variable, interval = TRUE, int.width = 0.95, outcome.scale = "response",
              vary.lty = FALSE, geom = "bar",
              x.label = "Animation Sequence", 
              y.label = "Average Group Tendency",
              legend.main = "Group Characteristic",
              pred.labels = c("Sequence 1", "Sequence 2", "Sequence 3", "Sequence 4", "Sequence 5", "Sequence 6", "Sequence 7", "Sequence 8", "Sequence 9"),
              modx.labels = c("Synchronising", "Grouping", "Reacting", "Forming Figures", "Following"),
              colors = c("#03051AFF", "#4C1D4BFF", "#A11A5BFF", "#E83F3FFF", "#F69C73FF"),
              geom.alpha = 0.7) +
  theme(axis.title.x = element_text(colour = "black"),
        axis.title.y = element_text(colour = "black"),
        axis.text.y = element_text(colour = "black"),
        axis.text.x = element_text(colour = "black"),
        legend.title = element_text(colour = "black"),
        legend.text = element_text(colour = "black"),
        axis.text = element_text(size = 12),
        legend.position = "top")

gg_interact