Kruskal Wallis test with the same p-value for all data?
1
0
Entering edit mode
4.5 years ago
star ▴ 350

I have a table like below. I calculated the Kruskal Wallis test on it to find the difference between time points, but I observed the same p-value for all rows.

I would like to know is it normal or there is something wrong?

set:

coordinate                 T1         T2         T3
1:1274030-1274740   1.9566343   2.838040   1.536095
1:1277323-1278292   1.8318908   4.281266   1.059312
1:1283175-1283707   2.7563698   8.689222   5.064835
1:1304816-1305195   0.2036368   2.814694   1.862006
1:1310186-1310370  5.0333709   7.730211   5.229992
1:1315768-1315981   3.2610572   4.730067   3.915537


code:

library(broom)
fun <- function(x) {
tidy(kruskal.test(list(x[2],x[3],x[4])))
}

test <- apply(set, 1, fun)
test <- do.call(rbind,test)
cbind(set,test)


output:

coordinate                 T1         T2         T3 statistic   p.value
1:1274030-1274740   1.9566343   2.838040   1.536095   2       0.3678794
1:1277323-1278292   1.8318908   4.281266   1.059312   2       0.3678794
1:1283175-1283707   2.7563698   8.689222   5.064835   2       0.3678794
1:1304816-1305195   0.2036368   2.814694   1.862006   2       0.3678794
1:1310186-1310370  5.0333709   7.730211   5.229992   2       0.3678794
1:1315768-1315981   3.2610572   4.730067   3.915537   2       0.3678794

statistic R Kruskal-Wallis non-parametric • 798 views
1
Entering edit mode
4.5 years ago

You have only one data point in each group.You cannot do a kruskal wallis test with only one observation in each group.