I've fitted the following model
models_list_1 <- data_long %>%
group_by(signals) %>%
do(fit = lmerTest::lmer(value ~ COND*SES (1 |ID), data = .)) %>%
pull(fit) %>%
lapply(., function(x) summary(x)$coefficients) %>%
setNames(unique(data_long$signals))
and extracted the pairwise stastistics as follows
md <- data_long %>%
group_by(signals) %>%
do(fit = lmerTest::lmer(value ~ COND*SES (1 |ID), data = .)) %>%
pull(fit) %>%
lapply(., function(m) lsmeans(m, pairwise ~ COND*SES, adjust="tukey"))
If I would like to reprocude iteratively (for each of signals variable included into the dataset below) a kind of boxplots graph
where in the place of time reported into the example, I will have the three different sessions (SES = L,V,R) of my dataset (reported below will appear) and for each sessions some multiple pairwise comparisons among the three conditions (COND (NEG-CTR, NEG-NOC and NEU-NOC) reported below into the dataset) what am I supposed to do? Which and how I should set an iterative function for reporting the bar of significant difference?
Thanks in advance
Here the dataset
> dput(head(data_long,300))
structure(list(ID = c("01", "01", "01", "01", "01", "01", "01",
"01", "01", "01", "01", "01", "01", "01", "01", "01", "01", "01",
"01", "01", "01", "01", "01", "01", "01", "01", "01", "01", "01",
"01", "01", "01", "01", "01", "01", "01", "01", "01", "01", "01",
"01", "01", "01", "01", "01", "01", "01", "01", "01", "01", "01",
"01", "01", "01", "01", "01", "01", "01", "01", "01", "01", "01",
"01", "01", "01", "01", "01", "01", "01", "01", "01", "01", "01",
"01", "01", "01", "01", "01", "01", "01", "01", "01", "01", "01",
"01", "01", "01", "01", "01", "01", "01", "01", "01", "01", "01",
"01", "01", "01", "01", "01", "01", "01", "01", "01", "01", "01",
"01", "01", "01", "01", "01", "01", "01", "01", "01", "01", "01",
"02", "02", "02", "02", "02", "02", "02", "02", "02", "02", "02",
"02", "02", "02", "02", "02", "02", "02", "02", "02", "02", "02",
"02", "02", "02", "02", "02", "02", "02", "02", "02", "02", "02",
"02", "02", "02", "02", "02", "02", "02", "02", "02", "02", "02",
"02", "02", "02", "02", "02", "02", "02", "02", "02", "02", "02",
"02", "02", "02", "02", "02", "02", "02", "02", "02", "02", "02",
"02", "02", "02", "02", "02", "02", "02", "02", "02", "02", "02",
"02", "04", "04", "04", "04", "04", "04", "04", "04", "04", "04",
"04", "04", "04", "04", "04", "04", "04", "04", "04", "04", "04",
"04", "04", "04", "04", "04", "04", "04", "04", "04", "04", "04",
"04", "04", "04", "04", "04", "04", "04", "04", "04", "04", "04",
"04", "04", "04", "04", "04", "04", "04", "04", "04", "04", "04",
"04", "04", "04", "04", "04", "04", "04", "04", "04", "04", "04",
"04", "04", "04", "04", "04", "04", "04", "04", "04", "04", "04",
"04", "04", "04", "04", "04", "04", "04", "04", "04", "04", "04",
"04", "04", "04", "04", "04", "04", "04", "04", "04", "04", "04",
"04", "04", "04", "04", "04", "04", "04"), GR = c("RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP", "RP",
"RP"), SES = c("L", "L", "L", "L", "L", "L", "L", "L", "L", "L",
"L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L",
"L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L",
"L", "L", "L", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"R", "R", "R", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V",
"V", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V",
"V", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V",
"V", "V", "V", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L",
"L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L",
"L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L",
"L", "L", "L", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"R", "R", "R", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L",
"L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L",
"L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L",
"L", "L", "L", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R",
"R", "R", "R", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V",
"V", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V", "V",
"V", "V", "V", "V"), COND = c("NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC", "NEU-NOC",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR", "NEG-CTR",
"NEG-CTR", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC", "NEG-NOC",
"NEG-NOC", "NEG-NOC", "NEU-NOC"), signals = c("P3(400-450).FCz",
"P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz", "P3(400-450).Cz", "P3(400-450).Pz", "LPPearly(500-700).FCz",
"LPPearly(500-700).Cz", "LPPearly(500-700).Pz", "LPP1(500-1000).FCz",
"LPP1(500-1000).Cz", "LPP1(500-1000).Pz", "LPP2(1000-1500).FCz",
"LPP2(1000-1500).Cz", "LPP2(1000-1500).Pz", "LPP2(1000-1500).POz",
"P3(400-450).FCz"), value = c(-13.733750856001, -9.75024624896264,
2.65626156135631, -11.2145748677083, -8.14861856277773, 3.4315211013568,
-7.774797181711, -5.0379636708446, 4.67200616533014, -0.397250087672501,
2.91913936481813, 8.38141924882334, 9.61455213192824, -11.0706676917232,
-8.42427447113084, 3.37360619561252, -13.9481657323772, -11.7645758007163,
-1.55179922542943, -8.40872060176111, -6.36865552801825, 1.75888442936359,
1.01519755373062, 1.85489998202138, 4.88842858528025, 7.21299011910717,
-8.4719202003519, -5.61886494275071, 5.4043480635031, -12.0047623683783,
-9.16726244915301, 1.13509020104859, -7.03235376576925, -4.54670193355435,
2.49276476951357, -1.17300033366376, 0.694393606954545, 5.0594399581601,
6.1861244061312, -5.04318152659785, 0.73152672768007, 19.5226358864568,
-4.24372139176794, 0.918751423320568, 16.3120391015512, -0.65010821749741,
4.05493850786385, 13.8997702651793, 0.663115370014327, 3.95694572160701,
3.88831364571248, 6.46723813995257, -6.25375875400145, 1.11453058993788,
18.5017390789352, -7.38414465678688, -0.674372568935879, 14.1694182774958,
-3.24350263682843, 2.67516303169366, 13.2135623121441, -1.72160165493474,
2.36649557381131, 5.83201076558185, 7.25962635499353, -7.0474968134059,
-2.25104720773472, 11.7844254386573, -6.61221718491095, -2.47425935490564,
9.04781409226351, -2.84832379590422, 1.02479302810681, 9.51479768101391,
0.0540027107377267, 2.71292196345657, 3.65113189260335, 7.92952342178602,
-11.6312151716924, -5.16524399006139, 11.8802266972569, -11.7785042972793,
-5.96429031525769, 8.23981597718437, -5.67295796971287, -0.774461731301161,
9.99385579756163, -0.198736254963744, 2.96437294922766, 6.28027312932027,
7.91468942320841, -11.1438413285935, -5.53112490175437, 12.1053426662461,
-9.14927207125904, -5.10918437158799, 9.51261484648731, -4.3918290080777,
-0.650009462761383, 11.1212652173052, -3.16101041766438, -2.12913230708907,
5.24535230966772, 9.94838815736199, -3.99591470944713, 0.621502123415388,
12.955441582096, -7.58190508537766, -2.81732229625975, 9.42367409925817,
-2.96652960658775, 1.14010250644923, 10.6989716871958, 0.895992279831378,
2.94619035115619, 7.68162285335806, 10.2186482048953, 8.71618523084192,
10.0972150696175, 13.9718285231429, 14.2438131545118, 18.1277616996079,
20.6284861844249, 12.5228696634748, 15.0856583318757, 15.4011622649207,
9.21248347391488, 10.0673617448764, 8.55827491190151, 5.76901446016799,
3.1567164130045, 3.29671672118792, 6.37710361710325, 10.3728637305957,
14.0324104861749, 17.1194345279475, 10.1688421767607, 12.7218688256241,
13.5845965959489, 4.2029104966206, 5.28032844958354, 4.37390045274906,
1.63411653734436, 0.11779005903818, 0.527314779744752, 3.52040283490143,
4.71555467505934, 7.88901307601169, 9.74981375898379, 4.94891653050796,
7.04929483656524, 7.62145250862908, 5.29260474692784, 5.76317883868431,
4.27567967018154, 2.14044069620066, 6.2230923800622, 7.48013969467974,
13.9681839573434, 8.16263381384371, 10.9263261999576, 15.5578942384162,
8.29234474523583, 9.71944484568732, 12.4214977980377, 4.43538787409554,
4.54790063971537, 6.04702803069286, 4.09091078261671, 0.545039723311392,
2.24297008138028, 8.64955428897889, 2.54754270788021, 5.40070389371842,
10.3425870381822, 2.89989209310052, 5.19815917760722, 8.94731174966949,
1.28346027317076, 2.16569592764593, 5.29458007289059, 5.32593378182311,
-0.383605036065646, -0.0523505792147314, 2.80847380898547, -1.01463338713448,
0.139150314055044, 3.41932708826405, 1.69916872833203, 2.20513206952329,
4.10953557761617, 1.17003451023205, 1.33824716938448, 1.21234812875355,
-0.0587064331536407, -2.10936383457265, 0.0473343786951428, 10.1644392609445,
-6.4216236476269, -4.61042211238648, 4.05274207265641, -1.13332962482291,
-0.20305866581144, 5.80373742668179, 3.21881665778703, 2.58426832963409,
6.30887598671621, 6.86490468078958, 1.81064934015995, 2.78240093455642,
13.2788201390174, -4.08374576377548, -3.5562551128714, 3.767844291789,
0.649857280429136, 1.01053594416015, 5.74639215930458, 5.92604591551597,
5.077230852852, 5.9614279900414, 5.26280996552585, 0.754416368133019,
2.60057993978525, 10.5077997492971, -8.46742290376216, -6.85651693740331,
0.326110657534835, -4.43684347222634, -2.96241685765962, 1.48762660613099,
-2.75555354427229, -1.59699177169018, -0.609381826740468, 0.981300734684586,
-1.2371236814317, 1.4302038359579, 13.4030666728381, -6.30908300837476,
-2.17237957159954, 6.65839865279684, -2.31574543509226, 1.26480036715092,
6.04018553841336, 2.18006640865321, 6.61872855398538, 3.66646157996528,
5.0384350436334, -2.76852389876276, -0.650797837853182, 4.74014346829081,
-6.72661142802369, -6.18867237684241, 1.17003883692158, -2.73359549382074,
-2.00512841997728, 1.9050381096835, -0.225533814334514, -1.21696526578647,
0.240956222277802, 0.361670119961531, 5.54144355778122, 7.81248993867768,
11.9003140352528, -3.32736490042247, -1.77938930999718, 5.40630013085777,
-0.38736451456005, -0.423105565152366, 6.37211228749408, 0.986467266459687,
-0.507207892673482, 1.15053325116554, 0.393791410918138, -0.314155675382471,
2.23100741241039, 15.0981004360619, -4.01515836011381, -1.43557366487622,
5.06332653216481, 0.159183652691071, 1.51403741206392, 3.7899021820967,
3.11042068112836, 3.44844607014521, 1.08242973465635, 1.07455889922813,
0.238885648959708, 3.96990710862955, 15.4046229884164, -6.60165385653499,
-3.14872157912645, 5.02619159395405, -1.78361184935376, 0.25571835554024,
4.59413830322224, 2.27800090558473, 3.02403433835637, 2.99896314000211,
1.65917850515029, 5.03749946898385)), row.names = c(NA, -300L
), class = c("tbl_df", "tbl", "data.frame"))
>
CodePudding user response:
Something like this?
library(tidyverse)
library(ggpubr)
data_long %>%
ggplot(aes(COND, value, color = COND))
geom_boxplot()
stat_compare_means(
comparisons = list(
c("NEG-CTR", "NEG-NOC"),
c("NEG-CTR", "NEU-NOC"),
c("NEG-NOC", "NEU-NOC")
)
)
facet_wrap(~signals)
CodePudding user response:
I have tried to reproduce iteratively the graphs via this code (that is applied onto a wide format dataset).
for (i in 5:ncol(data)) {
p <- ggboxplot(data,
x = 'SES',
y = colnames(data[i]),
color = 'COND'
)
print(
p stat_compare_means(aes(label = paste0(..method.., ", p-value = ", ..p.format..)),
method = method2, label.y = max(data[, i], na.rm = TRUE)
)
stat_compare_means(comparisons = my_comparisons, method = method2, label = "p.format") # remove if p-value of ANOVA or Kruskal-Wallis test >= alpha
)
}
By the way I am not that happy with the results since it miss the comparisons bars onto the plots and furthermore I'd like learning to reshape the code onto a long format. Anyone can help?