问题
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?
回答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.
来源:https://stackoverflow.com/questions/60598904/friedman-rank-sum-test-in-r-not-an-unreplicated-complete-block-design