# comparaison des distributions
stat.test1 <-
prof %>%
wilcox_test(sit_dif_gdv ~ sit_dif_gdv11_2, alternative = 'l') %>%
adjust_pvalue(method = "bonferroni") %>%
add_significance('p.adj') #%>%
#mutate(y.position = c(37), label = paste0("p = ",p.adj))
#stat.test
plot1 <-
prof %>% filter(participation == 1) %>%
filter(!is.na(sit_dif_gdv11_2)) %>%
ggplot(aes(x = sit_dif_gdv11_2, y=sit_dif_gdv, colour = sit_dif_gdv11_2)) +
geom_boxplot(alpha=10, outlier.alpha=0) +
#geom_jitter(fill="black") +
stat_summary(fun.y=mean, colour="blue", geom="point", shape=18, size=3) +
annotate(geom = "point", shape=18, size = 3, x = .5, y = 38, color = "blue") +
annotate(geom = "text", size = 2, x = .75, y = 38, label="Moyenne", color = "blue") +
labs(y = "Score d'auto-efficacité") + labs(x = '') +
#ggpubr::stat_pvalue_manual(stat.test, tip.length = 0) +
labs(subtitle = get_test_label(stat.test1, detailed = TRUE)) +
labs(title = "Expériences passées") +
scale_x_discrete(labels = c("Pas du tout / Un peu vrai" = "Pas du tout vrai\nUn peu vrai",
"Plutôt / Tout à fait vrai" = "Plutôt vrai\nTout à fait vrai")) +
theme_lisa() +
theme(title = element_text(size = 6, face = 'bold'),
plot.subtitle = element_text(size = 6, face = 'italic', color = 'grey50'),
axis.text.x = element_text(margin = margin(t = .2, unit = "cm"), size = 6),
axis.text.y = element_text(margin = margin(t = .2, unit = "cm"), size = 6),
axis.title.y = element_text(size = 6))
Warning: The `fun.y` argument of `stat_summary()` is deprecated as of ggplot2 3.3.0.
ℹ Please use the `fun` argument instead.
stat.test2 <-
prof %>%
wilcox_test(sit_dif_gdv ~ sit_dif_gdv12_2, alternative = 'l') %>%
adjust_pvalue(method = "bonferroni") %>%
add_significance('p.adj') #%>%
#mutate(y.position = c(37), label = paste0("p = ",p.adj))
#stat.test
plot2 <-
prof %>% filter(participation == 1) %>%
filter(!is.na(sit_dif_gdv12_2)) %>%
ggplot(aes(x = sit_dif_gdv12_2, y=sit_dif_gdv, colour = sit_dif_gdv12_2)) +
geom_boxplot(alpha=10, outlier.alpha=0) +
#geom_jitter(fill="black") +
stat_summary(fun.y=mean, colour="blue", geom="point", shape=18, size=3) +
annotate(geom = "point", shape=18, size = 3, x = .5, y = 38, color = "blue") +
annotate(geom = "text", size = 2, x = .75, y = 38, label="Moyenne", color = "blue") +
labs(y = "Score d'auto-efficacité") + labs(x = '') +
#ggpubr::stat_pvalue_manual(stat.test, tip.length = 0) +
labs(subtitle = get_test_label(stat.test2, detailed = TRUE)) +
labs(title = "Leçons des échecs") +
scale_x_discrete(labels = c("Pas du tout / Un peu vrai" = "Pas du tout vrai\nUn peu vrai",
"Plutôt / Tout à fait vrai" = "Plutôt vrai\nTout à fait vrai")) +
theme_lisa() +
theme(title = element_text(size = 6, face = 'bold'),
plot.subtitle = element_text(size = 6, face = 'italic', color = 'grey50'),
axis.text.x = element_text(margin = margin(t = .2, unit = "cm"), size = 6),
axis.text.y = element_text(margin = margin(t = .2, unit = "cm"), size = 6),
axis.title.y = element_text(size = 6))
gridExtra::grid.arrange(plot1, plot2, ncol=2)