Question

raw Data looks like this:

  type value
1  a    10
2  a    20
3  a    30
4  b    50
5  b    10
6  b    20

melted data looks like this:

1 a value 10
2 b value 10

I want to apply wilcox.test to a,b To check whether a is greater than b. How to do that? thanks.

Was it helpful?

Solution

I don't think you need to melt the data.

given a data.frame raw containing your raw (unmelted) data

wilcox.test(value ~ type, data = raw)

should work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top