我会在下面给出一个关于我的数据是如何组织的示例,但每次我使用frieman.test(y=,groups=,blocks=(运行Friedman的时,它都会给我一个错误,即我的数据不是来自一个未复制的完整块设计,尽管它是。
score | treatment | day |
---|---|---|
10 | 1 | 1 |
20 | 1 | 1 |
40 | 1 | 1 |
7 | 2 | 1 |
100 | 2 | 1 |
58 | 2 | 1 |
98 | 3 | 1 |
89 | 3 | 1 |
40 | 3 | 1 |
70 | 4 | 1 |
10 | 4 | <1>|
28 | 4 | <1>|
86 | 5 | 1 |
200 | 5 | 1 |
40 | 5 | 1 |
77 | 1 | 2 |
100 | 1 | 2 |
90 | 1 | 2 |
33 | 2 | 2 |
15 | 2 | |
25 | 2 | 2 |
23 | 3 | 2 |
54 | 3 | 2 |
67 | 3 | 2 |
1 | 4 | 2 |
2 | 4 | 2 |
400 | 4 | 2 |
16 | 5 | //tr>|
10 | 5 | //tr>|
90 | 5 | 2 |
我们可以通过取"分数"的mean
来总结数据,然后在friedman.test
中使用总结的数据
sample_data1 <- aggregate(score ~ ., sample_data, FUN = mean)
friedman.test(sample_data1$score, groups = sample_data1$treatment,
blocks = sample_data1$day)