Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# st: Re: friedman test

 From "Joseph Coveney" To Subject st: Re: friedman test Date Wed, 30 Nov 2011 02:04:03 +0900

```Daniela Ferrante wrote:

I have a question about friedman test. I tried to perform the friedman test
with STATA, R software and SPSS but I get quite different p values with an
equal p value with R and SPSS but different from STATA results. I am wondering
why I get quite different results.
I attach the data:

0,005     0,005     0,005
0,005     0,005     0,005
0,005     0,005     4,47
0,005     0,005     12,56
0,005     0,005     0,005
0,005     0,005     0,005
0,1         0,2      1,46
0,005     0,005     0,005
0,005     0,005     0,005
0,005     0,005     0,005
0,005     0,005     0,005
0,005     0,005     0,005
0,005     0,005     0,005
0,005     0,005     0,005
0,005     0,005     0,005
0,005     0,005     0,005
0,005     0,005     0,005
0,005     0,005     0,005
0,005     0,005     0,005

Using this data I obtain p=0,69 using STATA software but p=0,06 using R and
SPSS software

--------------------------------------------------------------------------------

Try the user-written command -emh- for Friedman's test.  See below for your
particular problem, and see www.sfu.ca/sasdoc/sashtml/stat/chap28/sect41.htm for

You can install -emh- from SSC.

Joseph Coveney

. input double score1 double score2 double score3

score1      score2      score3
1. 0.005     0.005     0.005
2. 0.005     0.005     0.005
3. 0.005     0.005     4.47
4. 0.005     0.005     12.56
5. 0.005     0.005     0.005
6. 0.005     0.005     0.005
7. 0.1         0.2      1.46
8. 0.005     0.005     0.005
9. 0.005     0.005     0.005
10. 0.005     0.005     0.005
11. 0.005     0.005     0.005
12. 0.005     0.005     0.005
13. 0.005     0.005     0.005
14. 0.005     0.005     0.005
15. 0.005     0.005     0.005
16. 0.005     0.005     0.005
17. 0.005     0.005     0.005
18. 0.005     0.005     0.005
19. 0.005     0.005     0.005
20. end

.
. generate byte subject = _n

. quietly reshape long score, i(subject) j(time)

. emh score time, strata(subject) anova tr(rank)

Extended Mantel-Haenszel (Cochran-Mantel-Haenszel) Stratified Test of
Association

ANOVA (Row Mean Scores) Statistic:
Q (2) =  5.6000, P = 0.0608
Transformation: Ranks

.
. exit

end of do-file

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```

• References:
• st: friedman test
• From: "Daniela Ferrante (Lab. Statistica)" <daniela.ferrante@med.unipmn.it>