Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.6k views
in Technique[技术] by (71.8m points)

r - Friedman test unreplicated complete block design error

I'm having trouble running a Friedman test over my data. I'm trying to run a Friedman test using this command:

friedman.test(mean ~ isi | expId, data=monoSum)

On the following database (https://www.dropbox.com/s/2ox0y1b4gwld0ai/monoSum.csv):

> monoSum
   expId isi  N       mean
1  m80B1   1 10 100.000000
2  m80B1   2 10  73.999819
3  m80B1   3 10  45.219362
4  m80B1   4 10 116.566174        
.   .     .   .          .
18 m80L2   2 10  82.945491
19 m80L2   3 10  57.675480
20 m80L2   4 10 207.169277
.    .     .  .   .      .
25 m80M2   1 10 100.000000
26 m80M2   2 10  49.752687
27 m80M2   3 10  19.042592
28 m80M2   4 10 150.411035

It gives me back the error:

Error in friedman.test.default(c(100, 73.9998193095267, 45.2193621626293,  : 
not an unreplicated complete block design

I figure it gives the error because, when monoSum$isi==1 the value of mean is always 100. Is this correct?

However, monoSum$isi==1 is alway 100 because it is the control group on which all the other monoSum$isi groups are normalized. I can not assume a normal distribution, so I cannot run a rmANOVA… Is there a way to run a friedman test on this data or am I missing a very essential point here?

Many thanks in advance!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I don't get an error if I run your dataset:

   Friedman rank sum test

   data:  mean and isi and expId
   Friedman chi-squared = 17.9143, df = 3, p-value = 0.0004581

However, you have to make sure that expId and isi are coded as factors. Run these commands:

    monoSum$expID$<-factor(monoSum$expID)
    monoSum$isi$<-factor(monoSum$isi)

Then run the test again. This has worked for me with a similar problem.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...