-
Notifications
You must be signed in to change notification settings - Fork 0
/
Figure4.R
executable file
·33 lines (25 loc) · 1.11 KB
/
Figure4.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
library("ggpubr")
superblock_interactions <- readRDS("superblock_interactions.RDS")
weights_interactions <- readRDS("centroid_interactions.RDS")
si <- superblock_interactions[, c("AVE_inner", "var11")]
wi <- weights_interactions[, c("AVE_inner", "var11")]
si <- cbind(si, Type = "Superblock")
wi <- cbind(wi, Type = "Weights")
df <- rbind.data.frame(si, wi)
df$Interaction[df$var11 != 0] <- "Yes"
df$Interaction[df$var11 == 0] <- "No"
df$Classification <- paste0(df$Type, "-", df$Interaction)
my_comparisons <- list(c("Superblock-No", "Superblock-Yes"),
c("Weights-No", "Weights-Yes"),
c("Superblock-No", "Weights-No"),
c("Weights-Yes", "Superblock-Yes"))
ggviolin(df, x = "Classification", y = "AVE_inner") +
stat_compare_means(comparisons = my_comparisons, paired = FALSE) + # Pairwise comparisons p-value
grids() +
ylab("inner AVE") +
xlab("Study-interaction") +
ggtitle("Effect of the interaction within GE")
library("dplyr")
df %>%
group_by(Interaction, Type) %>%
summarise(mean(AVE_inner), sd(AVE_inner), max(AVE_inner), min(AVE_inner))