Skip to content

Interpreting the results of Friedman test

5 messages · doerte.apelt at gmx.de, Peter Dalgaard, Doerte

#
Hello,
Peter Dalgaard wrote:
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 --------

  
    
#
doerte.apelt at gmx.de wrote:
The .R file came as BIN file to me, so r-help may be missing it.

Anyways, Friedman's test is a replacement for a two-way ANOVA and you
are comparing it to a one-way analysis, and the latter is likely just wrong.

Try

anova(lm(AUC~as.factor(Condition)+as.factor(Observer),data=dataForANOVA))

or, maybe better

summary(aov(AUC ~ as.factor(Condition) + Error(as.factor(Observer) /
as.factor(Condition)),  data=dataForANOVA))

  
    
#
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))
#
Okay. Thanks for the hint.
This results in p-value = 0.37969. This value is still quite different
from p-value = 1.913e-06, which is the result of friedman.test
(as.matrix(dataForFriedman)).

Is the method friedman.test (version R 2.9.0) working correctly for
certain types of data and hypotheses? Which limitations are known?

@ Jim: Thanks for the link.
Unfortunately, I'm a newbie in statistics, and I'm not sure, which
method can be used instead of the Friedman Test. Do you have an eye on
a certain R-program from this given website?

Doerte
#
Doerte wrote:
If you had read ALL that I wrote, then you would have seen this:
+ as.factor(Condition)),  data=dataForANOVA))

Error: as.factor(Observer)
          Df    Sum Sq   Mean Sq F value Pr(>F)
Residuals  6 0.0066907 0.0011151

Error: as.factor(Observer):as.factor(Condition)
                     Df   Sum Sq  Mean Sq F value    Pr(>F)
as.factor(Condition)  3 0.275825 0.091942  405.23 < 2.2e-16 ***
Residuals            18 0.004084 0.000227
---
Signif. codes:  0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1

Error: Within
          Df Sum Sq Mean Sq F value Pr(>F)
Residuals 56 6.5337  0.1167


I.e. the thing that is going on is that the Observer:Condition
interaction is incredibly small (0.000227) compared to the replication
variation (0.1167), or put differently that you seem to have strong
negative correlation between replicates. This can happen if you have
things like plants growing in the same pot, but you need to consider
what could be happening in your case.

Looking at the table of means
1        2        3        4
1 11.55841 11.51786 11.43727 11.59314
2 11.55448 11.51013 11.42099 11.56479
3 11.55994 11.49924 11.44884 11.57226
4 11.55410 11.51704 11.42321 11.58310
6 11.52043 11.48902 11.40812 11.56951
7 11.55013 11.51438 11.42279 11.57906
8 11.53763 11.50768 11.41197 11.57795

this is essentially the same as your dataForFriedman and it is pretty
clear that the 3rd column is substantially below the others, which is
what the Friedman test and also the F value of 405.23 above is picking
up on.