##Set working directory

setwd("C:/Users/RussellChan/OneDrive - University of Twente/2021_Oscillatory EXP 3 Paper 4 Analysis/Current Analysis")

##Packages

library(lme4)
library(effects)
library(lattice)
library(car)
library(ggplot2) 
library(knitr)
library(reshape2)
library(dplyr)
library(forcats)
library(DHARMa)
library(Hmisc)
library(phia)
library(lsmeans)
library(emmeans)
library(multcomp)
library(plotly)
library(lmerTest)
library(readxl)

##Import dataset

d.Pos<-read.table("mpd_6_Posterior_1.csv", sep = ",", header = T, stringsAsFactors = F)
d.Fro2<-read.table("mpd_6_Frontal_WO2.csv", sep = ",", header = T, stringsAsFactors = F)

#Factors

#Create Factors
d.Fro2$Subject <- factor(d.Fro2$Subject)
d.Fro2$Group <- factor(d.Fro2$Group)
d.Fro2$Session <- factor(d.Fro2$Session, levels=c('1', '2', '3'))
d.Fro2$Time <-as.factor(d.Fro2$Time)

d.Pos$Subject <- factor(d.Pos$Subject)
d.Pos$Group <- factor(d.Pos$Group)
d.Pos$Session <- factor(d.Pos$Session, levels=c('1', '2', '3'))
d.Pos$Time <-as.factor(d.Pos$Time)

#Alpha Models

#Model 1: Alpha Frontal without AF sites.
m.AF_WO <- lmer(ERDSAlpha ~ Group * Session * Time  + (1 | Subject), data=d.Fro2, REML = FALSE)
Anova(m.AF_WO)
#m.AFtest <- as(m.AF,"lmerModLmerTest")
#summary(m.AF_WO, ddf="Satterthwaite")

#m.AFmpd <- lmer(Alpha ~ Group * Session * Time  + (1 | Subject), data=d.Fro2, REML = FALSE)
#Anova(m.AFmpd)

######################

#Model 2: Alpha Posterior
m.AP <- lmer(ERDSAlpha ~ Group * Session * Time  + (1 | Subject), data=d.Pos, REML = FALSE)
Anova(m.AP)
#m.AFtest <- as(m.AF,"lmerModLmerTest")
#summary(m.AP, ddf="Satterthwaite")

#Alpha Posthocs to determine exact locus

#Frontal Alpha WO AF
emmeans(m.AF_WO, pairwise ~ Group | Session)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 15480' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 15480)' 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 = 15480' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 15480)' or larger];
## but be warned that this may result in large computation time and memory use.
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
## Session = 1:
##  Group   emmean   SE  df asymp.LCL asymp.UCL
##  Control  1.395 13.3 Inf    -24.64      27.4
##  MED1    -7.404 12.5 Inf    -31.95      17.1
##  MED21   11.885 10.8 Inf     -9.37      33.1
## 
## Session = 2:
##  Group   emmean   SE  df asymp.LCL asymp.UCL
##  Control -0.089 13.3 Inf    -26.12      25.9
##  MED1    -1.029 12.5 Inf    -25.57      23.5
##  MED21   -0.558 10.9 Inf    -21.88      20.8
## 
## Session = 3:
##  Group   emmean   SE  df asymp.LCL asymp.UCL
##  Control -3.794 13.3 Inf    -29.83      22.2
##  MED1    -5.835 12.5 Inf    -30.38      18.7
##  MED21   23.299 10.8 Inf      2.04      44.6
## 
## Results are averaged over the levels of: Time 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## 
## $contrasts
## Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1     8.800 18.3 Inf   0.482  0.8798
##  Control - MED21  -10.490 17.1 Inf  -0.612  0.8137
##  MED1 - MED21     -19.290 16.6 Inf  -1.164  0.4746
## 
## Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1     0.940 18.3 Inf   0.051  0.9985
##  Control - MED21    0.469 17.2 Inf   0.027  0.9996
##  MED1 - MED21      -0.471 16.6 Inf  -0.028  0.9996
## 
## Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1     2.040 18.3 Inf   0.112  0.9931
##  Control - MED21  -27.094 17.1 Inf  -1.580  0.2543
##  MED1 - MED21     -29.134 16.6 Inf  -1.759  0.1837
## 
## Results are averaged over the levels of: Time 
## Degrees-of-freedom method: asymptotic 
## P value adjustment: tukey method for comparing a family of 3 estimates
m.AF_WO <- lmer(ERDSAlpha ~ Group * Session  + (1 | Subject), data=d.Fro2, REML = FALSE)

emmeans(m.AF_WO, pairwise ~ Group | Session)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 15480' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 15480)' 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 = 15480' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 15480)' or larger];
## but be warned that this may result in large computation time and memory use.
## $emmeans
## Session = 1:
##  Group   emmean   SE  df asymp.LCL asymp.UCL
##  Control  1.395 13.3 Inf    -24.64      27.4
##  MED1    -7.404 12.5 Inf    -31.95      17.1
##  MED21   11.885 10.8 Inf     -9.37      33.1
## 
## Session = 2:
##  Group   emmean   SE  df asymp.LCL asymp.UCL
##  Control -0.089 13.3 Inf    -26.13      25.9
##  MED1    -1.029 12.5 Inf    -25.58      23.5
##  MED21   -0.557 10.9 Inf    -21.89      20.8
## 
## Session = 3:
##  Group   emmean   SE  df asymp.LCL asymp.UCL
##  Control -3.794 13.3 Inf    -29.83      22.2
##  MED1    -5.835 12.5 Inf    -30.38      18.7
##  MED21   23.299 10.8 Inf      2.04      44.6
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## 
## $contrasts
## Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1     8.800 18.3 Inf   0.482  0.8799
##  Control - MED21  -10.490 17.2 Inf  -0.612  0.8138
##  MED1 - MED21     -19.290 16.6 Inf  -1.164  0.4747
## 
## Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1     0.940 18.3 Inf   0.051  0.9985
##  Control - MED21    0.468 17.2 Inf   0.027  0.9996
##  MED1 - MED21      -0.471 16.6 Inf  -0.028  0.9996
## 
## Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1     2.040 18.3 Inf   0.112  0.9931
##  Control - MED21  -27.094 17.2 Inf  -1.580  0.2544
##  MED1 - MED21     -29.134 16.6 Inf  -1.758  0.1838
## 
## Degrees-of-freedom method: asymptotic 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(m.AF_WO, pairwise ~ Session | Group)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 15480' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 15480)' 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 = 15480' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 15480)' or larger];
## but be warned that this may result in large computation time and memory use.
## $emmeans
## Group = Control:
##  Session emmean   SE  df asymp.LCL asymp.UCL
##  1        1.395 13.3 Inf    -24.64      27.4
##  2       -0.089 13.3 Inf    -26.13      25.9
##  3       -3.794 13.3 Inf    -29.83      22.2
## 
## Group = MED1:
##  Session emmean   SE  df asymp.LCL asymp.UCL
##  1       -7.404 12.5 Inf    -31.95      17.1
##  2       -1.029 12.5 Inf    -25.58      23.5
##  3       -5.835 12.5 Inf    -30.38      18.7
## 
## Group = MED21:
##  Session emmean   SE  df asymp.LCL asymp.UCL
##  1       11.885 10.8 Inf     -9.37      33.1
##  2       -0.557 10.9 Inf    -21.89      20.8
##  3       23.299 10.8 Inf      2.04      44.6
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## 
## $contrasts
## Group = Control:
##  contrast estimate   SE  df z.ratio p.value
##  1 - 2        1.48 4.15 Inf   0.357  0.9321
##  1 - 3        5.19 4.15 Inf   1.249  0.4242
##  2 - 3        3.71 4.15 Inf   0.892  0.6454
## 
## Group = MED1:
##  contrast estimate   SE  df z.ratio p.value
##  1 - 2       -6.38 3.92 Inf  -1.628  0.2339
##  1 - 3       -1.57 3.92 Inf  -0.401  0.9153
##  2 - 3        4.81 3.92 Inf   1.227  0.4372
## 
## Group = MED21:
##  contrast estimate   SE  df z.ratio p.value
##  1 - 2       12.44 3.50 Inf   3.550  0.0011
##  1 - 3      -11.41 3.39 Inf  -3.365  0.0022
##  2 - 3      -23.86 3.50 Inf  -6.806  <.0001
## 
## Degrees-of-freedom method: asymptotic 
## P value adjustment: tukey method for comparing a family of 3 estimates
#Posterior Alpha
emmeans(m.AP, pairwise ~ Group | Time | Session)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 15410' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 15410)' 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 = 15410' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 15410)' or larger];
## but be warned that this may result in large computation time and memory use.
## $emmeans
## Time = 1, Session = 1:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -0.709 2.86 Inf     -6.31     4.892
##  MED1      0.555 2.69 Inf     -4.72     5.834
##  MED21    -4.465 2.33 Inf     -9.04     0.105
## 
## Time = 2, Session = 1:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -0.706 2.86 Inf     -6.31     4.895
##  MED1     -1.422 2.69 Inf     -6.70     3.857
##  MED21    -3.293 2.33 Inf     -7.86     1.278
## 
## Time = 3, Session = 1:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -2.448 2.86 Inf     -8.05     3.153
##  MED1     -9.540 2.69 Inf    -14.82    -4.261
##  MED21    -5.329 2.33 Inf     -9.90    -0.759
## 
## Time = 4, Session = 1:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -3.713 2.86 Inf     -9.31     1.888
##  MED1    -10.293 2.69 Inf    -15.57    -5.014
##  MED21    -5.954 2.33 Inf    -10.52    -1.384
## 
## Time = 5, Session = 1:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -4.632 2.86 Inf    -10.23     0.969
##  MED1    -13.101 2.69 Inf    -18.38    -7.822
##  MED21    -6.207 2.33 Inf    -10.78    -1.637
## 
## Time = 6, Session = 1:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -4.457 2.86 Inf    -10.06     1.144
##  MED1    -12.710 2.69 Inf    -17.99    -7.431
##  MED21    -6.597 2.33 Inf    -11.17    -2.027
## 
## Time = 7, Session = 1:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -2.673 2.86 Inf     -8.27     2.928
##  MED1    -11.128 2.69 Inf    -16.41    -5.849
##  MED21    -8.087 2.33 Inf    -12.66    -3.517
## 
## Time = 8, Session = 1:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -1.786 2.86 Inf     -7.39     3.815
##  MED1    -12.274 2.69 Inf    -17.55    -6.995
##  MED21    -6.793 2.33 Inf    -11.36    -2.223
## 
## Time = 9, Session = 1:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -1.889 2.86 Inf     -7.49     3.711
##  MED1    -11.161 2.69 Inf    -16.44    -5.882
##  MED21    -4.259 2.33 Inf     -8.83     0.311
## 
## Time = 10, Session = 1:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -2.448 2.86 Inf     -8.05     3.153
##  MED1    -10.697 2.69 Inf    -15.98    -5.418
##  MED21    -8.088 2.33 Inf    -12.66    -3.518
## 
## Time = 1, Session = 2:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control   0.642 2.86 Inf     -4.96     6.240
##  MED1     -1.920 2.69 Inf     -7.20     3.357
##  MED21    -2.517 2.34 Inf     -7.10     2.069
## 
## Time = 2, Session = 2:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -0.275 2.86 Inf     -5.87     5.323
##  MED1     -6.435 2.69 Inf    -11.71    -1.159
##  MED21    -4.230 2.34 Inf     -8.82     0.355
## 
## Time = 3, Session = 2:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -0.694 2.86 Inf     -6.29     4.904
##  MED1     -7.905 2.69 Inf    -13.18    -2.629
##  MED21    -5.167 2.34 Inf     -9.75    -0.582
## 
## Time = 4, Session = 2:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -1.162 2.86 Inf     -6.76     4.436
##  MED1     -9.698 2.69 Inf    -14.97    -4.422
##  MED21    -4.225 2.34 Inf     -8.81     0.361
## 
## Time = 5, Session = 2:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -0.510 2.86 Inf     -6.11     5.088
##  MED1    -12.537 2.69 Inf    -17.81    -7.260
##  MED21    -6.986 2.34 Inf    -11.57    -2.401
## 
## Time = 6, Session = 2:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -1.573 2.86 Inf     -7.17     4.025
##  MED1    -17.625 2.69 Inf    -22.90   -12.348
##  MED21    -8.374 2.34 Inf    -12.96    -3.789
## 
## Time = 7, Session = 2:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -2.055 2.86 Inf     -7.65     3.543
##  MED1    -15.715 2.69 Inf    -20.99   -10.438
##  MED21    -8.133 2.34 Inf    -12.72    -3.548
## 
## Time = 8, Session = 2:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -2.784 2.86 Inf     -8.38     2.813
##  MED1    -13.434 2.69 Inf    -18.71    -8.157
##  MED21    -6.155 2.34 Inf    -10.74    -1.570
## 
## Time = 9, Session = 2:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -3.743 2.86 Inf     -9.34     1.855
##  MED1    -16.360 2.69 Inf    -21.64   -11.083
##  MED21    -6.072 2.34 Inf    -10.66    -1.487
## 
## Time = 10, Session = 2:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -3.749 2.86 Inf     -9.35     1.848
##  MED1    -13.297 2.69 Inf    -18.57    -8.020
##  MED21    -5.050 2.34 Inf     -9.64    -0.465
## 
## Time = 1, Session = 3:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -0.617 2.86 Inf     -6.21     4.980
##  MED1     -2.746 2.69 Inf     -8.02     2.530
##  MED21    -1.722 2.33 Inf     -6.29     2.848
## 
## Time = 2, Session = 3:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -1.060 2.86 Inf     -6.66     4.537
##  MED1     -4.143 2.69 Inf     -9.42     1.133
##  MED21    -3.020 2.33 Inf     -7.59     1.550
## 
## Time = 3, Session = 3:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -1.741 2.86 Inf     -7.34     3.855
##  MED1     -6.605 2.69 Inf    -11.88    -1.329
##  MED21    -6.190 2.33 Inf    -10.76    -1.620
## 
## Time = 4, Session = 3:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -1.819 2.86 Inf     -7.42     3.777
##  MED1     -7.092 2.69 Inf    -12.37    -1.816
##  MED21    -7.126 2.33 Inf    -11.70    -2.557
## 
## Time = 5, Session = 3:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -2.342 2.86 Inf     -7.94     3.255
##  MED1    -11.586 2.69 Inf    -16.86    -6.310
##  MED21    -6.403 2.33 Inf    -10.97    -1.834
## 
## Time = 6, Session = 3:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -1.262 2.86 Inf     -6.86     4.334
##  MED1    -12.102 2.69 Inf    -17.38    -6.825
##  MED21    -9.578 2.33 Inf    -14.15    -5.008
## 
## Time = 7, Session = 3:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -1.962 2.86 Inf     -7.56     3.635
##  MED1    -13.654 2.69 Inf    -18.93    -8.377
##  MED21   -11.753 2.33 Inf    -16.32    -7.183
## 
## Time = 8, Session = 3:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -3.606 2.86 Inf     -9.20     1.990
##  MED1    -10.834 2.69 Inf    -16.11    -5.557
##  MED21   -10.387 2.33 Inf    -14.96    -5.818
## 
## Time = 9, Session = 3:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -2.596 2.86 Inf     -8.19     3.001
##  MED1     -8.847 2.69 Inf    -14.12    -3.570
##  MED21   -10.620 2.33 Inf    -15.19    -6.051
## 
## Time = 10, Session = 3:
##  Group    emmean   SE  df asymp.LCL asymp.UCL
##  Control  -2.018 2.86 Inf     -7.61     3.579
##  MED1    -11.662 2.69 Inf    -16.94    -6.385
##  MED21    -9.116 2.33 Inf    -13.69    -4.546
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## 
## $contrasts
## Time = 1, Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1   -1.2638 3.93 Inf  -0.322  0.9445
##  Control - MED21   3.7565 3.69 Inf   1.018  0.5651
##  MED1 - MED21      5.0203 3.56 Inf   1.409  0.3361
## 
## Time = 2, Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    0.7157 3.93 Inf   0.182  0.9819
##  Control - MED21   2.5868 3.69 Inf   0.701  0.7627
##  MED1 - MED21      1.8711 3.56 Inf   0.525  0.8590
## 
## Time = 3, Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    7.0924 3.93 Inf   1.806  0.1675
##  Control - MED21   2.8813 3.69 Inf   0.781  0.7146
##  MED1 - MED21     -4.2111 3.56 Inf  -1.182  0.4639
## 
## Time = 4, Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    6.5794 3.93 Inf   1.676  0.2146
##  Control - MED21   2.2412 3.69 Inf   0.608  0.8159
##  MED1 - MED21     -4.3383 3.56 Inf  -1.218  0.4426
## 
## Time = 5, Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    8.4692 3.93 Inf   2.157  0.0788
##  Control - MED21   1.5757 3.69 Inf   0.427  0.9043
##  MED1 - MED21     -6.8935 3.56 Inf  -1.935  0.1289
## 
## Time = 6, Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    8.2527 3.93 Inf   2.102  0.0895
##  Control - MED21   2.1399 3.69 Inf   0.580  0.8307
##  MED1 - MED21     -6.1129 3.56 Inf  -1.716  0.1992
## 
## Time = 7, Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    8.4554 3.93 Inf   2.153  0.0795
##  Control - MED21   5.4144 3.69 Inf   1.468  0.3064
##  MED1 - MED21     -3.0410 3.56 Inf  -0.854  0.6696
## 
## Time = 8, Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1   10.4885 3.93 Inf   2.671  0.0207
##  Control - MED21   5.0074 3.69 Inf   1.358  0.3634
##  MED1 - MED21     -5.4811 3.56 Inf  -1.539  0.2729
## 
## Time = 9, Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    9.2711 3.93 Inf   2.361  0.0479
##  Control - MED21   2.3697 3.69 Inf   0.642  0.7966
##  MED1 - MED21     -6.9014 3.56 Inf  -1.937  0.1283
## 
## Time = 10, Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    8.2491 3.93 Inf   2.101  0.0897
##  Control - MED21   5.6403 3.69 Inf   1.529  0.2772
##  MED1 - MED21     -2.6088 3.56 Inf  -0.732  0.7443
## 
## Time = 1, Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    2.5617 3.92 Inf   0.653  0.7908
##  Control - MED21   3.1586 3.69 Inf   0.856  0.6684
##  MED1 - MED21      0.5969 3.57 Inf   0.167  0.9847
## 
## Time = 2, Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    6.1601 3.92 Inf   1.569  0.2589
##  Control - MED21   3.9548 3.69 Inf   1.071  0.5320
##  MED1 - MED21     -2.2052 3.57 Inf  -0.618  0.8101
## 
## Time = 3, Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    7.2112 3.92 Inf   1.837  0.1575
##  Control - MED21   4.4730 3.69 Inf   1.212  0.4463
##  MED1 - MED21     -2.7382 3.57 Inf  -0.768  0.7228
## 
## Time = 4, Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    8.5364 3.92 Inf   2.175  0.0755
##  Control - MED21   3.0626 3.69 Inf   0.830  0.6847
##  MED1 - MED21     -5.4739 3.57 Inf  -1.535  0.2746
## 
## Time = 5, Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1   12.0262 3.92 Inf   3.064  0.0062
##  Control - MED21   6.4754 3.69 Inf   1.754  0.1854
##  MED1 - MED21     -5.5508 3.57 Inf  -1.556  0.2648
## 
## Time = 6, Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1   16.0520 3.92 Inf   4.090  0.0001
##  Control - MED21   6.8014 3.69 Inf   1.842  0.1559
##  MED1 - MED21     -9.2506 3.57 Inf  -2.594  0.0257
## 
## Time = 7, Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1   13.6601 3.92 Inf   3.480  0.0015
##  Control - MED21   6.0783 3.69 Inf   1.646  0.2262
##  MED1 - MED21     -7.5817 3.57 Inf  -2.126  0.0847
## 
## Time = 8, Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1   10.6491 3.92 Inf   2.713  0.0183
##  Control - MED21   3.3703 3.69 Inf   0.913  0.6321
##  MED1 - MED21     -7.2788 3.57 Inf  -2.041  0.1026
## 
## Time = 9, Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1   12.6162 3.92 Inf   3.214  0.0037
##  Control - MED21   2.3287 3.69 Inf   0.631  0.8032
##  MED1 - MED21    -10.2875 3.57 Inf  -2.884  0.0109
## 
## Time = 10, Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    9.5474 3.92 Inf   2.432  0.0398
##  Control - MED21   1.3008 3.69 Inf   0.352  0.9339
##  MED1 - MED21     -8.2466 3.57 Inf  -2.312  0.0541
## 
## Time = 1, Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    2.1296 3.92 Inf   0.543  0.8502
##  Control - MED21   1.1046 3.69 Inf   0.300  0.9517
##  MED1 - MED21     -1.0249 3.56 Inf  -0.288  0.9554
## 
## Time = 2, Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    3.0833 3.92 Inf   0.786  0.7119
##  Control - MED21   1.9602 3.69 Inf   0.532  0.8557
##  MED1 - MED21     -1.1231 3.56 Inf  -0.315  0.9467
## 
## Time = 3, Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    4.8637 3.92 Inf   1.239  0.4299
##  Control - MED21   4.4483 3.69 Inf   1.207  0.4492
##  MED1 - MED21     -0.4154 3.56 Inf  -0.117  0.9925
## 
## Time = 4, Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    5.2730 3.92 Inf   1.344  0.3710
##  Control - MED21   5.3068 3.69 Inf   1.440  0.3206
##  MED1 - MED21      0.0338 3.56 Inf   0.009  1.0000
## 
## Time = 5, Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    9.2446 3.92 Inf   2.356  0.0485
##  Control - MED21   4.0615 3.69 Inf   1.102  0.5130
##  MED1 - MED21     -5.1831 3.56 Inf  -1.455  0.3126
## 
## Time = 6, Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1   10.8393 3.92 Inf   2.762  0.0158
##  Control - MED21   8.3152 3.69 Inf   2.256  0.0622
##  MED1 - MED21     -2.5242 3.56 Inf  -0.709  0.7583
## 
## Time = 7, Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1   11.6924 3.92 Inf   2.979  0.0081
##  Control - MED21   9.7913 3.69 Inf   2.656  0.0216
##  MED1 - MED21     -1.9010 3.56 Inf  -0.534  0.8547
## 
## Time = 8, Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    7.2273 3.92 Inf   1.842  0.1561
##  Control - MED21   6.7807 3.69 Inf   1.839  0.1568
##  MED1 - MED21     -0.4465 3.56 Inf  -0.125  0.9914
## 
## Time = 9, Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    6.2509 3.92 Inf   1.593  0.2487
##  Control - MED21   8.0246 3.69 Inf   2.177  0.0752
##  MED1 - MED21      1.7737 3.56 Inf   0.498  0.8722
## 
## Time = 10, Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    9.6437 3.92 Inf   2.457  0.0373
##  Control - MED21   7.0980 3.69 Inf   1.925  0.1315
##  MED1 - MED21     -2.5458 3.56 Inf  -0.715  0.7547
## 
## Degrees-of-freedom method: asymptotic 
## P value adjustment: tukey method for comparing a family of 3 estimates
m.AP2 <- lmer(ERDSAlpha ~ Group * Session  + (1 | Subject), data=d.Pos, REML = FALSE)

