Hello, I have problems interpreting the results of a Friedman test. It seems to me that the p-value resulting from a Friedman test and with it the "significance" has to be interpreted in another way than the p-value resulting from e.g. ANOVA? Let me describe the problem with some detail: I'm testing a lot of different hypotheses in my observer study and only for some the premises for performing an ANOVA are fulfilled (tested with Shapiro Wilk and Bartlett). For the others I perform a Friedman test. To my surprise, the p-value of the Friedman test is < 0.05 for all my tested hypotheses. Thus, I tried to "compare" the results with the results of an ANOVA by performing both test methods (Friedman, ANOVA) to a given set of data. While ANOVA results in p = 0.34445 (--> no significant difference between the groups), the Friedman test results in p = 1.913e-06 (--> significant difference between the groups?). How can this be? Or am I doing something wrong? I have three measured values for each condition. For ANOVA I use them all, for the Friedman test I calculated the geometric mean of the three values, since this test does not work with replicated values. Is this a crude mistake? Thanks in advance for any help. Doerte
Doerte wrote:> Hello, > > I have problems interpreting the results of a Friedman test. It seems > to me that the p-value resulting from a Friedman test and with it the > "significance" has to be interpreted in another way than the p-value > resulting from e.g. ANOVA? > > Let me describe the problem with some detail: I'm testing a lot of > different hypotheses in my observer study and only for some the > premises for performing an ANOVA are fulfilled (tested with Shapiro > Wilk and Bartlett). For the others I perform a Friedman test. > > To my surprise, the p-value of the Friedman test is < 0.05 for all my > tested hypotheses. Thus, I tried to "compare" the results with the > results of an ANOVA by performing both test methods (Friedman, ANOVA) > to a given set of data. > While ANOVA results in p = 0.34445 (--> no significant difference > between the groups), the Friedman test results in p = 1.913e-06 (--> > significant difference between the groups?). > > How can this be? > > Or am I doing something wrong? I have three measured values for each > condition. For ANOVA I use them all, for the Friedman test I > calculated the geometric mean of the three values, since this test > does not work with replicated values. Is this a crude mistake? > >Hi Doerte, There is a non-parametric repeated measures analog to ANOVA developed by Edgar Brunner available at: http://www.ams.med.uni-goettingen.de/de/sof/ld/makros.html Unfortunately, the test that you (and I) would like to have does not appear to have been translated to R code. I intend to contact Professor Brunner and try to complete this, or at least contribute to the effort, but have not had the time to do so. There are several other methods, notably that of Joe McKean and Tom Hettmansperger, but I don't have the URL for their code at hand. I'll try to forward this from work next week. Jim
doerte.apelt at gmx.de
2009-Apr-24 13:42 UTC
[R] Interpreting the results of Friedman test
Hello, Peter Dalgaard wrote:> Not necessarily, but the first suspicion one gets is that what you're > doing with Friedman is not equivalent to what you're doing with ANOVA, > could you show us the code and data (or an outline of it)?Please find attached the R script and the data input files. The values in dataForFriedmanTest.dat represent the geometric mean of the values of three repetitions for one observer and one condition. Am I doing something wrong there? Thanks in advance Doerte PS: I'm not sure if it is possible to send the dat-files by mail. Therefore I renamed them to *.txt. Please rename back to *.dat. -------- Original-Nachricht --------> Datum: Fri, 24 Apr 2009 14:52:44 +0200 > Von: Peter Dalgaard <P.Dalgaard at biostat.ku.dk> > An: Doerte <doerte.apelt at gmx.de> > Betreff: Re: [R] Interpreting the results of Friedman test> Doerte wrote: > > Hello, > > > > I have problems interpreting the results of a Friedman test. It seems > > to me that the p-value resulting from a Friedman test and with it the > > "significance" has to be interpreted in another way than the p-value > > resulting from e.g. ANOVA? > > > > Let me describe the problem with some detail: I'm testing a lot of > > different hypotheses in my observer study and only for some the > > premises for performing an ANOVA are fulfilled (tested with Shapiro > > Wilk and Bartlett). For the others I perform a Friedman test. > > > > To my surprise, the p-value of the Friedman test is < 0.05 for all my > > tested hypotheses. Thus, I tried to "compare" the results with the > > results of an ANOVA by performing both test methods (Friedman, ANOVA) > > to a given set of data. > > While ANOVA results in p = 0.34445 (--> no significant difference > > between the groups), the Friedman test results in p = 1.913e-06 (--> > > significant difference between the groups?). > > > > How can this be? > > > > Or am I doing something wrong? I have three measured values for each > > condition. For ANOVA I use them all, for the Friedman test I > > calculated the geometric mean of the three values, since this test > > does not work with replicated values. Is this a crude mistake? > > Not necessarily, but the first suspicion one gets is that what you're > doing with Friedman is not equivalent to what you're doing with ANOVA, > could you show us the code and data (or an outline of it)? > > -- > O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B > c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K > (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 > ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907-- -------------- next part -------------- Observer | Condition | Repetition | AUC 2 | 1 | 2 | 11.6698729267 2 | 1 | 3 | 11.3614841831 2 | 1 | 1 | 11.6320875675 3 | 1 | 3 | 11.3813182648 3 | 1 | 2 | 11.9791654383 3 | 1 | 1 | 11.3193295274 4 | 1 | 3 | 11.6271912743 4 | 1 | 1 | 11.7277539642 4 | 1 | 2 | 11.3073525275 6 | 1 | 2 | 11.5356087785 6 | 1 | 3 | 11.8625252416 6 | 1 | 1 | 11.1631417327 7 | 1 | 1 | 12.0811987417 7 | 1 | 2 | 11.4253889199 7 | 1 | 3 | 11.1438163937 8 | 1 | 2 | 12.3351513361 8 | 1 | 1 | 11.0075952969 8 | 1 | 3 | 11.2701354076 1 | 1 | 2 | 11.9582160341 1 | 1 | 3 | 11.3128071894 1 | 1 | 1 | 11.4041971251 2 | 2 | 2 | 11.1937509173 2 | 2 | 1 | 11.6252278612 2 | 2 | 3 | 11.7113976885 3 | 2 | 3 | 11.1192253767 3 | 2 | 1 | 11.3755159053 3 | 2 | 2 | 12.0029900345 4 | 2 | 3 | 11.6105418939 4 | 2 | 2 | 11.4205387926 4 | 2 | 1 | 11.5200504433 6 | 2 | 2 | 11.3150843227 6 | 2 | 3 | 11.087942451 6 | 2 | 1 | 12.0640315424 7 | 2 | 1 | 11.6605537521 7 | 2 | 3 | 11.6189671844 7 | 2 | 2 | 11.2636316548 8 | 2 | 3 | 11.3865060588 8 | 2 | 2 | 12.1672455368 8 | 2 | 1 | 10.9692943665 1 | 2 | 3 | 11.4617141335 1 | 2 | 1 | 11.5455368466 1 | 2 | 2 | 11.5463396473 2 | 3 | 2 | 11.3473263733 2 | 3 | 1 | 11.7839556008 2 | 3 | 3 | 11.1316960504 3 | 3 | 3 | 11.8686526315 3 | 3 | 2 | 11.0739149317 3 | 3 | 1 | 11.403959013 4 | 3 | 1 | 11.5870552325 4 | 3 | 2 | 11.3401354648 4 | 3 | 3 | 11.3424292954 6 | 3 | 3 | 11.3615420894 6 | 3 | 1 | 11.4887245966 6 | 3 | 2 | 11.3741010608 7 | 3 | 2 | 11.3180993919 7 | 3 | 1 | 11.4960941843 7 | 3 | 3 | 11.454173957 8 | 3 | 3 | 11.2121329748 8 | 3 | 1 | 11.5712149501 8 | 3 | 2 | 11.4525667984 1 | 3 | 3 | 11.1470495671 1 | 3 | 1 | 11.3843720685 1 | 3 | 2 | 11.7803942389 2 | 4 | 1 | 11.7049906947 2 | 4 | 2 | 11.3104231298 2 | 4 | 3 | 11.6789580111 3 | 4 | 2 | 11.9600062087 3 | 4 | 3 | 11.2497720322 3 | 4 | 1 | 11.5070118114 4 | 4 | 3 | 11.6880141384 4 | 4 | 2 | 11.6823046979 4 | 4 | 1 | 11.3789895286 6 | 4 | 1 | 11.2340767853 6 | 4 | 3 | 12.0463303433 6 | 4 | 2 | 11.4281136904 7 | 4 | 2 | 11.9397313286 7 | 4 | 1 | 11.5816813225 7 | 4 | 3 | 11.2157780218 8 | 4 | 3 | 11.3649382115 8 | 4 | 1 | 11.7537482956 8 | 4 | 2 | 11.6151737679 1 | 4 | 2 | 11.8833021895 1 | 4 | 1 | 11.6774568059 1 | 4 | 3 | 11.218661679 -------------- next part -------------- 1 | 11.5549259143 | 11.5177949943 | 11.4343007933 | 11.5897878773 2 | 11.5536609678 | 11.5078788328 | 11.4177885112 | 11.5633767055 3 | 11.5561528638 | 11.4933075157 | 11.4442169793 | 11.5685580088 4 | 11.5527009607 | 11.516782224 | 11.4226218647 | 11.5821980029 5 | 11.5527009607 | 11.516782224 | 11.4226218647 | 11.5821980029 6 | 11.516876305 | 11.4815469835 | 11.4079793857 | 11.564376866 7 | 11.5435216828 | 11.5129966958 | 11.4225358663 | 11.5752893725 8 | 11.5236136682 | 11.4970692787 | 11.4109905276 | 11.5768318539
Hello again, it seems, the R script has been filtered from the previous posting. Thus, I include is as text here: dataForANOVA <- read.csv("C:/R/dataForANOVA.dat", sep="|", as.is=T, na.strings=".", header=TRUE) dataForFriedman <- read.csv("C:/R/dataForFriedmanTest.dat", sep="|", as.is=T, na.strings=".", header=FALSE) anova1 <- lm(AUC~as.factor(Condition),data=dataForANOVA) result_shapiro <- shapiro.test(anova1$residuals) result_bartlett <- bartlett.test(anova1$residuals~as.factor (Condition),data=dataForANOVA) summaryANOVA1 <- summary(anova1) anova1Results <- anova(lm(AUC~as.factor(Condition),data=dataForANOVA)) print(anova1Results) friedman.test(as.matrix(dataForFriedman))