[R] kruskalmc, significant differences while median values are the same

Omphalodes Verna omphalodes.verna at yahoo.com
Mon Dec 17 07:51:02 CET 2012

Thank for help!

My ''problem'' is a little bit complicated. I have a dataset of trees (five tree species) and I need to calculate if there are the significant differences in the period of suppressed growth among tree species (length in years, e.g. 1, 2, 3, 6, 10, 50, 80, etc.). Because data are not normally distributed (Levene test), my idea was to use kruskalmc test. 
So, my question is, how to evaluate the differences in the duration of suppressed growth among groups? Is ''bootstrap confidence interval'' for each tree species right solution? 

thanks, OV

From: Thomas Lumley <tlumley at uw.edu>
To: Omphalodes Verna <omphalodes.verna at yahoo.com> 
Cc: R Help <r-help at r-project.org> 
Sent: Sunday, December 16, 2012 11:59 PM
Subject: Re: [R] kruskalmc, significant differences while median values are the same

On Sat, Dec 15, 2012 at 10:04 PM, Omphalodes Verna <omphalodes.verna at yahoo.com> wrote:

Dear list!
>I work with multiple Kruskal-Wallis test (kruskalmc, package pgirmess), which evaluates differences in medians among groups (5 groups). A result of a test is significant differences among some groups, while median values are the same for 4 groups (using tapply). Why?

The Kruskal-Wallis test *doesn't* evaluate differences in medians, so there is quite likely nothing wrong in a formal sense.

However, this does suggest that your groups may not be stochastically ordered, which means the results of the Kruskal-Wallis test could be quite misleading.  I'd suggest that you at least look at pairwise Wilcoxon tests to make sure the direction agrees with what the Kruskal-Wallis test implies. Box plots might also be a good idea. 

Or, if you really want differences in medians, look at differences in medians. A permutation test or a bootstrap confidence interval is probably the best way to do this.


Thomas Lumley
Professor of Biostatistics
University of Auckland     

More information about the R-help mailing list