#Alpha models effects plot

#Front Alpha effects WO AF
ae.m.AF_WO <- allEffects(m.AF_WO)
ae.m.df.AF_WO <- as.data.frame(ae.m.AF_WO[[1]])
#Ordering timepoint if needed
#ae.m.df.AF2$Time <- factor(ae.m.df.AF2$Time, levels=c('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'))

#Ordering Timepoint
ae.m.df.AF_WO$Session <- as.character(ae.m.df.AF_WO$Session)
ae.m.df.AF_WO$Session <- as.numeric(ae.m.df.AF_WO$Session)

##########################
#Posterior Alpha effects
ae.m.AP <- allEffects(m.AP)
ae.m.df.AP <- as.data.frame(ae.m.AP[[1]])
#Ordering RoI
ae.m.df.AP$Time <- factor(ae.m.df.AP$Time, levels=c('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'))

#Ordering Timepoint
ae.m.df.AP$Session <- as.character(ae.m.df.AP$Session)
ae.m.df.AP$Session <- as.numeric(ae.m.df.AP$Session)
ae.m.df.AP$Time <- as.character(ae.m.df.AP$Time)
ae.m.df.AP$Time <- as.numeric(ae.m.df.AP$Time)

#Alpha models effects plot

#Some ggplot2 customization to implement if needed.
#limits=c(0.75,3.25)
#breaks=c(1,2,3,4,5,6,7,8,9,10)
#+facet_grid(Session~.)
#geom_line(aes(color=Group),size=1)
#geom_ribbon(aes(ymin=fit-se, ymax=fit+se, fill=Group), alpha=0.2)
#geom_smooth(aes(color=Group),size=1)
#geom_line(aes(color=Group),size=1)

#Frontal Alpha WO Model plot
ae.AF_WO <- ggplot(ae.m.df.AF_WO, aes(x=Session,y=fit, color=Group))+
  geom_line(aes(color=Group),size=1) +
  geom_path(aes(x=Session, y=fit, color=Group)) +
  geom_errorbar(aes(ymin=fit-se, ymax=fit+se), width=.1) +
  geom_point(aes(color = Group), size=3)+
  ylab("Frontal Alpha ERDS (%)")+
  scale_x_continuous(name="Session", breaks=c(1,2,3))+
  ggtitle("Frontal Alpha ERDS (%): Group x Session")+
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(), axis.line = element_line(colour = "black"))
plot(ae.AF_WO)

#Geombar
ae.AF_WO_bar <- ggplot(ae.m.df.AF_WO, aes(fill= Group, y = fit, x = Session))+
  geom_col(position = "dodge")+
  geom_errorbar(aes(ymin=fit-se, ymax=fit+se), 
                position = position_dodge(0.9), width = .3)+
  scale_x_discrete(name = "Frontal Alpha ERDS (%)", label = c("Session 1", "Session 2" ,"Session 3"))+
  ylab("Frontal Alpha ERDS (%)")+
  ggsci::scale_fill_jco(name = "Group")+
  ggpubr::theme_pubclean()+
  theme(axis.title.x = element_blank(), legend.position = "right")+
  coord_cartesian(expand = FALSE)
plot(ae.AF_WO_bar)

#Posterior Alpha model plot
ae.AP <- ggplot(ae.m.df.AP, aes(x=Time, y=fit, group=Group)) +
  geom_line(aes(color=Group),size=1) +
  geom_ribbon(aes(ymin=fit-se, ymax=fit+se, fill=Group), alpha=0.2) +
  geom_point(aes(color = Group, shape = Group), size=3)+
  ylab("Alpha ERDS (%)")+
  scale_x_continuous(name="Time", breaks=c(1,2,3,4,5,6,7,8,9,10))+
  ggtitle("Posterior Alpha ERDS % Group x Session x Time")+
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(), axis.line = element_line(colour = "black"), axis.text = element_text(size = 25))+
  facet_grid(.~Session)
plot(ae.AP)

#Theta models

#Model 1: Theta Frontal
m.TF_WO <- lmer(ERDSTheta ~ Group * Session *Time  + (1 | Subject), data=d.Fro2, control=lmerControl(optimizer="bobyqa"), REML = FALSE)
Anova(m.TF_WO)
#m.AFtest <- as(m.AF,"lmerModLmerTest")

#########################

#Model 3: Theta Posterior
m.TP <- lmer(ERDSTheta ~ Session * Group * Time  + (1 | Subject), data=d.Pos, control=lmerControl(optimizer="bobyqa"), REML = FALSE)
Anova(m.TP)
#m.AFtest <- as(m.AF,"lmerModLmerTest")
#summary(m.TP, ddf="Satterthwaite")

#Theta Posthocs to determine exact locus

#Frontal Theta WO
emmeans(m.TF_WO, pairwise ~ Group | Session)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 15480' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 15480)' 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 = 15480' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 15480)' or larger];
## but be warned that this may result in large computation time and memory use.
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
## Session = 1:
##  Group    emmean    SE  df asymp.LCL asymp.UCL
##  Control 22.9170 10.11 Inf      3.10      42.7
##  MED1     0.0698  9.53 Inf    -18.62      18.8
##  MED21   22.7481  8.26 Inf      6.57      38.9
## 
## Session = 2:
##  Group    emmean    SE  df asymp.LCL asymp.UCL
##  Control  3.4295 10.11 Inf    -16.39      23.2
##  MED1    14.1246  9.53 Inf     -4.56      32.8
##  MED21   22.1236  8.28 Inf      5.89      38.4
## 
## Session = 3:
##  Group    emmean    SE  df asymp.LCL asymp.UCL
##  Control -3.2588 10.11 Inf    -23.08      16.6
##  MED1     3.4655  9.53 Inf    -15.22      22.2
##  MED21   11.3798  8.26 Inf     -4.80      27.6
## 
## Results are averaged over the levels of: Time 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## 
## $contrasts
## Session = 1:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    22.847 13.9 Inf   1.644  0.2273
##  Control - MED21    0.169 13.1 Inf   0.013  0.9999
##  MED1 - MED21     -22.678 12.6 Inf  -1.798  0.1702
## 
## Session = 2:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1   -10.695 13.9 Inf  -0.770  0.7217
##  Control - MED21  -18.694 13.1 Inf  -1.430  0.3253
##  MED1 - MED21      -7.999 12.6 Inf  -0.633  0.8017
## 
## Session = 3:
##  contrast        estimate   SE  df z.ratio p.value
##  Control - MED1    -6.724 13.9 Inf  -0.484  0.8790
##  Control - MED21  -14.639 13.1 Inf  -1.121  0.5009
##  MED1 - MED21      -7.914 12.6 Inf  -0.627  0.8050
## 
## Results are averaged over the levels of: Time 
## Degrees-of-freedom method: asymptotic 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(m.TF_WO, pairwise ~ Session | Group)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 15480' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 15480)' 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 = 15480' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 15480)' or larger];
## but be warned that this may result in large computation time and memory use.
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
## Group = Control:
##  Session  emmean    SE  df asymp.LCL asymp.UCL
##  1       22.9170 10.11 Inf      3.10      42.7
##  2        3.4295 10.11 Inf    -16.39      23.2
##  3       -3.2588 10.11 Inf    -23.08      16.6
## 
## Group = MED1:
##  Session  emmean    SE  df asymp.LCL asymp.UCL
##  1        0.0698  9.53 Inf    -18.62      18.8
##  2       14.1246  9.53 Inf     -4.56      32.8
##  3        3.4655  9.53 Inf    -15.22      22.2
## 
## Group = MED21:
##  Session  emmean    SE  df asymp.LCL asymp.UCL
##  1       22.7481  8.26 Inf      6.57      38.9
##  2       22.1236  8.28 Inf      5.89      38.4
##  3       11.3798  8.26 Inf     -4.80      27.6
## 
## Results are averaged over the levels of: Time 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## 
## $contrasts
## Group = Control:
##  contrast estimate   SE  df z.ratio p.value
##  1 - 2      19.488 3.06 Inf   6.376  <.0001
##  1 - 3      26.176 3.06 Inf   8.564  <.0001
##  2 - 3       6.688 3.06 Inf   2.188  0.0732
## 
## Group = MED1:
##  contrast estimate   SE  df z.ratio p.value
##  1 - 2     -14.055 2.88 Inf  -4.877  <.0001
##  1 - 3      -3.396 2.88 Inf  -1.178  0.4661
##  2 - 3      10.659 2.88 Inf   3.699  0.0006
## 
## Group = MED21:
##  contrast estimate   SE  df z.ratio p.value
##  1 - 2       0.624 2.58 Inf   0.242  0.9682
##  1 - 3      11.368 2.50 Inf   4.555  <.0001
##  2 - 3      10.744 2.58 Inf   4.166  0.0001
## 
## Results are averaged over the levels of: Time 
## Degrees-of-freedom method: asymptotic 
## P value adjustment: tukey method for comparing a family of 3 estimates
m.TF_WO <- lmer(ERDSTheta ~ Group * Session  + (1 | Subject), data=d.Fro2, REML = FALSE)

#########################

