[R] mood.test/mood.medtest

Leemann, Lucas T l.leemann at essex.ac.uk
Wed Mar 15 16:32:39 CET 2017


I was trying to test whether two medians are identical or not and used the function “mood.test” from the “stats" package. My co-author, a medical doctor, was trying to do the same in SPSS and had different results. 

I wanted to see whether there was a problem on my end and also used the function “mood.medtest” from the “RVAideMemoire” package. I find different results while I am under the impression that both functions claim to carry out the same test and have the same defaults. While my actual data is sensitive medical information, I provide simple code below for a reproducible example. 

a <- runif(100)
b <- runif(120,0.2,1.1)
indicator <- c(rep(0,100),rep(1,120))
x <- c(a,b)
mood.test(x ~ indicator)
mood.medtest(x ~ indicator)

Has anybody encounter this problem before or would be able to provide any insights?

Best wishes,

More information about the R-help mailing list