I am running a multiple comparison using the non-parametric Kruskal Wallis test (K-W), using the ggpubr library and I am a bit confused about the results.
When i just run the KW-test using "base R" the result is different and I am not sure if there is an issue with the data or I am doing something wrong.
In case of ggpubr im getting significant result, i mean the p value is much lower than the critical threshold, but in case of base R this does not occer. I am posting the code and results figure.
Any suggestion would be highly appreciated why results are varying ..
Data
library(ggpubr)
df1 = read.csv("NEW_RBP/CORPLOT/RBP_DISEASE_CLUSTER/RBP_DISEASE_C1_C4_AVG.txt",header = TRUE,sep = "\t")
head(df1)
my_comparisons <- list( c("HSC", "LSC"), c("LSC", "Blast"), c("HSC", "Blast") )
ex <- melt(df1, id.vars=c("gene"))
head(ex)
ggboxplot(ex, x = "variable", y = "value",ggtheme = theme_bw(base_size = 30),
color = "variable", palette = "jco", add = "jitter")+
stat_compare_means(comparisons = my_comparisons)+ # Add pairwise comparisons p-value
stat_compare_means(label.y = 50) # Add global p-value
kruskal.test(HSC ~ LSC, data = df1)
Kruskal-Wallis rank sum test
data: HSC by LSC
Kruskal-Wallis chi-squared = 416, df = 416, p-value = 0.4908