#Posterior Theta
emmeans(m.TP, pairwise ~ Group | Session | Time)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 15410' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 15410)' 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 = 15410' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 15410)' or larger];
## but be warned that this may result in large computation time and memory use.
## $emmeans
## Session = 1, Time = 1:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control  28.06 249 Inf   -460.13       516
##  MED1     35.23 234 Inf   -424.00       494
##  MED21     7.16 203 Inf   -389.74       404
## 
## Session = 2, Time = 1:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 138.36 248 Inf   -348.03       625
##  MED1    126.23 234 Inf   -331.52       584
##  MED21     3.11 207 Inf   -402.94       409
## 
## Session = 3, Time = 1:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control  14.24 248 Inf   -471.28       500
##  MED1      3.41 234 Inf   -454.35       461
##  MED21    11.48 202 Inf   -384.95       408
## 
## Session = 1, Time = 2:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control  58.13 249 Inf   -430.06       546
##  MED1     65.94 234 Inf   -393.29       525
##  MED21    96.52 203 Inf   -300.39       493
## 
## Session = 2, Time = 2:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 146.89 248 Inf   -339.50       633
##  MED1    300.61 234 Inf   -157.14       758
##  MED21    33.92 207 Inf   -372.13       440
## 
## Session = 3, Time = 2:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control  38.46 248 Inf   -447.06       524
##  MED1     77.59 234 Inf   -380.16       535
##  MED21   494.16 202 Inf     97.73       891
## 
## Session = 1, Time = 3:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control  77.44 249 Inf   -410.76       566
##  MED1    108.52 234 Inf   -350.71       568
##  MED21   181.47 203 Inf   -215.43       578
## 
## Session = 2, Time = 3:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 227.45 248 Inf   -258.94       714
##  MED1    347.52 234 Inf   -110.24       805
##  MED21   114.11 207 Inf   -291.94       520
## 
## Session = 3, Time = 3:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 119.22 248 Inf   -366.30       605
##  MED1    121.83 234 Inf   -335.93       580
##  MED21   550.43 202 Inf    154.01       947
## 
## Session = 1, Time = 4:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control  83.07 249 Inf   -405.12       571
##  MED1    123.47 234 Inf   -335.76       583
##  MED21   264.95 203 Inf   -131.95       662
## 
## Session = 2, Time = 4:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 105.69 248 Inf   -380.71       592
##  MED1    462.86 234 Inf      5.11       921
##  MED21    76.38 207 Inf   -329.68       482
## 
## Session = 3, Time = 4:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 156.68 248 Inf   -328.84       642
##  MED1    145.74 234 Inf   -312.01       603
##  MED21   716.07 202 Inf    319.64      1112
## 
## Session = 1, Time = 5:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control  76.65 249 Inf   -411.55       565
##  MED1    183.86 234 Inf   -275.37       643
##  MED21   299.09 203 Inf    -97.81       696
## 
## Session = 2, Time = 5:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 206.46 248 Inf   -279.94       693
##  MED1    584.74 234 Inf    126.99      1042
##  MED21   173.59 207 Inf   -232.46       580
## 
## Session = 3, Time = 5:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 192.67 248 Inf   -292.85       678
##  MED1    204.67 234 Inf   -253.08       662
##  MED21   650.66 202 Inf    254.24      1047
## 
## Session = 1, Time = 6:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control  65.99 249 Inf   -422.20       554
##  MED1    205.26 234 Inf   -253.97       664
##  MED21   381.03 203 Inf    -15.87       778
## 
## Session = 2, Time = 6:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 288.49 248 Inf   -197.91       775
##  MED1    666.97 234 Inf    209.21      1125
##  MED21   123.21 207 Inf   -282.85       529
## 
## Session = 3, Time = 6:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 135.46 248 Inf   -350.06       621
##  MED1    238.48 234 Inf   -219.27       696
##  MED21   832.94 202 Inf    436.52      1229
## 
## Session = 1, Time = 7:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control  51.84 249 Inf   -436.35       540
##  MED1    204.30 234 Inf   -254.93       664
##  MED21   430.41 203 Inf     33.51       827
## 
## Session = 2, Time = 7:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 296.28 248 Inf   -190.12       783
##  MED1    497.52 234 Inf     39.77       955
##  MED21   118.09 207 Inf   -287.96       524
## 
## Session = 3, Time = 7:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 162.91 248 Inf   -322.61       648
##  MED1    262.10 234 Inf   -195.66       720
##  MED21   883.29 202 Inf    486.86      1280
## 
## Session = 1, Time = 8:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control  52.14 249 Inf   -436.06       540
##  MED1    212.35 234 Inf   -246.88       672
##  MED21   378.53 203 Inf    -18.37       775
## 
## Session = 2, Time = 8:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 241.09 248 Inf   -245.31       727
##  MED1    608.45 234 Inf    150.70      1066
##  MED21   153.12 207 Inf   -252.94       559
## 
## Session = 3, Time = 8:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 326.80 248 Inf   -158.72       812
##  MED1    193.79 234 Inf   -263.96       652
##  MED21   812.13 202 Inf    415.71      1209
## 
## Session = 1, Time = 9:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control  44.72 249 Inf   -443.47       533
##  MED1    217.97 234 Inf   -241.26       677
##  MED21   275.05 203 Inf   -121.86       672
## 
## Session = 2, Time = 9:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 310.60 248 Inf   -175.80       797
##  MED1    573.41 234 Inf    115.66      1031
##  MED21   308.17 207 Inf    -97.88       714
## 
## Session = 3, Time = 9:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 290.58 248 Inf   -194.94       776
##  MED1    110.92 234 Inf   -346.84       569
##  MED21   793.70 202 Inf    397.27      1190
## 
## Session = 1, Time = 10:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control  71.26 249 Inf   -416.93       559
##  MED1    232.86 234 Inf   -226.37       692
##  MED21   405.98 203 Inf      9.08       803
## 
## Session = 2, Time = 10:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 297.14 248 Inf   -189.25       784
##  MED1    487.43 234 Inf     29.67       945
##  MED21   495.45 207 Inf     89.39       901
## 
## Session = 3, Time = 10:
##  Group   emmean  SE  df asymp.LCL asymp.UCL
##  Control 135.36 248 Inf   -350.16       621
##  MED1    158.82 234 Inf   -298.94       617
##  MED21   768.86 202 Inf    372.43      1165
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## 
## $contrasts
## Session = 1, Time = 1:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1     -7.17 342 Inf  -0.021  0.9998
##  Control - MED21    20.90 321 Inf   0.065  0.9977
##  MED1 - MED21       28.07 310 Inf   0.091  0.9955
## 
## Session = 2, Time = 1:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1     12.13 341 Inf   0.036  0.9993
##  Control - MED21   135.26 323 Inf   0.418  0.9080
##  MED1 - MED21      123.12 312 Inf   0.394  0.9178
## 
## Session = 3, Time = 1:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1     10.83 340 Inf   0.032  0.9994
##  Control - MED21     2.76 320 Inf   0.009  1.0000
##  MED1 - MED21       -8.07 309 Inf  -0.026  0.9996
## 
## Session = 1, Time = 2:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1     -7.81 342 Inf  -0.023  0.9997
##  Control - MED21   -38.38 321 Inf  -0.120  0.9921
##  MED1 - MED21      -30.57 310 Inf  -0.099  0.9946
## 
## Session = 2, Time = 2:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -153.72 341 Inf  -0.451  0.8939
##  Control - MED21   112.97 323 Inf   0.349  0.9349
##  MED1 - MED21      266.70 312 Inf   0.854  0.6692
## 
## Session = 3, Time = 2:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1    -39.14 340 Inf  -0.115  0.9927
##  Control - MED21  -455.70 320 Inf  -1.425  0.3280
##  MED1 - MED21     -416.57 309 Inf  -1.348  0.3684
## 
## Session = 1, Time = 3:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1    -31.08 342 Inf  -0.091  0.9955
##  Control - MED21  -104.03 321 Inf  -0.324  0.9438
##  MED1 - MED21      -72.95 310 Inf  -0.236  0.9699
## 
## Session = 2, Time = 3:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -120.06 341 Inf  -0.352  0.9339
##  Control - MED21   113.34 323 Inf   0.351  0.9345
##  MED1 - MED21      233.40 312 Inf   0.748  0.7351
## 
## Session = 3, Time = 3:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1     -2.61 340 Inf  -0.008  1.0000
##  Control - MED21  -431.21 320 Inf  -1.348  0.3684
##  MED1 - MED21     -428.61 309 Inf  -1.387  0.3476
## 
## Session = 1, Time = 4:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1    -40.40 342 Inf  -0.118  0.9923
##  Control - MED21  -181.88 321 Inf  -0.567  0.8379
##  MED1 - MED21     -141.48 310 Inf  -0.457  0.8913
## 
## Session = 2, Time = 4:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -357.18 341 Inf  -1.048  0.5465
##  Control - MED21    29.31 323 Inf   0.091  0.9955
##  MED1 - MED21      386.49 312 Inf   1.238  0.4307
## 
## Session = 3, Time = 4:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1     10.94 340 Inf   0.032  0.9994
##  Control - MED21  -559.39 320 Inf  -1.749  0.1871
##  MED1 - MED21     -570.33 309 Inf  -1.846  0.1548
## 
## Session = 1, Time = 5:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -107.21 342 Inf  -0.314  0.9473
##  Control - MED21  -222.44 321 Inf  -0.693  0.7676
##  MED1 - MED21     -115.23 310 Inf  -0.372  0.9265
## 
## Session = 2, Time = 5:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -378.28 341 Inf  -1.110  0.5078
##  Control - MED21    32.86 323 Inf   0.102  0.9943
##  MED1 - MED21      411.15 312 Inf   1.317  0.3857
## 
## Session = 3, Time = 5:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1    -12.00 340 Inf  -0.035  0.9993
##  Control - MED21  -457.99 320 Inf  -1.432  0.3243
##  MED1 - MED21     -445.99 309 Inf  -1.444  0.3186
## 
## Session = 1, Time = 6:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -139.27 342 Inf  -0.407  0.9126
##  Control - MED21  -315.04 321 Inf  -0.981  0.5887
##  MED1 - MED21     -175.77 310 Inf  -0.568  0.8374
## 
## Session = 2, Time = 6:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -378.48 341 Inf  -1.111  0.5075
##  Control - MED21   165.28 323 Inf   0.511  0.8659
##  MED1 - MED21      543.76 312 Inf   1.742  0.1897
## 
## Session = 3, Time = 6:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -103.03 340 Inf  -0.303  0.9508
##  Control - MED21  -697.49 320 Inf  -2.181  0.0744
##  MED1 - MED21     -594.46 309 Inf  -1.924  0.1319
## 
## Session = 1, Time = 7:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -152.46 342 Inf  -0.446  0.8962
##  Control - MED21  -378.57 321 Inf  -1.179  0.4655
##  MED1 - MED21     -226.11 310 Inf  -0.730  0.7456
## 
## Session = 2, Time = 7:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -201.24 341 Inf  -0.591  0.8252
##  Control - MED21   178.19 323 Inf   0.551  0.8459
##  MED1 - MED21      379.43 312 Inf   1.215  0.4440
## 
## Session = 3, Time = 7:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1    -99.18 340 Inf  -0.291  0.9543
##  Control - MED21  -720.37 320 Inf  -2.253  0.0627
##  MED1 - MED21     -621.19 309 Inf  -2.011  0.1096
## 
## Session = 1, Time = 8:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -160.21 342 Inf  -0.469  0.8861
##  Control - MED21  -326.39 321 Inf  -1.017  0.5662
##  MED1 - MED21     -166.18 310 Inf  -0.537  0.8533
## 
## Session = 2, Time = 8:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -367.36 341 Inf  -1.078  0.5278
##  Control - MED21    87.97 323 Inf   0.272  0.9600
##  MED1 - MED21      455.33 312 Inf   1.458  0.3111
## 
## Session = 3, Time = 8:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1    133.00 340 Inf   0.391  0.9193
##  Control - MED21  -485.34 320 Inf  -1.518  0.2826
##  MED1 - MED21     -618.34 309 Inf  -2.001  0.1119
## 
## Session = 1, Time = 9:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -173.25 342 Inf  -0.507  0.8681
##  Control - MED21  -230.32 321 Inf  -0.717  0.7531
##  MED1 - MED21      -57.07 310 Inf  -0.184  0.9814
## 
## Session = 2, Time = 9:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -262.81 341 Inf  -0.771  0.7207
##  Control - MED21     2.42 323 Inf   0.008  1.0000
##  MED1 - MED21      265.24 312 Inf   0.850  0.6721
## 
## Session = 3, Time = 9:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1    179.66 340 Inf   0.528  0.8578
##  Control - MED21  -503.12 320 Inf  -1.573  0.2573
##  MED1 - MED21     -682.78 309 Inf  -2.210  0.0695
## 
## Session = 1, Time = 10:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -161.60 342 Inf  -0.473  0.8842
##  Control - MED21  -334.71 321 Inf  -1.043  0.5499
##  MED1 - MED21     -173.12 310 Inf  -0.559  0.8418
## 
## Session = 2, Time = 10:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1   -190.28 341 Inf  -0.558  0.8422
##  Control - MED21  -198.30 323 Inf  -0.613  0.8128
##  MED1 - MED21       -8.02 312 Inf  -0.026  0.9996
## 
## Session = 3, Time = 10:
##  contrast        estimate  SE  df z.ratio p.value
##  Control - MED1    -23.46 340 Inf  -0.069  0.9974
##  Control - MED21  -633.50 320 Inf  -1.981  0.1169
##  MED1 - MED21     -610.04 309 Inf  -1.974  0.1185
## 
## Degrees-of-freedom method: asymptotic 
## P value adjustment: tukey method for comparing a family of 3 estimates
m.TP2 <- lmer(ERDSTheta ~ Group * Session  + (1 | Subject), data=d.Pos, REML = FALSE)

#Theta models effects plot

#Frontal Theta effects
#ae.m.TF2 <- allEffects(m.TF2)
#ae.m.df.TF2 <- as.data.frame(ae.m.TF2[[1]])
#Ordering timepoint if needed
#ae.m.df.AF2$Time <- factor(ae.m.df.AF2$Time, levels=c('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'))

#Ordering Session
#ae.m.df.TF2$Session <- as.character(ae.m.df.TF2$Session)
#ae.m.df.TF2$Session <- as.numeric(ae.m.df.TF2$Session)

#################################
#Frontal Theta effects WO
ae.m.TF_WO <- allEffects(m.TF_WO)
ae.m.df.TF_WO <- as.data.frame(ae.m.TF_WO[[1]])
#Ordering timepoint if needed
#ae.m.df.AF2$Time <- factor(ae.m.df.AF2$Time, levels=c('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'))

#Ordering Session
ae.m.df.TF_WO$Session <- as.character(ae.m.df.TF_WO$Session)
ae.m.df.TF_WO$Session <- as.numeric(ae.m.df.TF_WO$Session)

##########################
#Posterior Theta effects
ae.m.TP2 <- allEffects(m.TP2)
ae.m.df.TP2 <- as.data.frame(ae.m.TP2[[1]])

#Ordering Timepoint
ae.m.df.TP2$Session <- as.character(ae.m.df.TP2$Session)
ae.m.df.TP2$Session <- as.numeric(ae.m.df.TP2$Session)

#Posterior 3 Way
ae.m.TP <- allEffects(m.TP)
ae.m.df.TP <- as.data.frame(ae.m.TP[[1]])
#Ordering RoI
ae.m.df.TP$Time <- factor(ae.m.df.TP$Time, levels=c('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'))

#Ordering Timepoint
ae.m.df.TP$Session <- as.character(ae.m.df.TP$Session)
ae.m.df.TP$Session <- as.numeric(ae.m.df.TP$Session)
ae.m.df.TP$Time <- as.character(ae.m.df.TP$Time)
ae.m.df.TP$Time <- as.numeric(ae.m.df.TP$Time)

#Theta models effects plot

#Some ggplot 2 settings to implement if needed.
#limits=c(0.75,3.25)
#breaks=c(1,2,3,4,5,6,7,8,9,10)
#+facet_grid(Session~.)

#Frontal Theta: Grp * Session plot
#ae.TF2 <- ggplot(ae.m.df.TF2, aes(x=Session,y=fit, color=Group))+
#  geom_line() +
#  geom_path(aes(x=Session, y=fit, color=Group)) +
#  geom_errorbar(aes(ymin=fit-se, ymax=fit+se), width=.1) +
#  geom_point(aes(color = Group), size=3)+
#  ylab("Frontal Theta ERDS (%)")+
#  scale_x_continuous(name="Session", breaks=c(1,2,3))+
#  ggtitle("Frontal Theta ERDS (%): Group x Session")+
#  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(), axis.line = element_line(colour = "black"))
#plot(ae.TF2)

#Frontal Theta WO: Grp * Session plot 
ae.TF_WO <- ggplot(ae.m.df.TF_WO, aes(x=Session,y=fit, color=Group))+
  geom_line() +
  geom_path(aes(x=Session, y=fit, color=Group)) +
  geom_errorbar(aes(ymin=fit-se, ymax=fit+se), width=.1) +
  geom_point(aes(color = Group), size=3)+
  ylab("Frontal Theta ERDS (%)")+
  scale_x_continuous(name="Session", breaks=c(1,2,3))+
  ggtitle("Frontal Theta ERDS (%): Group x Session")+
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(), axis.line = element_line(colour = "black"))
plot(ae.TF_WO)

#Posterior Theta: Grp * Session plot
ae.TP2 <- ggplot(ae.m.df.TP2, aes(x=Session,y=fit, color=Group))+
  geom_line() +
  geom_path(aes(x=Session, y=fit, color=Group)) +
  geom_errorbar(aes(ymin=fit-se, ymax=fit+se), width=.1) +
  geom_point(aes(color = Group), size=3)+
  ylab("Posterior Theta ERDS (%)")+
  scale_x_continuous(name="Session", breaks=c(1,2,3))+
  ggtitle("Posterior Theta ERDS (%): Group x Session")+
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(), axis.line = element_line(colour = "black"))
plot(ae.TP2)

#Posterior 3-Way model plot
ae.TP <- ggplot(ae.m.df.TP, aes(x=Time, y=fit, group=Group))+
  geom_ribbon(aes(ymin=fit-se, ymax=fit+se, fill=Group), alpha=0.2) +
  geom_line(aes(color=Group),size=1) +
  geom_point(aes(color = Group, shape = Group), size=3)+
  ylab("Theta ERDS (%)")+
  scale_x_continuous(name="Time", breaks=c(1,2,3,4,5,6,7,8,9,10))+
  ggtitle("Posterior Theta ERDS % Group x Session x Time")+
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(), axis.line = element_line(colour = "black"), axis.text = element_text(size = 25))+
  facet_grid(.~Session)
plot(ae.TP)

#Theta to Alpha Models

#Model 1: TAR Frontal
m.TARF_WO <- lmer(TAR2 ~ Group * Session * Time  + (1 | Subject), data=d.Fro2, REML = FALSE)
Anova(m.TARF_WO)
#m.AFtest <- as(m.AF,"lmerModLmerTest")
#summary(m.TARF_WO, ddf="Satterthwaite")

#Model 3: TAR Posterior
m.TARP <- lmer(TAR ~ Group * Session * Time  + (1 | Subject), data=d.Pos, REML = FALSE)
Anova(m.TARP)
#m.AFtest <- as(m.AF,"lmerModLmerTest")
#summary(m.TARP, ddf="Satterthwaite")

#TAR Posthocs to determine exact locus

