1

I run into an error trying to implement Friedman Rank Sum test on a dataframe. What is a likely cause of this error and how should I fix this? enter image description here

NetUser5y62
  • 145
  • 1
  • 7
  • 1
    Try naming your arguments, or put them in the correct order. Check the help page or type `args(stats:::friedman.test.default)`. – Edward Mar 09 '20 at 10:53

1 Answers1

1

Your function call didn't include named arguments, which is a little dangerous at times.

Either put them in the correct order according to the order specified in the help page, which is:

function (y, groups, blocks, ...):

friedman.test(new_frame$Detail, new_frame$brands, new_frame$factors)

or name them (you can keep your original order):

friedman.test(blocks=new_frame$factors, groups=new_frame$brands, y=new_frame$Detail)

or use the formula method:

friedman.test(Detail~brands|factors, data=new_frame)

All three versions should give you the same result. But I am not sure which variable is your block and which one is your group. I apologize if I have switched them.

Edward
  • 10,360
  • 2
  • 11
  • 26