0

While using R, if I use the formula in kruskal.test:

kruskal.test(Response~Group, data = data)

I am getting significant results (p = 0.018). However, if the data is arranged differently and I just compare the 5 columns:

kruskal.test(a,b,c,d,e)

I get insignificant results (p=0.48). I always used these interchangeably, depending on how the data was arranged, but there's obviously a big difference. Can you just not compare columns in that matter with Kruskal Wallis? If that's so, what is the kruskal.test actually doing when you put the columns in individually?

When the data is vertical (2 columns - responce and category):

kruskal.test(Response~Category, data = data)

I got p = 0.018

When the data is in table format (columns A - E each represent their own category):

kruskal.test(A,B,C,D,E)

I got p = 0.48

L Tyrone
  • 1,268
  • 3
  • 15
  • 24
  • I think I figured it out. It looks like if you list the columns individually, it is only comparing among the first 2. If all of your columns are data you want to compare then you can do kruskal.test(data) to compare them all. – BrisketsBestie Apr 21 '23 at 20:18

0 Answers0