#Frontal TAR
emmeans(m.TARF_WO, pairwise ~ Group| Time | Session)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 15480' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 15480)' 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 = 15480' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 15480)' or larger];
## but be warned that this may result in large computation time and memory use.
## $emmeans
## Time = 1, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.974 0.0320 Inf     0.911     1.036
##  MED1     1.045 0.0302 Inf     0.986     1.104
##  MED21    1.063 0.0261 Inf     1.011     1.114
## 
## Time = 2, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.972 0.0320 Inf     0.910     1.035
##  MED1     1.061 0.0302 Inf     1.002     1.120
##  MED21    1.061 0.0261 Inf     1.010     1.112
## 
## Time = 3, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.987 0.0320 Inf     0.924     1.050
##  MED1     1.091 0.0302 Inf     1.032     1.150
##  MED21    1.074 0.0261 Inf     1.023     1.125
## 
## Time = 4, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.998 0.0320 Inf     0.935     1.060
##  MED1     1.083 0.0302 Inf     1.024     1.142
##  MED21    1.109 0.0261 Inf     1.058     1.161
## 
## Time = 5, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.984 0.0320 Inf     0.921     1.047
##  MED1     1.089 0.0302 Inf     1.030     1.148
##  MED21    1.081 0.0261 Inf     1.030     1.132
## 
## Time = 6, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.977 0.0320 Inf     0.914     1.040
##  MED1     1.089 0.0302 Inf     1.030     1.148
##  MED21    1.083 0.0261 Inf     1.032     1.134
## 
## Time = 7, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.990 0.0320 Inf     0.928     1.053
##  MED1     1.081 0.0302 Inf     1.022     1.140
##  MED21    1.084 0.0261 Inf     1.033     1.136
## 
## Time = 8, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.963 0.0320 Inf     0.900     1.025
##  MED1     1.071 0.0302 Inf     1.012     1.130
##  MED21    1.061 0.0261 Inf     1.010     1.112
## 
## Time = 9, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.966 0.0320 Inf     0.903     1.029
##  MED1     1.074 0.0302 Inf     1.015     1.134
##  MED21    1.049 0.0261 Inf     0.997     1.100
## 
## Time = 10, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.974 0.0320 Inf     0.912     1.037
##  MED1     1.061 0.0302 Inf     1.001     1.120
##  MED21    1.070 0.0261 Inf     1.019     1.121
## 
## Time = 1, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.940 0.0320 Inf     0.877     1.002
##  MED1     1.080 0.0302 Inf     1.021     1.139
##  MED21    1.065 0.0262 Inf     1.013     1.116
## 
## Time = 2, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.941 0.0320 Inf     0.878     1.004
##  MED1     1.070 0.0302 Inf     1.011     1.129
##  MED21    1.075 0.0262 Inf     1.024     1.126
## 
## Time = 3, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.964 0.0320 Inf     0.901     1.027
##  MED1     1.067 0.0302 Inf     1.008     1.126
##  MED21    1.074 0.0262 Inf     1.023     1.125
## 
## Time = 4, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.955 0.0320 Inf     0.892     1.018
##  MED1     1.074 0.0302 Inf     1.014     1.133
##  MED21    1.093 0.0262 Inf     1.042     1.144
## 
## Time = 5, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.935 0.0320 Inf     0.872     0.998
##  MED1     1.082 0.0302 Inf     1.023     1.141
##  MED21    1.102 0.0262 Inf     1.051     1.153
## 
## Time = 6, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.936 0.0320 Inf     0.873     0.998
##  MED1     1.129 0.0302 Inf     1.070     1.188
##  MED21    1.105 0.0262 Inf     1.053     1.156
## 
## Time = 7, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.938 0.0320 Inf     0.876     1.001
##  MED1     1.110 0.0302 Inf     1.051     1.169
##  MED21    1.082 0.0262 Inf     1.031     1.134
## 
## Time = 8, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.938 0.0320 Inf     0.875     1.001
##  MED1     1.089 0.0302 Inf     1.030     1.148
##  MED21    1.060 0.0262 Inf     1.008     1.111
## 
## Time = 9, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.932 0.0320 Inf     0.869     0.994
##  MED1     1.105 0.0302 Inf     1.046     1.164
##  MED21    1.062 0.0262 Inf     1.010     1.113
## 
## Time = 10, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.940 0.0320 Inf     0.877     1.002
##  MED1     1.072 0.0302 Inf     1.012     1.131
##  MED21    1.069 0.0262 Inf     1.018     1.121
## 
## Time = 1, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.948 0.0320 Inf     0.885     1.010
##  MED1     1.055 0.0302 Inf     0.996     1.114
##  MED21    1.038 0.0261 Inf     0.987     1.089
## 
## Time = 2, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.942 0.0320 Inf     0.879     1.005
##  MED1     1.060 0.0302 Inf     1.001     1.119
##  MED21    1.063 0.0261 Inf     1.012     1.114
## 
## Time = 3, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.961 0.0320 Inf     0.898     1.024
##  MED1     1.071 0.0302 Inf     1.012     1.130
##  MED21    1.064 0.0261 Inf     1.012     1.115
## 
## Time = 4, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.948 0.0320 Inf     0.885     1.011
##  MED1     1.097 0.0302 Inf     1.038     1.156
##  MED21    1.085 0.0261 Inf     1.034     1.137
## 
## Time = 5, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.948 0.0320 Inf     0.885     1.011
##  MED1     1.107 0.0302 Inf     1.048     1.166
##  MED21    1.085 0.0261 Inf     1.034     1.136
## 
## Time = 6, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.937 0.0320 Inf     0.874     1.000
##  MED1     1.099 0.0302 Inf     1.040     1.158
##  MED21    1.077 0.0261 Inf     1.026     1.128
## 
## Time = 7, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.943 0.0320 Inf     0.881     1.006
##  MED1     1.096 0.0302 Inf     1.036     1.155
##  MED21    1.087 0.0261 Inf     1.036     1.138
## 
## Time = 8, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.971 0.0320 Inf     0.908     1.033
##  MED1     1.097 0.0302 Inf     1.038     1.156
##  MED21    1.055 0.0261 Inf     1.004     1.106
## 
## Time = 9, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.967 0.0320 Inf     0.905     1.030
##  MED1     1.071 0.0302 Inf     1.012     1.130
##  MED21    1.053 0.0261 Inf     1.002     1.104
## 
## Time = 10, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.938 0.0320 Inf     0.875     1.001
##  MED1     1.093 0.0302 Inf     1.034     1.152
##  MED21    1.060 0.0261 Inf     1.009     1.111
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## 
## $contrasts
## Time = 1, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.071080 0.0440 Inf  -1.617  0.2385
##  Control - MED21 -0.088837 0.0413 Inf  -2.151  0.0799
##  MED1 - MED21    -0.017757 0.0399 Inf  -0.445  0.8966
## 
## Time = 2, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.088262 0.0440 Inf  -2.007  0.1104
##  Control - MED21 -0.088626 0.0413 Inf  -2.146  0.0808
##  MED1 - MED21    -0.000363 0.0399 Inf  -0.009  1.0000
## 
## Time = 3, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.103717 0.0440 Inf  -2.359  0.0481
##  Control - MED21 -0.087081 0.0413 Inf  -2.108  0.0881
##  MED1 - MED21     0.016636 0.0399 Inf   0.417  0.9086
## 
## Time = 4, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.085559 0.0440 Inf  -1.946  0.1260
##  Control - MED21 -0.111558 0.0413 Inf  -2.701  0.0189
##  MED1 - MED21    -0.025999 0.0399 Inf  -0.652  0.7915
## 
## Time = 5, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.105517 0.0440 Inf  -2.400  0.0433
##  Control - MED21 -0.097385 0.0413 Inf  -2.358  0.0482
##  MED1 - MED21     0.008132 0.0399 Inf   0.204  0.9774
## 
## Time = 6, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.111786 0.0440 Inf  -2.542  0.0296
##  Control - MED21 -0.106243 0.0413 Inf  -2.572  0.0273
##  MED1 - MED21     0.005543 0.0399 Inf   0.139  0.9894
## 
## Time = 7, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.090634 0.0440 Inf  -2.061  0.0980
##  Control - MED21 -0.093947 0.0413 Inf  -2.275  0.0594
##  MED1 - MED21    -0.003313 0.0399 Inf  -0.083  0.9962
## 
## Time = 8, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.107932 0.0440 Inf  -2.455  0.0375
##  Control - MED21 -0.098129 0.0413 Inf  -2.376  0.0461
##  MED1 - MED21     0.009803 0.0399 Inf   0.246  0.9673
## 
## Time = 9, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.108466 0.0440 Inf  -2.467  0.0363
##  Control - MED21 -0.082718 0.0413 Inf  -2.003  0.1115
##  MED1 - MED21     0.025749 0.0399 Inf   0.645  0.7950
## 
## Time = 10, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.086330 0.0440 Inf  -1.963  0.1214
##  Control - MED21 -0.095686 0.0413 Inf  -2.317  0.0535
##  MED1 - MED21    -0.009356 0.0399 Inf  -0.234  0.9701
## 
## Time = 1, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.140166 0.0440 Inf  -3.188  0.0041
##  Control - MED21 -0.125163 0.0413 Inf  -3.027  0.0070
##  MED1 - MED21     0.015002 0.0399 Inf   0.376  0.9252
## 
## Time = 2, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.129395 0.0440 Inf  -2.943  0.0091
##  Control - MED21 -0.134262 0.0413 Inf  -3.247  0.0033
##  MED1 - MED21    -0.004867 0.0399 Inf  -0.122  0.9919
## 
## Time = 3, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.103239 0.0440 Inf  -2.348  0.0495
##  Control - MED21 -0.109801 0.0413 Inf  -2.656  0.0216
##  MED1 - MED21    -0.006562 0.0399 Inf  -0.164  0.9852
## 
## Time = 4, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.118649 0.0440 Inf  -2.699  0.0191
##  Control - MED21 -0.138203 0.0413 Inf  -3.342  0.0024
##  MED1 - MED21    -0.019555 0.0399 Inf  -0.489  0.8763
## 
## Time = 5, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.147096 0.0440 Inf  -3.346  0.0024
##  Control - MED21 -0.167114 0.0413 Inf  -4.042  0.0002
##  MED1 - MED21    -0.020018 0.0399 Inf  -0.501  0.8708
## 
## Time = 6, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.193575 0.0440 Inf  -4.403  <.0001
##  Control - MED21 -0.168961 0.0413 Inf  -4.086  0.0001
##  MED1 - MED21     0.024614 0.0399 Inf   0.616  0.8113
## 
## Time = 7, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.171738 0.0440 Inf  -3.906  0.0003
##  Control - MED21 -0.143901 0.0413 Inf  -3.480  0.0015
##  MED1 - MED21     0.027836 0.0399 Inf   0.697  0.7654
## 
## Time = 8, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.151400 0.0440 Inf  -3.443  0.0017
##  Control - MED21 -0.121812 0.0413 Inf  -2.946  0.0090
##  MED1 - MED21     0.029587 0.0399 Inf   0.741  0.7393
## 
## Time = 9, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.173267 0.0440 Inf  -3.941  0.0002
##  Control - MED21 -0.130156 0.0413 Inf  -3.148  0.0047
##  MED1 - MED21     0.043111 0.0399 Inf   1.079  0.5270
## 
## Time = 10, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.132013 0.0440 Inf  -3.002  0.0075
##  Control - MED21 -0.129837 0.0413 Inf  -3.140  0.0048
##  MED1 - MED21     0.002176 0.0399 Inf   0.054  0.9984
## 
## Time = 1, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.107417 0.0440 Inf  -2.443  0.0387
##  Control - MED21 -0.090478 0.0413 Inf  -2.191  0.0727
##  MED1 - MED21     0.016939 0.0399 Inf   0.425  0.9054
## 
## Time = 2, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.117647 0.0440 Inf  -2.676  0.0204
##  Control - MED21 -0.120789 0.0413 Inf  -2.925  0.0097
##  MED1 - MED21    -0.003142 0.0399 Inf  -0.079  0.9966
## 
## Time = 3, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.110034 0.0440 Inf  -2.503  0.0330
##  Control - MED21 -0.102415 0.0413 Inf  -2.480  0.0351
##  MED1 - MED21     0.007618 0.0399 Inf   0.191  0.9801
## 
## Time = 4, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.148660 0.0440 Inf  -3.381  0.0021
##  Control - MED21 -0.137247 0.0413 Inf  -3.323  0.0026
##  MED1 - MED21     0.011413 0.0399 Inf   0.286  0.9559
## 
## Time = 5, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.159164 0.0440 Inf  -3.620  0.0009
##  Control - MED21 -0.136786 0.0413 Inf  -3.312  0.0027
##  MED1 - MED21     0.022378 0.0399 Inf   0.561  0.8409
## 
## Time = 6, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.161784 0.0440 Inf  -3.680  0.0007
##  Control - MED21 -0.139596 0.0413 Inf  -3.380  0.0021
##  MED1 - MED21     0.022188 0.0399 Inf   0.556  0.8433
## 
## Time = 7, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.152095 0.0440 Inf  -3.459  0.0016
##  Control - MED21 -0.143355 0.0413 Inf  -3.471  0.0015
##  MED1 - MED21     0.008740 0.0399 Inf   0.219  0.9739
## 
## Time = 8, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.126623 0.0440 Inf  -2.880  0.0111
##  Control - MED21 -0.084455 0.0413 Inf  -2.045  0.1017
##  MED1 - MED21     0.042168 0.0399 Inf   1.057  0.5410
## 
## Time = 9, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.103928 0.0440 Inf  -2.364  0.0475
##  Control - MED21 -0.085462 0.0413 Inf  -2.069  0.0963
##  MED1 - MED21     0.018466 0.0399 Inf   0.463  0.8887
## 
## Time = 10, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.155006 0.0440 Inf  -3.525  0.0012
##  Control - MED21 -0.121926 0.0413 Inf  -2.952  0.0089
##  MED1 - MED21     0.033080 0.0399 Inf   0.829  0.6850
## 
## Degrees-of-freedom method: asymptotic 
## P value adjustment: tukey method for comparing a family of 3 estimates
#Posterior TAR
emmeans(m.TARP, pairwise ~ Group | Time | Session)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 15410' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 15410)' 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 = 15410' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 15410)' or larger];
## but be warned that this may result in large computation time and memory use.
## $emmeans
## Time = 1, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.288 0.0619 Inf     0.167     0.410
##  MED1     0.378 0.0583 Inf     0.264     0.492
##  MED21    0.489 0.0505 Inf     0.390     0.588
## 
## Time = 2, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.325 0.0619 Inf     0.204     0.446
##  MED1     0.454 0.0583 Inf     0.340     0.568
##  MED21    0.507 0.0505 Inf     0.408     0.606
## 
## Time = 3, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.363 0.0619 Inf     0.242     0.484
##  MED1     0.617 0.0583 Inf     0.502     0.731
##  MED21    0.554 0.0505 Inf     0.455     0.653
## 
## Time = 4, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.385 0.0619 Inf     0.263     0.506
##  MED1     0.635 0.0583 Inf     0.521     0.749
##  MED21    0.575 0.0505 Inf     0.476     0.673
## 
## Time = 5, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.411 0.0619 Inf     0.289     0.532
##  MED1     0.700 0.0583 Inf     0.586     0.814
##  MED21    0.585 0.0505 Inf     0.486     0.684
## 
## Time = 6, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.406 0.0619 Inf     0.284     0.527
##  MED1     0.679 0.0583 Inf     0.565     0.793
##  MED21    0.618 0.0505 Inf     0.519     0.717
## 
## Time = 7, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.332 0.0619 Inf     0.211     0.454
##  MED1     0.678 0.0583 Inf     0.564     0.792
##  MED21    0.688 0.0505 Inf     0.589     0.787
## 
## Time = 8, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.331 0.0619 Inf     0.209     0.452
##  MED1     0.699 0.0583 Inf     0.585     0.813
##  MED21    0.635 0.0505 Inf     0.536     0.734
## 
## Time = 9, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.341 0.0619 Inf     0.220     0.463
##  MED1     0.692 0.0583 Inf     0.577     0.806
##  MED21    0.618 0.0505 Inf     0.519     0.717
## 
## Time = 10, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.388 0.0619 Inf     0.267     0.509
##  MED1     0.675 0.0583 Inf     0.560     0.789
##  MED21    0.715 0.0505 Inf     0.616     0.814
## 
## Time = 1, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.302 0.0618 Inf     0.181     0.423
##  MED1     0.425 0.0583 Inf     0.311     0.539
##  MED21    0.494 0.0507 Inf     0.394     0.593
## 
## Time = 2, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.318 0.0618 Inf     0.196     0.439
##  MED1     0.545 0.0583 Inf     0.430     0.659
##  MED21    0.566 0.0507 Inf     0.466     0.665
## 
## Time = 3, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.355 0.0618 Inf     0.234     0.476
##  MED1     0.604 0.0583 Inf     0.490     0.718
##  MED21    0.605 0.0507 Inf     0.505     0.704
## 
## Time = 4, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.334 0.0618 Inf     0.213     0.455
##  MED1     0.633 0.0583 Inf     0.519     0.747
##  MED21    0.586 0.0507 Inf     0.487     0.685
## 
## Time = 5, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.360 0.0618 Inf     0.239     0.481
##  MED1     0.665 0.0583 Inf     0.550     0.779
##  MED21    0.644 0.0507 Inf     0.545     0.744
## 
## Time = 6, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.389 0.0618 Inf     0.268     0.510
##  MED1     0.834 0.0583 Inf     0.720     0.949
##  MED21    0.657 0.0507 Inf     0.558     0.757
## 
## Time = 7, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.404 0.0618 Inf     0.283     0.525
##  MED1     0.790 0.0583 Inf     0.675     0.904
##  MED21    0.670 0.0507 Inf     0.570     0.769
## 
## Time = 8, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.410 0.0618 Inf     0.289     0.531
##  MED1     0.759 0.0583 Inf     0.644     0.873
##  MED21    0.634 0.0507 Inf     0.535     0.734
## 
## Time = 9, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.425 0.0618 Inf     0.303     0.546
##  MED1     0.812 0.0583 Inf     0.698     0.926
##  MED21    0.630 0.0507 Inf     0.530     0.729
## 
## Time = 10, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.459 0.0618 Inf     0.338     0.580
##  MED1     0.715 0.0583 Inf     0.601     0.830
##  MED21    0.635 0.0507 Inf     0.536     0.735
## 
## Time = 1, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.335 0.0618 Inf     0.214     0.456
##  MED1     0.304 0.0583 Inf     0.190     0.419
##  MED21    0.443 0.0505 Inf     0.344     0.542
## 
## Time = 2, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.352 0.0618 Inf     0.231     0.474
##  MED1     0.406 0.0583 Inf     0.292     0.520
##  MED21    0.565 0.0505 Inf     0.466     0.664
## 
## Time = 3, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.394 0.0618 Inf     0.273     0.515
##  MED1     0.493 0.0583 Inf     0.379     0.607
##  MED21    0.604 0.0505 Inf     0.505     0.703
## 
## Time = 4, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.396 0.0618 Inf     0.275     0.517
##  MED1     0.497 0.0583 Inf     0.383     0.611
##  MED21    0.672 0.0505 Inf     0.574     0.771
## 
## Time = 5, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.412 0.0618 Inf     0.291     0.533
##  MED1     0.628 0.0583 Inf     0.514     0.742
##  MED21    0.679 0.0505 Inf     0.580     0.778
## 
## Time = 6, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.378 0.0618 Inf     0.257     0.499
##  MED1     0.634 0.0583 Inf     0.520     0.749
##  MED21    0.737 0.0505 Inf     0.638     0.836
## 
## Time = 7, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.415 0.0618 Inf     0.294     0.536
##  MED1     0.655 0.0583 Inf     0.541     0.769
##  MED21    0.766 0.0505 Inf     0.667     0.865
## 
## Time = 8, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.454 0.0618 Inf     0.333     0.575
##  MED1     0.592 0.0583 Inf     0.478     0.706
##  MED21    0.758 0.0505 Inf     0.659     0.857
## 
## Time = 9, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.411 0.0618 Inf     0.290     0.532
##  MED1     0.527 0.0583 Inf     0.413     0.641
##  MED21    0.761 0.0505 Inf     0.662     0.860
## 
## Time = 10, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.380 0.0618 Inf     0.259     0.501
##  MED1     0.625 0.0583 Inf     0.510     0.739
##  MED21    0.744 0.0505 Inf     0.645     0.843
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## 
## $contrasts
## Time = 1, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.089455 0.0850 Inf  -1.052  0.5438
##  Control - MED21 -0.200611 0.0798 Inf  -2.513  0.0321
##  MED1 - MED21    -0.111156 0.0771 Inf  -1.442  0.3195
## 
## Time = 2, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.128908 0.0850 Inf  -1.517  0.2831
##  Control - MED21 -0.181941 0.0798 Inf  -2.279  0.0588
##  MED1 - MED21    -0.053032 0.0771 Inf  -0.688  0.7706
## 
## Time = 3, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.253678 0.0850 Inf  -2.984  0.0080
##  Control - MED21 -0.191389 0.0798 Inf  -2.397  0.0436
##  MED1 - MED21     0.062289 0.0771 Inf   0.808  0.6981
## 
## Time = 4, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.250596 0.0850 Inf  -2.948  0.0090
##  Control - MED21 -0.189939 0.0798 Inf  -2.379  0.0457
##  MED1 - MED21     0.060656 0.0771 Inf   0.787  0.7112
## 
## Time = 5, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.289480 0.0850 Inf  -3.406  0.0019
##  Control - MED21 -0.174636 0.0798 Inf  -2.188  0.0733
##  MED1 - MED21     0.114844 0.0771 Inf   1.489  0.2959
## 
## Time = 6, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.273243 0.0850 Inf  -3.215  0.0037
##  Control - MED21 -0.212258 0.0798 Inf  -2.659  0.0214
##  MED1 - MED21     0.060985 0.0771 Inf   0.791  0.7086
## 
## Time = 7, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.345411 0.0850 Inf  -4.064  0.0001
##  Control - MED21 -0.355492 0.0798 Inf  -4.453  <.0001
##  MED1 - MED21    -0.010081 0.0771 Inf  -0.131  0.9906
## 
## Time = 8, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.368499 0.0850 Inf  -4.335  <.0001
##  Control - MED21 -0.304380 0.0798 Inf  -3.813  0.0004
##  MED1 - MED21     0.064118 0.0771 Inf   0.832  0.6834
## 
## Time = 9, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.350118 0.0850 Inf  -4.119  0.0001
##  Control - MED21 -0.276234 0.0798 Inf  -3.460  0.0016
##  MED1 - MED21     0.073884 0.0771 Inf   0.958  0.6033
## 
## Time = 10, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.286532 0.0850 Inf  -3.371  0.0022
##  Control - MED21 -0.326714 0.0798 Inf  -4.092  0.0001
##  MED1 - MED21    -0.040181 0.0771 Inf  -0.521  0.8610
## 
## Time = 1, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.122756 0.0849 Inf  -1.445  0.3177
##  Control - MED21 -0.191487 0.0800 Inf  -2.395  0.0438
##  MED1 - MED21    -0.068731 0.0772 Inf  -0.890  0.6467
## 
## Time = 2, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.227015 0.0849 Inf  -2.673  0.0206
##  Control - MED21 -0.248194 0.0800 Inf  -3.104  0.0054
##  MED1 - MED21    -0.021179 0.0772 Inf  -0.274  0.9594
## 
## Time = 3, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.249059 0.0849 Inf  -2.932  0.0094
##  Control - MED21 -0.249540 0.0800 Inf  -3.121  0.0051
##  MED1 - MED21    -0.000481 0.0772 Inf  -0.006  1.0000
## 
## Time = 4, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.298874 0.0849 Inf  -3.519  0.0013
##  Control - MED21 -0.252041 0.0800 Inf  -3.152  0.0046
##  MED1 - MED21     0.046833 0.0772 Inf   0.606  0.8166
## 
## Time = 5, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.304693 0.0849 Inf  -3.587  0.0010
##  Control - MED21 -0.284496 0.0800 Inf  -3.558  0.0011
##  MED1 - MED21     0.020197 0.0772 Inf   0.262  0.9630
## 
## Time = 6, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.445492 0.0849 Inf  -5.245  <.0001
##  Control - MED21 -0.268269 0.0800 Inf  -3.355  0.0023
##  MED1 - MED21     0.177223 0.0772 Inf   2.295  0.0565
## 
## Time = 7, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.385852 0.0849 Inf  -4.543  <.0001
##  Control - MED21 -0.265986 0.0800 Inf  -3.327  0.0025
##  MED1 - MED21     0.119866 0.0772 Inf   1.552  0.2668
## 
## Time = 8, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.348655 0.0849 Inf  -4.105  0.0001
##  Control - MED21 -0.224361 0.0800 Inf  -2.806  0.0139
##  MED1 - MED21     0.124294 0.0772 Inf   1.609  0.2416
## 
## Time = 9, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.387203 0.0849 Inf  -4.559  <.0001
##  Control - MED21 -0.205114 0.0800 Inf  -2.565  0.0278
##  MED1 - MED21     0.182089 0.0772 Inf   2.358  0.0483
## 
## Time = 10, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.256528 0.0849 Inf  -3.020  0.0071
##  Control - MED21 -0.176432 0.0800 Inf  -2.207  0.0700
##  MED1 - MED21     0.080096 0.0772 Inf   1.037  0.5534
## 
## Time = 1, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1   0.030452 0.0849 Inf   0.359  0.9316
##  Control - MED21 -0.108114 0.0798 Inf  -1.355  0.3646
##  MED1 - MED21    -0.138566 0.0771 Inf  -1.798  0.1702
## 
## Time = 2, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.053673 0.0849 Inf  -0.632  0.8025
##  Control - MED21 -0.212457 0.0798 Inf  -2.663  0.0211
##  MED1 - MED21    -0.158784 0.0771 Inf  -2.060  0.0982
## 
## Time = 3, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.099030 0.0849 Inf  -1.166  0.4735
##  Control - MED21 -0.210053 0.0798 Inf  -2.633  0.0230
##  MED1 - MED21    -0.111023 0.0771 Inf  -1.441  0.3200
## 
## Time = 4, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.100785 0.0849 Inf  -1.187  0.4610
##  Control - MED21 -0.276325 0.0798 Inf  -3.464  0.0015
##  MED1 - MED21    -0.175540 0.0771 Inf  -2.278  0.0589
## 
## Time = 5, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.216083 0.0849 Inf  -2.544  0.0295
##  Control - MED21 -0.266941 0.0798 Inf  -3.346  0.0024
##  MED1 - MED21    -0.050857 0.0771 Inf  -0.660  0.7867
## 
## Time = 6, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.256159 0.0849 Inf  -3.016  0.0072
##  Control - MED21 -0.358416 0.0798 Inf  -4.493  <.0001
##  MED1 - MED21    -0.102258 0.0771 Inf  -1.327  0.3802
## 
## Time = 7, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.239468 0.0849 Inf  -2.820  0.0133
##  Control - MED21 -0.350837 0.0798 Inf  -4.398  <.0001
##  MED1 - MED21    -0.111369 0.0771 Inf  -1.445  0.3178
## 
## Time = 8, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.138570 0.0849 Inf  -1.632  0.2322
##  Control - MED21 -0.304252 0.0798 Inf  -3.814  0.0004
##  MED1 - MED21    -0.165682 0.0771 Inf  -2.150  0.0801
## 
## Time = 9, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.115976 0.0849 Inf  -1.366  0.3590
##  Control - MED21 -0.350299 0.0798 Inf  -4.391  <.0001
##  MED1 - MED21    -0.234323 0.0771 Inf  -3.041  0.0067
## 
## Time = 10, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.244776 0.0849 Inf  -2.882  0.0110
##  Control - MED21 -0.364148 0.0798 Inf  -4.565  <.0001
##  MED1 - MED21    -0.119373 0.0771 Inf  -1.549  0.2681
## 
## Degrees-of-freedom method: asymptotic 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(m.TARP, pairwise ~ Session | Group) #Within the group across sessions MED21 is continually increasing
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 15410' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 15410)' 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 = 15410' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 15410)' or larger];
## but be warned that this may result in large computation time and memory use.
## NOTE: Results may be misleading due to involvement in interactions
## $emmeans
## Group = Control:
##  Session emmean     SE  df asymp.LCL asymp.UCL
##  1        0.357 0.0587 Inf     0.242     0.472
##  2        0.376 0.0587 Inf     0.260     0.491
##  3        0.393 0.0587 Inf     0.278     0.508
## 
## Group = MED1:
##  Session emmean     SE  df asymp.LCL asymp.UCL
##  1        0.621 0.0554 Inf     0.512     0.729
##  2        0.678 0.0554 Inf     0.570     0.787
##  3        0.536 0.0554 Inf     0.428     0.645
## 
## Group = MED21:
##  Session emmean     SE  df asymp.LCL asymp.UCL
##  1        0.598 0.0480 Inf     0.504     0.692
##  2        0.612 0.0480 Inf     0.518     0.706
##  3        0.673 0.0479 Inf     0.579     0.767
## 
## Results are averaged over the levels of: Time 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## 
## $contrasts
## Group = Control:
##  contrast estimate      SE  df z.ratio p.value
##  1 - 2     -0.0185 0.00913 Inf  -2.030  0.1051
##  1 - 3     -0.0357 0.00911 Inf  -3.922  0.0003
##  2 - 3     -0.0172 0.00908 Inf  -1.895  0.1400
## 
## Group = MED1:
##  contrast estimate      SE  df z.ratio p.value
##  1 - 2     -0.0575 0.00857 Inf  -6.716  <.0001
##  1 - 3      0.0845 0.00857 Inf   9.858  <.0001
##  2 - 3      0.1420 0.00854 Inf  16.626  <.0001
## 
## Group = MED21:
##  contrast estimate      SE  df z.ratio p.value
##  1 - 2     -0.0138 0.00765 Inf  -1.798  0.1704
##  1 - 3     -0.0745 0.00741 Inf -10.067  <.0001
##  2 - 3     -0.0608 0.00764 Inf  -7.952  <.0001
## 
## Results are averaged over the levels of: Time 
## Degrees-of-freedom method: asymptotic 
## P value adjustment: tukey method for comparing a family of 3 estimates
emmeans(m.TARP, pairwise ~ Time | Group * Session)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 15410' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 15410)' 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 = 15410' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 15410)' or larger];
## but be warned that this may result in large computation time and memory use.
## $emmeans
## Group = Control, Session = 1:
##  Time emmean     SE  df asymp.LCL asymp.UCL
##  1     0.288 0.0619 Inf     0.167     0.410
##  2     0.325 0.0619 Inf     0.204     0.446
##  3     0.363 0.0619 Inf     0.242     0.484
##  4     0.385 0.0619 Inf     0.263     0.506
##  5     0.411 0.0619 Inf     0.289     0.532
##  6     0.406 0.0619 Inf     0.284     0.527
##  7     0.332 0.0619 Inf     0.211     0.454
##  8     0.331 0.0619 Inf     0.209     0.452
##  9     0.341 0.0619 Inf     0.220     0.463
##  10    0.388 0.0619 Inf     0.267     0.509
## 
## Group = MED1, Session = 1:
##  Time emmean     SE  df asymp.LCL asymp.UCL
##  1     0.378 0.0583 Inf     0.264     0.492
##  2     0.454 0.0583 Inf     0.340     0.568
##  3     0.617 0.0583 Inf     0.502     0.731
##  4     0.635 0.0583 Inf     0.521     0.749
##  5     0.700 0.0583 Inf     0.586     0.814
##  6     0.679 0.0583 Inf     0.565     0.793
##  7     0.678 0.0583 Inf     0.564     0.792
##  8     0.699 0.0583 Inf     0.585     0.813
##  9     0.692 0.0583 Inf     0.577     0.806
##  10    0.675 0.0583 Inf     0.560     0.789
## 
## Group = MED21, Session = 1:
##  Time emmean     SE  df asymp.LCL asymp.UCL
##  1     0.489 0.0505 Inf     0.390     0.588
##  2     0.507 0.0505 Inf     0.408     0.606
##  3     0.554 0.0505 Inf     0.455     0.653
##  4     0.575 0.0505 Inf     0.476     0.673
##  5     0.585 0.0505 Inf     0.486     0.684
##  6     0.618 0.0505 Inf     0.519     0.717
##  7     0.688 0.0505 Inf     0.589     0.787
##  8     0.635 0.0505 Inf     0.536     0.734
##  9     0.618 0.0505 Inf     0.519     0.717
##  10    0.715 0.0505 Inf     0.616     0.814
## 
## Group = Control, Session = 2:
##  Time emmean     SE  df asymp.LCL asymp.UCL
##  1     0.302 0.0618 Inf     0.181     0.423
##  2     0.318 0.0618 Inf     0.196     0.439
##  3     0.355 0.0618 Inf     0.234     0.476
##  4     0.334 0.0618 Inf     0.213     0.455
##  5     0.360 0.0618 Inf     0.239     0.481
##  6     0.389 0.0618 Inf     0.268     0.510
##  7     0.404 0.0618 Inf     0.283     0.525
##  8     0.410 0.0618 Inf     0.289     0.531
##  9     0.425 0.0618 Inf     0.303     0.546
##  10    0.459 0.0618 Inf     0.338     0.580
## 
## Group = MED1, Session = 2:
##  Time emmean     SE  df asymp.LCL asymp.UCL
##  1     0.425 0.0583 Inf     0.311     0.539
##  2     0.545 0.0583 Inf     0.430     0.659
##  3     0.604 0.0583 Inf     0.490     0.718
##  4     0.633 0.0583 Inf     0.519     0.747
##  5     0.665 0.0583 Inf     0.550     0.779
##  6     0.834 0.0583 Inf     0.720     0.949
##  7     0.790 0.0583 Inf     0.675     0.904
##  8     0.759 0.0583 Inf     0.644     0.873
##  9     0.812 0.0583 Inf     0.698     0.926
##  10    0.715 0.0583 Inf     0.601     0.830
## 
## Group = MED21, Session = 2:
##  Time emmean     SE  df asymp.LCL asymp.UCL
##  1     0.494 0.0507 Inf     0.394     0.593
##  2     0.566 0.0507 Inf     0.466     0.665
##  3     0.605 0.0507 Inf     0.505     0.704
##  4     0.586 0.0507 Inf     0.487     0.685
##  5     0.644 0.0507 Inf     0.545     0.744
##  6     0.657 0.0507 Inf     0.558     0.757
##  7     0.670 0.0507 Inf     0.570     0.769
##  8     0.634 0.0507 Inf     0.535     0.734
##  9     0.630 0.0507 Inf     0.530     0.729
##  10    0.635 0.0507 Inf     0.536     0.735
## 
## Group = Control, Session = 3:
##  Time emmean     SE  df asymp.LCL asymp.UCL
##  1     0.335 0.0618 Inf     0.214     0.456
##  2     0.352 0.0618 Inf     0.231     0.474
##  3     0.394 0.0618 Inf     0.273     0.515
##  4     0.396 0.0618 Inf     0.275     0.517
##  5     0.412 0.0618 Inf     0.291     0.533
##  6     0.378 0.0618 Inf     0.257     0.499
##  7     0.415 0.0618 Inf     0.294     0.536
##  8     0.454 0.0618 Inf     0.333     0.575
##  9     0.411 0.0618 Inf     0.290     0.532
##  10    0.380 0.0618 Inf     0.259     0.501
## 
## Group = MED1, Session = 3:
##  Time emmean     SE  df asymp.LCL asymp.UCL
##  1     0.304 0.0583 Inf     0.190     0.419
##  2     0.406 0.0583 Inf     0.292     0.520
##  3     0.493 0.0583 Inf     0.379     0.607
##  4     0.497 0.0583 Inf     0.383     0.611
##  5     0.628 0.0583 Inf     0.514     0.742
##  6     0.634 0.0583 Inf     0.520     0.749
##  7     0.655 0.0583 Inf     0.541     0.769
##  8     0.592 0.0583 Inf     0.478     0.706
##  9     0.527 0.0583 Inf     0.413     0.641
##  10    0.625 0.0583 Inf     0.510     0.739
## 
## Group = MED21, Session = 3:
##  Time emmean     SE  df asymp.LCL asymp.UCL
##  1     0.443 0.0505 Inf     0.344     0.542
##  2     0.565 0.0505 Inf     0.466     0.664
##  3     0.604 0.0505 Inf     0.505     0.703
##  4     0.672 0.0505 Inf     0.574     0.771
##  5     0.679 0.0505 Inf     0.580     0.778
##  6     0.737 0.0505 Inf     0.638     0.836
##  7     0.766 0.0505 Inf     0.667     0.865
##  8     0.758 0.0505 Inf     0.659     0.857
##  9     0.761 0.0505 Inf     0.662     0.860
##  10    0.744 0.0505 Inf     0.645     0.843
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## 
## $contrasts
## Group = Control, Session = 1:
##  contrast  estimate     SE  df z.ratio p.value
##  1 - 2    -0.036571 0.0290 Inf  -1.263  0.9616
##  1 - 3    -0.074388 0.0290 Inf  -2.569  0.2322
##  1 - 4    -0.096072 0.0290 Inf  -3.318  0.0309
##  1 - 5    -0.122030 0.0290 Inf  -4.215  0.0010
##  1 - 6    -0.117106 0.0290 Inf  -4.045  0.0021
##  1 - 7    -0.043975 0.0290 Inf  -1.519  0.8850
##  1 - 8    -0.042078 0.0290 Inf  -1.453  0.9101
##  1 - 9    -0.052938 0.0290 Inf  -1.829  0.7171
##  1 - 10   -0.099690 0.0290 Inf  -3.443  0.0204
##  2 - 3    -0.037817 0.0290 Inf  -1.306  0.9525
##  2 - 4    -0.059501 0.0290 Inf  -2.055  0.5595
##  2 - 5    -0.085458 0.0290 Inf  -2.952  0.0918
##  2 - 6    -0.080535 0.0290 Inf  -2.782  0.1425
##  2 - 7    -0.007404 0.0290 Inf  -0.256  1.0000
##  2 - 8    -0.005507 0.0290 Inf  -0.190  1.0000
##  2 - 9    -0.016367 0.0290 Inf  -0.565  0.9999
##  2 - 10   -0.063119 0.0290 Inf  -2.180  0.4705
##  3 - 4    -0.021685 0.0290 Inf  -0.749  0.9992
##  3 - 5    -0.047642 0.0290 Inf  -1.646  0.8256
##  3 - 6    -0.042718 0.0290 Inf  -1.476  0.9020
##  3 - 7     0.030413 0.0290 Inf   1.050  0.9891
##  3 - 8     0.032310 0.0290 Inf   1.116  0.9832
##  3 - 9     0.021449 0.0290 Inf   0.741  0.9992
##  3 - 10   -0.025302 0.0290 Inf  -0.874  0.9972
##  4 - 5    -0.025957 0.0290 Inf  -0.897  0.9966
##  4 - 6    -0.021034 0.0290 Inf  -0.727  0.9994
##  4 - 7     0.052098 0.0290 Inf   1.800  0.7358
##  4 - 8     0.053995 0.0290 Inf   1.865  0.6929
##  4 - 9     0.043134 0.0290 Inf   1.490  0.8966
##  4 - 10   -0.003618 0.0290 Inf  -0.125  1.0000
##  5 - 6     0.004924 0.0290 Inf   0.170  1.0000
##  5 - 7     0.078055 0.0290 Inf   2.696  0.1750
##  5 - 8     0.079952 0.0290 Inf   2.762  0.1497
##  5 - 9     0.069091 0.0290 Inf   2.386  0.3338
##  5 - 10    0.022339 0.0290 Inf   0.772  0.9989
##  6 - 7     0.073131 0.0290 Inf   2.526  0.2543
##  6 - 8     0.075028 0.0290 Inf   2.592  0.2214
##  6 - 9     0.064168 0.0290 Inf   2.216  0.4453
##  6 - 10    0.017416 0.0290 Inf   0.602  0.9999
##  7 - 8     0.001897 0.0290 Inf   0.066  1.0000
##  7 - 9    -0.008964 0.0290 Inf  -0.310  1.0000
##  7 - 10   -0.055716 0.0290 Inf  -1.924  0.6523
##  8 - 9    -0.010861 0.0290 Inf  -0.375  1.0000
##  8 - 10   -0.057612 0.0290 Inf  -1.990  0.6061
##  9 - 10   -0.046752 0.0290 Inf  -1.615  0.8413
## 
## Group = MED1, Session = 1:
##  contrast  estimate     SE  df z.ratio p.value
##  1 - 2    -0.076025 0.0272 Inf  -2.797  0.1372
##  1 - 3    -0.238610 0.0272 Inf  -8.780  <.0001
##  1 - 4    -0.257213 0.0272 Inf  -9.464  <.0001
##  1 - 5    -0.322055 0.0272 Inf -11.850  <.0001
##  1 - 6    -0.300894 0.0272 Inf -11.071  <.0001
##  1 - 7    -0.299930 0.0272 Inf -11.036  <.0001
##  1 - 8    -0.321121 0.0272 Inf -11.816  <.0001
##  1 - 9    -0.313601 0.0272 Inf -11.539  <.0001
##  1 - 10   -0.296768 0.0272 Inf -10.920  <.0001
##  2 - 3    -0.162586 0.0272 Inf  -5.982  <.0001
##  2 - 4    -0.181188 0.0272 Inf  -6.667  <.0001
##  2 - 5    -0.246030 0.0272 Inf  -9.053  <.0001
##  2 - 6    -0.224869 0.0272 Inf  -8.274  <.0001
##  2 - 7    -0.223906 0.0272 Inf  -8.239  <.0001
##  2 - 8    -0.245097 0.0272 Inf  -9.018  <.0001
##  2 - 9    -0.237576 0.0272 Inf  -8.742  <.0001
##  2 - 10   -0.220743 0.0272 Inf  -8.122  <.0001
##  3 - 4    -0.018603 0.0272 Inf  -0.684  0.9996
##  3 - 5    -0.083445 0.0272 Inf  -3.070  0.0659
##  3 - 6    -0.062284 0.0272 Inf  -2.292  0.3943
##  3 - 7    -0.061320 0.0272 Inf  -2.256  0.4180
##  3 - 8    -0.082511 0.0272 Inf  -3.036  0.0726
##  3 - 9    -0.074991 0.0272 Inf  -2.759  0.1506
##  3 - 10   -0.058157 0.0272 Inf  -2.140  0.4990
##  4 - 5    -0.064842 0.0272 Inf  -2.386  0.3342
##  4 - 6    -0.043681 0.0272 Inf  -1.607  0.8451
##  4 - 7    -0.042718 0.0272 Inf  -1.572  0.8620
##  4 - 8    -0.063908 0.0272 Inf  -2.352  0.3556
##  4 - 9    -0.056388 0.0272 Inf  -2.075  0.5455
##  4 - 10   -0.039555 0.0272 Inf  -1.455  0.9094
##  5 - 6     0.021161 0.0272 Inf   0.779  0.9989
##  5 - 7     0.022124 0.0272 Inf   0.814  0.9984
##  5 - 8     0.000934 0.0272 Inf   0.034  1.0000
##  5 - 9     0.008454 0.0272 Inf   0.311  1.0000
##  5 - 10    0.025287 0.0272 Inf   0.930  0.9955
##  6 - 7     0.000964 0.0272 Inf   0.035  1.0000
##  6 - 8    -0.020227 0.0272 Inf  -0.744  0.9992
##  6 - 9    -0.012707 0.0272 Inf  -0.468  1.0000
##  6 - 10    0.004126 0.0272 Inf   0.152  1.0000
##  7 - 8    -0.021191 0.0272 Inf  -0.780  0.9989
##  7 - 9    -0.013671 0.0272 Inf  -0.503  1.0000
##  7 - 10    0.003163 0.0272 Inf   0.116  1.0000
##  8 - 9     0.007520 0.0272 Inf   0.277  1.0000
##  8 - 10    0.024354 0.0272 Inf   0.896  0.9966
##  9 - 10    0.016834 0.0272 Inf   0.619  0.9998
## 
## Group = MED21, Session = 1:
##  contrast  estimate     SE  df z.ratio p.value
##  1 - 2    -0.017901 0.0234 Inf  -0.764  0.9990
##  1 - 3    -0.065165 0.0234 Inf  -2.779  0.1433
##  1 - 4    -0.085400 0.0234 Inf  -3.643  0.0101
##  1 - 5    -0.096055 0.0234 Inf  -4.097  0.0017
##  1 - 6    -0.128752 0.0234 Inf  -5.492  <.0001
##  1 - 7    -0.198855 0.0234 Inf  -8.482  <.0001
##  1 - 8    -0.145847 0.0234 Inf  -6.221  <.0001
##  1 - 9    -0.128561 0.0234 Inf  -5.483  <.0001
##  1 - 10   -0.225793 0.0234 Inf  -9.631  <.0001
##  2 - 3    -0.047265 0.0234 Inf  -2.016  0.5876
##  2 - 4    -0.067500 0.0234 Inf  -2.879  0.1114
##  2 - 5    -0.078154 0.0234 Inf  -3.333  0.0294
##  2 - 6    -0.110852 0.0234 Inf  -4.728  0.0001
##  2 - 7    -0.180955 0.0234 Inf  -7.718  <.0001
##  2 - 8    -0.127946 0.0234 Inf  -5.457  <.0001
##  2 - 9    -0.110661 0.0234 Inf  -4.720  0.0001
##  2 - 10   -0.207892 0.0234 Inf  -8.867  <.0001
##  3 - 4    -0.020235 0.0234 Inf  -0.863  0.9975
##  3 - 5    -0.030890 0.0234 Inf  -1.318  0.9499
##  3 - 6    -0.063587 0.0234 Inf  -2.712  0.1686
##  3 - 7    -0.133690 0.0234 Inf  -5.702  <.0001
##  3 - 8    -0.080681 0.0234 Inf  -3.441  0.0206
##  3 - 9    -0.063396 0.0234 Inf  -2.704  0.1718
##  3 - 10   -0.160627 0.0234 Inf  -6.851  <.0001
##  4 - 5    -0.010655 0.0234 Inf  -0.454  1.0000
##  4 - 6    -0.043352 0.0234 Inf  -1.849  0.7035
##  4 - 7    -0.113455 0.0234 Inf  -4.839  0.0001
##  4 - 8    -0.060447 0.0234 Inf  -2.578  0.2279
##  4 - 9    -0.043161 0.0234 Inf  -1.841  0.7089
##  4 - 10   -0.140392 0.0234 Inf  -5.988  <.0001
##  5 - 6    -0.032698 0.0234 Inf  -1.395  0.9293
##  5 - 7    -0.102800 0.0234 Inf  -4.385  0.0005
##  5 - 8    -0.049792 0.0234 Inf  -2.124  0.5104
##  5 - 9    -0.032506 0.0234 Inf  -1.386  0.9317
##  5 - 10   -0.129738 0.0234 Inf  -5.534  <.0001
##  6 - 7    -0.070103 0.0234 Inf  -2.990  0.0826
##  6 - 8    -0.017094 0.0234 Inf  -0.729  0.9993
##  6 - 9     0.000191 0.0234 Inf   0.008  1.0000
##  6 - 10   -0.097040 0.0234 Inf  -4.139  0.0014
##  7 - 8     0.053009 0.0234 Inf   2.261  0.4148
##  7 - 9     0.070294 0.0234 Inf   2.998  0.0808
##  7 - 10   -0.026937 0.0234 Inf  -1.149  0.9795
##  8 - 9     0.017285 0.0234 Inf   0.737  0.9993
##  8 - 10   -0.079946 0.0234 Inf  -3.410  0.0228
##  9 - 10   -0.097231 0.0234 Inf  -4.147  0.0014
## 
## Group = Control, Session = 2:
##  contrast  estimate     SE  df z.ratio p.value
##  1 - 2    -0.015324 0.0287 Inf  -0.533  1.0000
##  1 - 3    -0.052768 0.0287 Inf  -1.836  0.7125
##  1 - 4    -0.031665 0.0287 Inf  -1.101  0.9847
##  1 - 5    -0.057647 0.0287 Inf  -2.005  0.5953
##  1 - 6    -0.086685 0.0287 Inf  -3.015  0.0770
##  1 - 7    -0.101446 0.0287 Inf  -3.529  0.0152
##  1 - 8    -0.107714 0.0287 Inf  -3.747  0.0069
##  1 - 9    -0.122261 0.0287 Inf  -4.253  0.0009
##  1 - 10   -0.156610 0.0287 Inf  -5.448  <.0001
##  2 - 3    -0.037444 0.0287 Inf  -1.302  0.9534
##  2 - 4    -0.016341 0.0287 Inf  -0.568  0.9999
##  2 - 5    -0.042322 0.0287 Inf  -1.472  0.9033
##  2 - 6    -0.071361 0.0287 Inf  -2.482  0.2779
##  2 - 7    -0.086121 0.0287 Inf  -2.996  0.0813
##  2 - 8    -0.092390 0.0287 Inf  -3.214  0.0429
##  2 - 9    -0.106937 0.0287 Inf  -3.720  0.0076
##  2 - 10   -0.141286 0.0287 Inf  -4.915  <.0001
##  3 - 4     0.021103 0.0287 Inf   0.734  0.9993
##  3 - 5    -0.004879 0.0287 Inf  -0.170  1.0000
##  3 - 6    -0.033917 0.0287 Inf  -1.180  0.9755
##  3 - 7    -0.048678 0.0287 Inf  -1.693  0.7997
##  3 - 8    -0.054946 0.0287 Inf  -1.911  0.6614
##  3 - 9    -0.069493 0.0287 Inf  -2.417  0.3152
##  3 - 10   -0.103842 0.0287 Inf  -3.612  0.0113
##  4 - 5    -0.025982 0.0287 Inf  -0.904  0.9964
##  4 - 6    -0.055020 0.0287 Inf  -1.914  0.6596
##  4 - 7    -0.069781 0.0287 Inf  -2.427  0.3093
##  4 - 8    -0.076049 0.0287 Inf  -2.645  0.1966
##  4 - 9    -0.090596 0.0287 Inf  -3.151  0.0519
##  4 - 10   -0.124945 0.0287 Inf  -4.346  0.0006
##  5 - 6    -0.029038 0.0287 Inf  -1.010  0.9918
##  5 - 7    -0.043799 0.0287 Inf  -1.524  0.8831
##  5 - 8    -0.050068 0.0287 Inf  -1.742  0.7716
##  5 - 9    -0.064615 0.0287 Inf  -2.248  0.4239
##  5 - 10   -0.098963 0.0287 Inf  -3.442  0.0205
##  6 - 7    -0.014760 0.0287 Inf  -0.513  1.0000
##  6 - 8    -0.021029 0.0287 Inf  -0.731  0.9993
##  6 - 9    -0.035576 0.0287 Inf  -1.238  0.9664
##  6 - 10   -0.069925 0.0287 Inf  -2.432  0.3063
##  7 - 8    -0.006269 0.0287 Inf  -0.218  1.0000
##  7 - 9    -0.020816 0.0287 Inf  -0.724  0.9994
##  7 - 10   -0.055164 0.0287 Inf  -1.919  0.6561
##  8 - 9    -0.014547 0.0287 Inf  -0.506  1.0000
##  8 - 10   -0.048896 0.0287 Inf  -1.701  0.7954
##  9 - 10   -0.034349 0.0287 Inf  -1.195  0.9733
## 
## Group = MED1, Session = 2:
##  contrast  estimate     SE  df z.ratio p.value
##  1 - 2    -0.119583 0.0270 Inf  -4.427  0.0004
##  1 - 3    -0.179072 0.0270 Inf  -6.630  <.0001
##  1 - 4    -0.207783 0.0270 Inf  -7.693  <.0001
##  1 - 5    -0.239584 0.0270 Inf  -8.870  <.0001
##  1 - 6    -0.409421 0.0270 Inf -15.158  <.0001
##  1 - 7    -0.364542 0.0270 Inf -13.497  <.0001
##  1 - 8    -0.333614 0.0270 Inf -12.352  <.0001
##  1 - 9    -0.386709 0.0270 Inf -14.318  <.0001
##  1 - 10   -0.290382 0.0270 Inf -10.751  <.0001
##  2 - 3    -0.059488 0.0270 Inf  -2.202  0.4549
##  2 - 4    -0.088199 0.0270 Inf  -3.265  0.0365
##  2 - 5    -0.120001 0.0270 Inf  -4.443  0.0004
##  2 - 6    -0.289838 0.0270 Inf -10.731  <.0001
##  2 - 7    -0.244958 0.0270 Inf  -9.069  <.0001
##  2 - 8    -0.214030 0.0270 Inf  -7.924  <.0001
##  2 - 9    -0.267125 0.0270 Inf  -9.890  <.0001
##  2 - 10   -0.170799 0.0270 Inf  -6.324  <.0001
##  3 - 4    -0.028711 0.0270 Inf  -1.063  0.9881
##  3 - 5    -0.060512 0.0270 Inf  -2.240  0.4288
##  3 - 6    -0.230350 0.0270 Inf  -8.528  <.0001
##  3 - 7    -0.185470 0.0270 Inf  -6.867  <.0001
##  3 - 8    -0.154542 0.0270 Inf  -5.722  <.0001
##  3 - 9    -0.207637 0.0270 Inf  -7.688  <.0001
##  3 - 10   -0.111310 0.0270 Inf  -4.121  0.0015
##  4 - 5    -0.031801 0.0270 Inf  -1.177  0.9758
##  4 - 6    -0.201639 0.0270 Inf  -7.465  <.0001
##  4 - 7    -0.156759 0.0270 Inf  -5.804  <.0001
##  4 - 8    -0.125831 0.0270 Inf  -4.659  0.0001
##  4 - 9    -0.178926 0.0270 Inf  -6.625  <.0001
##  4 - 10   -0.082599 0.0270 Inf  -3.058  0.0682
##  5 - 6    -0.169837 0.0270 Inf  -6.288  <.0001
##  5 - 7    -0.124958 0.0270 Inf  -4.626  0.0002
##  5 - 8    -0.094030 0.0270 Inf  -3.481  0.0179
##  5 - 9    -0.147124 0.0270 Inf  -5.447  <.0001
##  5 - 10   -0.050798 0.0270 Inf  -1.881  0.6823
##  6 - 7     0.044880 0.0270 Inf   1.662  0.8171
##  6 - 8     0.075808 0.0270 Inf   2.807  0.1340
##  6 - 9     0.022713 0.0270 Inf   0.841  0.9979
##  6 - 10    0.119040 0.0270 Inf   4.407  0.0004
##  7 - 8     0.030928 0.0270 Inf   1.145  0.9800
##  7 - 9    -0.022167 0.0270 Inf  -0.821  0.9983
##  7 - 10    0.074160 0.0270 Inf   2.746  0.1556
##  8 - 9    -0.053095 0.0270 Inf  -1.966  0.6233
##  8 - 10    0.043232 0.0270 Inf   1.601  0.8483
##  9 - 10    0.096326 0.0270 Inf   3.566  0.0133
## 
## Group = MED21, Session = 2:
##  contrast  estimate     SE  df z.ratio p.value
##  1 - 2    -0.072031 0.0244 Inf  -2.948  0.0926
##  1 - 3    -0.110821 0.0244 Inf  -4.536  0.0002
##  1 - 4    -0.092218 0.0244 Inf  -3.775  0.0062
##  1 - 5    -0.150656 0.0244 Inf  -6.167  <.0001
##  1 - 6    -0.163468 0.0244 Inf  -6.691  <.0001
##  1 - 7    -0.175944 0.0244 Inf  -7.202  <.0001
##  1 - 8    -0.140589 0.0244 Inf  -5.755  <.0001
##  1 - 9    -0.135888 0.0244 Inf  -5.562  <.0001
##  1 - 10   -0.141554 0.0244 Inf  -5.794  <.0001
##  2 - 3    -0.038790 0.0244 Inf  -1.588  0.8545
##  2 - 4    -0.020187 0.0244 Inf  -0.826  0.9982
##  2 - 5    -0.078625 0.0244 Inf  -3.218  0.0423
##  2 - 6    -0.091436 0.0244 Inf  -3.743  0.0070
##  2 - 7    -0.103913 0.0244 Inf  -4.253  0.0009
##  2 - 8    -0.068557 0.0244 Inf  -2.806  0.1342
##  2 - 9    -0.063857 0.0244 Inf  -2.614  0.2109
##  2 - 10   -0.069523 0.0244 Inf  -2.846  0.1214
##  3 - 4     0.018603 0.0244 Inf   0.761  0.9991
##  3 - 5    -0.039835 0.0244 Inf  -1.631  0.8334
##  3 - 6    -0.052646 0.0244 Inf  -2.155  0.4883
##  3 - 7    -0.065123 0.0244 Inf  -2.666  0.1878
##  3 - 8    -0.029767 0.0244 Inf  -1.218  0.9696
##  3 - 9    -0.025067 0.0244 Inf  -1.026  0.9908
##  3 - 10   -0.030733 0.0244 Inf  -1.258  0.9626
##  4 - 5    -0.058438 0.0244 Inf  -2.392  0.3305
##  4 - 6    -0.071249 0.0244 Inf  -2.916  0.1009
##  4 - 7    -0.083726 0.0244 Inf  -3.427  0.0216
##  4 - 8    -0.048370 0.0244 Inf  -1.980  0.6133
##  4 - 9    -0.043670 0.0244 Inf  -1.787  0.7434
##  4 - 10   -0.049336 0.0244 Inf  -2.019  0.5852
##  5 - 6    -0.012812 0.0244 Inf  -0.524  1.0000
##  5 - 7    -0.025288 0.0244 Inf  -1.035  0.9902
##  5 - 8     0.010068 0.0244 Inf   0.412  1.0000
##  5 - 9     0.014768 0.0244 Inf   0.604  0.9999
##  5 - 10    0.009102 0.0244 Inf   0.373  1.0000
##  6 - 7    -0.012477 0.0244 Inf  -0.511  1.0000
##  6 - 8     0.022879 0.0244 Inf   0.936  0.9953
##  6 - 9     0.027579 0.0244 Inf   1.129  0.9819
##  6 - 10    0.021913 0.0244 Inf   0.897  0.9966
##  7 - 8     0.035356 0.0244 Inf   1.447  0.9123
##  7 - 9     0.040056 0.0244 Inf   1.640  0.8287
##  7 - 10    0.034390 0.0244 Inf   1.408  0.9253
##  8 - 9     0.004700 0.0244 Inf   0.192  1.0000
##  8 - 10   -0.000966 0.0244 Inf  -0.040  1.0000
##  9 - 10   -0.005666 0.0244 Inf  -0.232  1.0000
## 
## Group = Control, Session = 3:
##  contrast  estimate     SE  df z.ratio p.value
##  1 - 2    -0.017614 0.0286 Inf  -0.615  0.9998
##  1 - 3    -0.058889 0.0286 Inf  -2.056  0.5592
##  1 - 4    -0.061243 0.0286 Inf  -2.138  0.5004
##  1 - 5    -0.077159 0.0286 Inf  -2.693  0.1761
##  1 - 6    -0.043401 0.0286 Inf  -1.515  0.8866
##  1 - 7    -0.080465 0.0286 Inf  -2.809  0.1333
##  1 - 8    -0.118916 0.0286 Inf  -4.151  0.0014
##  1 - 9    -0.076159 0.0286 Inf  -2.658  0.1909
##  1 - 10   -0.045025 0.0286 Inf  -1.572  0.8620
##  2 - 3    -0.041275 0.0286 Inf  -1.441  0.9145
##  2 - 4    -0.043630 0.0286 Inf  -1.523  0.8833
##  2 - 5    -0.059545 0.0286 Inf  -2.079  0.5428
##  2 - 6    -0.025787 0.0286 Inf  -0.900  0.9965
##  2 - 7    -0.062851 0.0286 Inf  -2.194  0.4609
##  2 - 8    -0.101302 0.0286 Inf  -3.536  0.0148
##  2 - 9    -0.058545 0.0286 Inf  -2.044  0.5678
##  2 - 10   -0.027411 0.0286 Inf  -0.957  0.9945
##  3 - 4    -0.002354 0.0286 Inf  -0.082  1.0000
##  3 - 5    -0.018270 0.0286 Inf  -0.638  0.9998
##  3 - 6     0.015488 0.0286 Inf   0.541  0.9999
##  3 - 7    -0.021576 0.0286 Inf  -0.753  0.9991
##  3 - 8    -0.060027 0.0286 Inf  -2.095  0.5307
##  3 - 9    -0.017270 0.0286 Inf  -0.603  0.9999
##  3 - 10    0.013864 0.0286 Inf   0.484  1.0000
##  4 - 5    -0.015915 0.0286 Inf  -0.556  0.9999
##  4 - 6     0.017842 0.0286 Inf   0.623  0.9998
##  4 - 7    -0.019222 0.0286 Inf  -0.671  0.9997
##  4 - 8    -0.057673 0.0286 Inf  -2.013  0.5896
##  4 - 9    -0.014915 0.0286 Inf  -0.521  1.0000
##  4 - 10    0.016218 0.0286 Inf   0.566  0.9999
##  5 - 6     0.033758 0.0286 Inf   1.178  0.9757
##  5 - 7    -0.003306 0.0286 Inf  -0.115  1.0000
##  5 - 8    -0.041757 0.0286 Inf  -1.458  0.9086
##  5 - 9     0.001000 0.0286 Inf   0.035  1.0000
##  5 - 10    0.032133 0.0286 Inf   1.122  0.9826
##  6 - 7    -0.037064 0.0286 Inf  -1.294  0.9553
##  6 - 8    -0.075515 0.0286 Inf  -2.636  0.2008
##  6 - 9    -0.032758 0.0286 Inf  -1.143  0.9802
##  6 - 10   -0.001624 0.0286 Inf  -0.057  1.0000
##  7 - 8    -0.038451 0.0286 Inf  -1.342  0.9439
##  7 - 9     0.004306 0.0286 Inf   0.150  1.0000
##  7 - 10    0.035440 0.0286 Inf   1.237  0.9665
##  8 - 9     0.042757 0.0286 Inf   1.493  0.8956
##  8 - 10    0.073891 0.0286 Inf   2.579  0.2274
##  9 - 10    0.031133 0.0286 Inf   1.087  0.9861
## 
## Group = MED1, Session = 3:
##  contrast  estimate     SE  df z.ratio p.value
##  1 - 2    -0.101739 0.0270 Inf  -3.767  0.0064
##  1 - 3    -0.188371 0.0270 Inf  -6.974  <.0001
##  1 - 4    -0.192480 0.0270 Inf  -7.126  <.0001
##  1 - 5    -0.323694 0.0270 Inf -11.984  <.0001
##  1 - 6    -0.330012 0.0270 Inf -12.218  <.0001
##  1 - 7    -0.350385 0.0270 Inf -12.973  <.0001
##  1 - 8    -0.287938 0.0270 Inf -10.661  <.0001
##  1 - 9    -0.222587 0.0270 Inf  -8.241  <.0001
##  1 - 10   -0.320253 0.0270 Inf -11.857  <.0001
##  2 - 3    -0.086632 0.0270 Inf  -3.207  0.0438
##  2 - 4    -0.090741 0.0270 Inf  -3.360  0.0270
##  2 - 5    -0.221955 0.0270 Inf  -8.218  <.0001
##  2 - 6    -0.228272 0.0270 Inf  -8.452  <.0001
##  2 - 7    -0.248646 0.0270 Inf  -9.206  <.0001
##  2 - 8    -0.186199 0.0270 Inf  -6.894  <.0001
##  2 - 9    -0.120847 0.0270 Inf  -4.474  0.0003
##  2 - 10   -0.218514 0.0270 Inf  -8.090  <.0001
##  3 - 4    -0.004109 0.0270 Inf  -0.152  1.0000
##  3 - 5    -0.135323 0.0270 Inf  -5.010  <.0001
##  3 - 6    -0.141641 0.0270 Inf  -5.244  <.0001
##  3 - 7    -0.162015 0.0270 Inf  -5.998  <.0001
##  3 - 8    -0.099567 0.0270 Inf  -3.686  0.0086
##  3 - 9    -0.034216 0.0270 Inf  -1.267  0.9609
##  3 - 10   -0.131882 0.0270 Inf  -4.883  <.0001
##  4 - 5    -0.131214 0.0270 Inf  -4.858  0.0001
##  4 - 6    -0.137531 0.0270 Inf  -5.092  <.0001
##  4 - 7    -0.157905 0.0270 Inf  -5.846  <.0001
##  4 - 8    -0.095458 0.0270 Inf  -3.534  0.0149
##  4 - 9    -0.030106 0.0270 Inf  -1.115  0.9834
##  4 - 10   -0.127773 0.0270 Inf  -4.731  0.0001
##  5 - 6    -0.006318 0.0270 Inf  -0.234  1.0000
##  5 - 7    -0.026691 0.0270 Inf  -0.988  0.9930
##  5 - 8     0.035756 0.0270 Inf   1.324  0.9484
##  5 - 9     0.101107 0.0270 Inf   3.743  0.0070
##  5 - 10    0.003441 0.0270 Inf   0.127  1.0000
##  6 - 7    -0.020374 0.0270 Inf  -0.754  0.9991
##  6 - 8     0.042073 0.0270 Inf   1.558  0.8683
##  6 - 9     0.107425 0.0270 Inf   3.977  0.0028
##  6 - 10    0.009759 0.0270 Inf   0.361  1.0000
##  7 - 8     0.062447 0.0270 Inf   2.312  0.3809
##  7 - 9     0.127799 0.0270 Inf   4.732  0.0001
##  7 - 10    0.030132 0.0270 Inf   1.116  0.9833
##  8 - 9     0.065352 0.0270 Inf   2.420  0.3139
##  8 - 10   -0.032315 0.0270 Inf  -1.196  0.9731
##  9 - 10   -0.097666 0.0270 Inf  -3.616  0.0112
## 
## Group = MED21, Session = 3:
##  contrast  estimate     SE  df z.ratio p.value
##  1 - 2    -0.121958 0.0234 Inf  -5.214  <.0001
##  1 - 3    -0.160829 0.0234 Inf  -6.876  <.0001
##  1 - 4    -0.229455 0.0234 Inf  -9.810  <.0001
##  1 - 5    -0.235986 0.0234 Inf -10.089  <.0001
##  1 - 6    -0.293704 0.0234 Inf -12.556  <.0001
##  1 - 7    -0.323189 0.0234 Inf -13.817  <.0001
##  1 - 8    -0.315055 0.0234 Inf -13.469  <.0001
##  1 - 9    -0.318344 0.0234 Inf -13.610  <.0001
##  1 - 10   -0.301060 0.0234 Inf -12.871  <.0001
##  2 - 3    -0.038871 0.0234 Inf  -1.662  0.8170
##  2 - 4    -0.107498 0.0234 Inf  -4.596  0.0002
##  2 - 5    -0.114028 0.0234 Inf  -4.875  <.0001
##  2 - 6    -0.171746 0.0234 Inf  -7.342  <.0001
##  2 - 7    -0.201231 0.0234 Inf  -8.603  <.0001
##  2 - 8    -0.193097 0.0234 Inf  -8.255  <.0001
##  2 - 9    -0.196386 0.0234 Inf  -8.396  <.0001
##  2 - 10   -0.179103 0.0234 Inf  -7.657  <.0001
##  3 - 4    -0.068626 0.0234 Inf  -2.934  0.0963
##  3 - 5    -0.075157 0.0234 Inf  -3.213  0.0430
##  3 - 6    -0.132875 0.0234 Inf  -5.681  <.0001
##  3 - 7    -0.162360 0.0234 Inf  -6.941  <.0001
##  3 - 8    -0.154226 0.0234 Inf  -6.593  <.0001
##  3 - 9    -0.157515 0.0234 Inf  -6.734  <.0001
##  3 - 10   -0.140232 0.0234 Inf  -5.995  <.0001
##  4 - 5    -0.006531 0.0234 Inf  -0.279  1.0000
##  4 - 6    -0.064249 0.0234 Inf  -2.747  0.1552
##  4 - 7    -0.093734 0.0234 Inf  -4.007  0.0025
##  4 - 8    -0.085599 0.0234 Inf  -3.660  0.0095
##  4 - 9    -0.088889 0.0234 Inf  -3.800  0.0056
##  4 - 10   -0.071605 0.0234 Inf  -3.061  0.0676
##  5 - 6    -0.057718 0.0234 Inf  -2.468  0.2861
##  5 - 7    -0.087203 0.0234 Inf  -3.728  0.0074
##  5 - 8    -0.079069 0.0234 Inf  -3.380  0.0252
##  5 - 9    -0.082358 0.0234 Inf  -3.521  0.0156
##  5 - 10   -0.065075 0.0234 Inf  -2.782  0.1424
##  6 - 7    -0.029485 0.0234 Inf  -1.261  0.9621
##  6 - 8    -0.021351 0.0234 Inf  -0.913  0.9961
##  6 - 9    -0.024640 0.0234 Inf  -1.053  0.9888
##  6 - 10   -0.007357 0.0234 Inf  -0.315  1.0000
##  7 - 8     0.008134 0.0234 Inf   0.348  1.0000
##  7 - 9     0.004845 0.0234 Inf   0.207  1.0000
##  7 - 10    0.022128 0.0234 Inf   0.946  0.9949
##  8 - 9    -0.003289 0.0234 Inf  -0.141  1.0000
##  8 - 10    0.013994 0.0234 Inf   0.598  0.9999
##  9 - 10    0.017284 0.0234 Inf   0.739  0.9993
## 
## Degrees-of-freedom method: asymptotic 
## P value adjustment: tukey method for comparing a family of 10 estimates
emmeans(m.TARP, pairwise ~ Group | Time | Session)
## Note: D.f. calculations have been disabled because the number of observations exceeds 3000.
## To enable adjustments, add the argument 'pbkrtest.limit = 15410' (or larger)
## [or, globally, 'set emm_options(pbkrtest.limit = 15410)' 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 = 15410' (or larger)
## [or, globally, 'set emm_options(lmerTest.limit = 15410)' or larger];
## but be warned that this may result in large computation time and memory use.
## $emmeans
## Time = 1, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.288 0.0619 Inf     0.167     0.410
##  MED1     0.378 0.0583 Inf     0.264     0.492
##  MED21    0.489 0.0505 Inf     0.390     0.588
## 
## Time = 2, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.325 0.0619 Inf     0.204     0.446
##  MED1     0.454 0.0583 Inf     0.340     0.568
##  MED21    0.507 0.0505 Inf     0.408     0.606
## 
## Time = 3, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.363 0.0619 Inf     0.242     0.484
##  MED1     0.617 0.0583 Inf     0.502     0.731
##  MED21    0.554 0.0505 Inf     0.455     0.653
## 
## Time = 4, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.385 0.0619 Inf     0.263     0.506
##  MED1     0.635 0.0583 Inf     0.521     0.749
##  MED21    0.575 0.0505 Inf     0.476     0.673
## 
## Time = 5, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.411 0.0619 Inf     0.289     0.532
##  MED1     0.700 0.0583 Inf     0.586     0.814
##  MED21    0.585 0.0505 Inf     0.486     0.684
## 
## Time = 6, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.406 0.0619 Inf     0.284     0.527
##  MED1     0.679 0.0583 Inf     0.565     0.793
##  MED21    0.618 0.0505 Inf     0.519     0.717
## 
## Time = 7, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.332 0.0619 Inf     0.211     0.454
##  MED1     0.678 0.0583 Inf     0.564     0.792
##  MED21    0.688 0.0505 Inf     0.589     0.787
## 
## Time = 8, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.331 0.0619 Inf     0.209     0.452
##  MED1     0.699 0.0583 Inf     0.585     0.813
##  MED21    0.635 0.0505 Inf     0.536     0.734
## 
## Time = 9, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.341 0.0619 Inf     0.220     0.463
##  MED1     0.692 0.0583 Inf     0.577     0.806
##  MED21    0.618 0.0505 Inf     0.519     0.717
## 
## Time = 10, Session = 1:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.388 0.0619 Inf     0.267     0.509
##  MED1     0.675 0.0583 Inf     0.560     0.789
##  MED21    0.715 0.0505 Inf     0.616     0.814
## 
## Time = 1, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.302 0.0618 Inf     0.181     0.423
##  MED1     0.425 0.0583 Inf     0.311     0.539
##  MED21    0.494 0.0507 Inf     0.394     0.593
## 
## Time = 2, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.318 0.0618 Inf     0.196     0.439
##  MED1     0.545 0.0583 Inf     0.430     0.659
##  MED21    0.566 0.0507 Inf     0.466     0.665
## 
## Time = 3, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.355 0.0618 Inf     0.234     0.476
##  MED1     0.604 0.0583 Inf     0.490     0.718
##  MED21    0.605 0.0507 Inf     0.505     0.704
## 
## Time = 4, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.334 0.0618 Inf     0.213     0.455
##  MED1     0.633 0.0583 Inf     0.519     0.747
##  MED21    0.586 0.0507 Inf     0.487     0.685
## 
## Time = 5, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.360 0.0618 Inf     0.239     0.481
##  MED1     0.665 0.0583 Inf     0.550     0.779
##  MED21    0.644 0.0507 Inf     0.545     0.744
## 
## Time = 6, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.389 0.0618 Inf     0.268     0.510
##  MED1     0.834 0.0583 Inf     0.720     0.949
##  MED21    0.657 0.0507 Inf     0.558     0.757
## 
## Time = 7, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.404 0.0618 Inf     0.283     0.525
##  MED1     0.790 0.0583 Inf     0.675     0.904
##  MED21    0.670 0.0507 Inf     0.570     0.769
## 
## Time = 8, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.410 0.0618 Inf     0.289     0.531
##  MED1     0.759 0.0583 Inf     0.644     0.873
##  MED21    0.634 0.0507 Inf     0.535     0.734
## 
## Time = 9, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.425 0.0618 Inf     0.303     0.546
##  MED1     0.812 0.0583 Inf     0.698     0.926
##  MED21    0.630 0.0507 Inf     0.530     0.729
## 
## Time = 10, Session = 2:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.459 0.0618 Inf     0.338     0.580
##  MED1     0.715 0.0583 Inf     0.601     0.830
##  MED21    0.635 0.0507 Inf     0.536     0.735
## 
## Time = 1, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.335 0.0618 Inf     0.214     0.456
##  MED1     0.304 0.0583 Inf     0.190     0.419
##  MED21    0.443 0.0505 Inf     0.344     0.542
## 
## Time = 2, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.352 0.0618 Inf     0.231     0.474
##  MED1     0.406 0.0583 Inf     0.292     0.520
##  MED21    0.565 0.0505 Inf     0.466     0.664
## 
## Time = 3, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.394 0.0618 Inf     0.273     0.515
##  MED1     0.493 0.0583 Inf     0.379     0.607
##  MED21    0.604 0.0505 Inf     0.505     0.703
## 
## Time = 4, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.396 0.0618 Inf     0.275     0.517
##  MED1     0.497 0.0583 Inf     0.383     0.611
##  MED21    0.672 0.0505 Inf     0.574     0.771
## 
## Time = 5, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.412 0.0618 Inf     0.291     0.533
##  MED1     0.628 0.0583 Inf     0.514     0.742
##  MED21    0.679 0.0505 Inf     0.580     0.778
## 
## Time = 6, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.378 0.0618 Inf     0.257     0.499
##  MED1     0.634 0.0583 Inf     0.520     0.749
##  MED21    0.737 0.0505 Inf     0.638     0.836
## 
## Time = 7, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.415 0.0618 Inf     0.294     0.536
##  MED1     0.655 0.0583 Inf     0.541     0.769
##  MED21    0.766 0.0505 Inf     0.667     0.865
## 
## Time = 8, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.454 0.0618 Inf     0.333     0.575
##  MED1     0.592 0.0583 Inf     0.478     0.706
##  MED21    0.758 0.0505 Inf     0.659     0.857
## 
## Time = 9, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.411 0.0618 Inf     0.290     0.532
##  MED1     0.527 0.0583 Inf     0.413     0.641
##  MED21    0.761 0.0505 Inf     0.662     0.860
## 
## Time = 10, Session = 3:
##  Group   emmean     SE  df asymp.LCL asymp.UCL
##  Control  0.380 0.0618 Inf     0.259     0.501
##  MED1     0.625 0.0583 Inf     0.510     0.739
##  MED21    0.744 0.0505 Inf     0.645     0.843
## 
## Degrees-of-freedom method: asymptotic 
## Confidence level used: 0.95 
## 
## $contrasts
## Time = 1, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.089455 0.0850 Inf  -1.052  0.5438
##  Control - MED21 -0.200611 0.0798 Inf  -2.513  0.0321
##  MED1 - MED21    -0.111156 0.0771 Inf  -1.442  0.3195
## 
## Time = 2, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.128908 0.0850 Inf  -1.517  0.2831
##  Control - MED21 -0.181941 0.0798 Inf  -2.279  0.0588
##  MED1 - MED21    -0.053032 0.0771 Inf  -0.688  0.7706
## 
## Time = 3, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.253678 0.0850 Inf  -2.984  0.0080
##  Control - MED21 -0.191389 0.0798 Inf  -2.397  0.0436
##  MED1 - MED21     0.062289 0.0771 Inf   0.808  0.6981
## 
## Time = 4, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.250596 0.0850 Inf  -2.948  0.0090
##  Control - MED21 -0.189939 0.0798 Inf  -2.379  0.0457
##  MED1 - MED21     0.060656 0.0771 Inf   0.787  0.7112
## 
## Time = 5, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.289480 0.0850 Inf  -3.406  0.0019
##  Control - MED21 -0.174636 0.0798 Inf  -2.188  0.0733
##  MED1 - MED21     0.114844 0.0771 Inf   1.489  0.2959
## 
## Time = 6, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.273243 0.0850 Inf  -3.215  0.0037
##  Control - MED21 -0.212258 0.0798 Inf  -2.659  0.0214
##  MED1 - MED21     0.060985 0.0771 Inf   0.791  0.7086
## 
## Time = 7, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.345411 0.0850 Inf  -4.064  0.0001
##  Control - MED21 -0.355492 0.0798 Inf  -4.453  <.0001
##  MED1 - MED21    -0.010081 0.0771 Inf  -0.131  0.9906
## 
## Time = 8, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.368499 0.0850 Inf  -4.335  <.0001
##  Control - MED21 -0.304380 0.0798 Inf  -3.813  0.0004
##  MED1 - MED21     0.064118 0.0771 Inf   0.832  0.6834
## 
## Time = 9, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.350118 0.0850 Inf  -4.119  0.0001
##  Control - MED21 -0.276234 0.0798 Inf  -3.460  0.0016
##  MED1 - MED21     0.073884 0.0771 Inf   0.958  0.6033
## 
## Time = 10, Session = 1:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.286532 0.0850 Inf  -3.371  0.0022
##  Control - MED21 -0.326714 0.0798 Inf  -4.092  0.0001
##  MED1 - MED21    -0.040181 0.0771 Inf  -0.521  0.8610
## 
## Time = 1, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.122756 0.0849 Inf  -1.445  0.3177
##  Control - MED21 -0.191487 0.0800 Inf  -2.395  0.0438
##  MED1 - MED21    -0.068731 0.0772 Inf  -0.890  0.6467
## 
## Time = 2, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.227015 0.0849 Inf  -2.673  0.0206
##  Control - MED21 -0.248194 0.0800 Inf  -3.104  0.0054
##  MED1 - MED21    -0.021179 0.0772 Inf  -0.274  0.9594
## 
## Time = 3, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.249059 0.0849 Inf  -2.932  0.0094
##  Control - MED21 -0.249540 0.0800 Inf  -3.121  0.0051
##  MED1 - MED21    -0.000481 0.0772 Inf  -0.006  1.0000
## 
## Time = 4, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.298874 0.0849 Inf  -3.519  0.0013
##  Control - MED21 -0.252041 0.0800 Inf  -3.152  0.0046
##  MED1 - MED21     0.046833 0.0772 Inf   0.606  0.8166
## 
## Time = 5, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.304693 0.0849 Inf  -3.587  0.0010
##  Control - MED21 -0.284496 0.0800 Inf  -3.558  0.0011
##  MED1 - MED21     0.020197 0.0772 Inf   0.262  0.9630
## 
## Time = 6, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.445492 0.0849 Inf  -5.245  <.0001
##  Control - MED21 -0.268269 0.0800 Inf  -3.355  0.0023
##  MED1 - MED21     0.177223 0.0772 Inf   2.295  0.0565
## 
## Time = 7, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.385852 0.0849 Inf  -4.543  <.0001
##  Control - MED21 -0.265986 0.0800 Inf  -3.327  0.0025
##  MED1 - MED21     0.119866 0.0772 Inf   1.552  0.2668
## 
## Time = 8, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.348655 0.0849 Inf  -4.105  0.0001
##  Control - MED21 -0.224361 0.0800 Inf  -2.806  0.0139
##  MED1 - MED21     0.124294 0.0772 Inf   1.609  0.2416
## 
## Time = 9, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.387203 0.0849 Inf  -4.559  <.0001
##  Control - MED21 -0.205114 0.0800 Inf  -2.565  0.0278
##  MED1 - MED21     0.182089 0.0772 Inf   2.358  0.0483
## 
## Time = 10, Session = 2:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.256528 0.0849 Inf  -3.020  0.0071
##  Control - MED21 -0.176432 0.0800 Inf  -2.207  0.0700
##  MED1 - MED21     0.080096 0.0772 Inf   1.037  0.5534
## 
## Time = 1, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1   0.030452 0.0849 Inf   0.359  0.9316
##  Control - MED21 -0.108114 0.0798 Inf  -1.355  0.3646
##  MED1 - MED21    -0.138566 0.0771 Inf  -1.798  0.1702
## 
## Time = 2, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.053673 0.0849 Inf  -0.632  0.8025
##  Control - MED21 -0.212457 0.0798 Inf  -2.663  0.0211
##  MED1 - MED21    -0.158784 0.0771 Inf  -2.060  0.0982
## 
## Time = 3, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.099030 0.0849 Inf  -1.166  0.4735
##  Control - MED21 -0.210053 0.0798 Inf  -2.633  0.0230
##  MED1 - MED21    -0.111023 0.0771 Inf  -1.441  0.3200
## 
## Time = 4, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.100785 0.0849 Inf  -1.187  0.4610
##  Control - MED21 -0.276325 0.0798 Inf  -3.464  0.0015
##  MED1 - MED21    -0.175540 0.0771 Inf  -2.278  0.0589
## 
## Time = 5, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.216083 0.0849 Inf  -2.544  0.0295
##  Control - MED21 -0.266941 0.0798 Inf  -3.346  0.0024
##  MED1 - MED21    -0.050857 0.0771 Inf  -0.660  0.7867
## 
## Time = 6, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.256159 0.0849 Inf  -3.016  0.0072
##  Control - MED21 -0.358416 0.0798 Inf  -4.493  <.0001
##  MED1 - MED21    -0.102258 0.0771 Inf  -1.327  0.3802
## 
## Time = 7, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.239468 0.0849 Inf  -2.820  0.0133
##  Control - MED21 -0.350837 0.0798 Inf  -4.398  <.0001
##  MED1 - MED21    -0.111369 0.0771 Inf  -1.445  0.3178
## 
## Time = 8, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.138570 0.0849 Inf  -1.632  0.2322
##  Control - MED21 -0.304252 0.0798 Inf  -3.814  0.0004
##  MED1 - MED21    -0.165682 0.0771 Inf  -2.150  0.0801
## 
## Time = 9, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.115976 0.0849 Inf  -1.366  0.3590
##  Control - MED21 -0.350299 0.0798 Inf  -4.391  <.0001
##  MED1 - MED21    -0.234323 0.0771 Inf  -3.041  0.0067
## 
## Time = 10, Session = 3:
##  contrast         estimate     SE  df z.ratio p.value
##  Control - MED1  -0.244776 0.0849 Inf  -2.882  0.0110
##  Control - MED21 -0.364148 0.0798 Inf  -4.565  <.0001
##  MED1 - MED21    -0.119373 0.0771 Inf  -1.549  0.2681
## 
## Degrees-of-freedom method: asymptotic 
## P value adjustment: tukey method for comparing a family of 3 estimates

#TAR models effects plot

#Front TAR effects
ae.m.TARF <- allEffects(m.TARF_WO)
ae.m.df.TARF <- as.data.frame(ae.m.TARF[[1]])
#Ordering timepoint if needed
#ae.m.df.AF2$Time <- factor(ae.m.df.AF2$Time, levels=c('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'))

#Ordering Timepoint
ae.m.df.TARF$Session <- as.character(ae.m.df.TARF$Session)
ae.m.df.TARF$Session <- as.numeric(ae.m.df.TARF$Session)
ae.m.df.TARF$Time <- as.character(ae.m.df.TARF$Time)
ae.m.df.TARF$Time <- as.numeric(ae.m.df.TARF$Time)

##########################
#Posterior TAR effects
ae.m.TARP <- allEffects(m.TARP)
ae.m.df.TARP <- as.data.frame(ae.m.TARP[[1]])
#Ordering RoI
#ae.m.df.TARP$Time <- factor(ae.m.df.TARP$Time, levels=c('1', '2', '3', '4', '5', '6', '7', '8', '9', '10'))

#Ordering Timepoint
ae.m.df.TARP$Session <- as.character(ae.m.df.TARP$Session)
ae.m.df.TARP$Session <- as.numeric(ae.m.df.TARP$Session)
ae.m.df.TARP$Time <- as.character(ae.m.df.TARP$Time)
ae.m.df.TARP$Time <- as.numeric(ae.m.df.TARP$Time)
#Frontal TAR Model
ae.TARF <- ggplot(ae.m.df.TARF, aes(x=Time, y=fit, group=Group))+
  geom_ribbon(aes(ymin=fit-se, ymax=fit+se, fill=Group), alpha=0.2)+
  geom_point(aes(color = Group, shape = Group), size=3)+
  ylab("Theta to alpha ratio (n.u.)")+
  geom_line(aes(color=Group),size=1)+
  scale_x_continuous(name="Time", breaks=c(1,2,3,4,5,6,7,8,9,10))+
  ggtitle("Theta to alpha ratio (n.u.)")+
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(), axis.line = element_line(colour = "black"), axis.text = element_text(size = 25))+
  facet_grid(.~Session)

plot(ae.TARF)

#Posterior TAR model
ae.TARP <- ggplot(ae.m.df.TARP, aes(x=Time, y=fit, group=Group))+
  geom_ribbon(aes(ymin=lower, ymax=upper, fill=Group), alpha=0.2)+
  geom_point(aes(color = Group, shape = Group), size=3)+
  ylab("Theta to alpha ratio (n.u.)")+
  geom_line(aes(color=Group),size=1)+
  scale_x_continuous(name="Time", breaks=c(1,2,3,4,5,6,7,8,9,10))+
  ggtitle("Theta to alpha ration (n.u.)")+
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(),panel.background = element_blank(), axis.line = element_line(colour = "black"), axis.text = element_text(size = 25))+
  facet_grid(.~Session)

plot(ae.TARP)