[R] Multiple Comparisons-Kruskal-Wallis-Test: kruskal{agricolae} and kruskalmc{pgirmess} don't yield the same results although they should do (?)
David L Carlson
dcarlson at tamu.edu
Fri Aug 3 18:49:13 CEST 2012
Generally multiple comparisons are conducted after a test for a significant
difference among any of the groups. For your data
> kruskal.test(x[,1]~x[,2])
Kruskal-Wallis rank sum test
data: x[, 1] by x[, 2]
Kruskal-Wallis chi-squared = 11.0098, df = 10, p-value = 0.3568
There are no significant differences between the groups, so there is no
reason to use a multiple comparison test.
----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of peter dalgaard
> Sent: Friday, August 03, 2012 5:59 AM
> To: greatest.possible.newbie
> Cc: r-help at r-project.org
> Subject: Re: [R] Multiple Comparisons-Kruskal-Wallis-Test:
> kruskal{agricolae} and kruskalmc{pgirmess} don't yield the same results
> although they should do (?)
>
>
> On Aug 3, 2012, at 11:33 , greatest.possible.newbie wrote:
>
> > Thank you for your answer.
> > The p.adj argument in the kruskal()-function doesn't seem to change
> > anything... Not even the "bonferroni"-method although it is described
> as the
> > most conservative one (multiplying all p-values with the number of
> > comparisons). I suppose the kruskal()-function is not working
> properly...
>
> Apparently, the grouping logic doesn't care about p.adj. Not the most
> fortunate design in my opinion, but try looking at the output with
> group=FALSE.
>
> > On the other hand I doubt the method behind the kruskalmc()-function
> as this
> > function doesn't even turn out to detect significant differences
> between the
> > grouping variable (which is obviously a severe error).
>
> That's not obvious! Did you check all group comparisons? How big are
> the groups?
>
> > Do you think it is justifiable to use the kruskal()-function without
> > p-adjustment, i.e. doing only pairwise tests like you can do with the
> > kruskal.test()-function although I obviously want to do multiple
> > comparisons?
> >
> > kruskal(x[,1],x[,2],p.adj="bonferroni")
> > #Yields exactely the same results.
> > #Groups, Treatments and mean of the ranks
> > #a 11 304.4
> > #ab 9 296
> > #ab 7 286.6
> > #ab 8 278.2
> > #ab 10 268.7
> > #ab 2 250.6
> > #ab 6 242.9
> > #ab 1 242.1
> > #ab 3 239.4
> > #ab 5 228.8
> > #b 4 219.5
> >
> >
> > kruskalmc(x[,2],x[,2])
> >
> > #Multiple comparison test after Kruskal-Wallis
> > #p.value: 0.05
> > #Comparisons
> > # obs.dif critical.dif difference
> > #[......]
> > #6-9 54.0 162.02688 FALSE
> > #6-10 69.5 159.04584 FALSE
> > #6-11 94.5 133.02196 FALSE
> > #7-8 18.0 160.00778 FALSE
> > #7-9 35.0 169.78370 FALSE
> > #7-10 50.5 166.94123 FALSE
> > #7-11 75.5 142.36796 FALSE
> > #8-9 17.0 165.54197 FALSE
> > #8-10 32.5 162.62538 FALSE
> > #8-11 57.5 137.28174 FALSE
> > #9-10 15.5 172.25281 FALSE
> > #9-11 40.5 148.56074 FALSE
> > #10-11 25.0 145.30369 FALSE
> >
>
> --
> Peter Dalgaard, Professor,
> Center for Statistics, Copenhagen Business School
> Solbjerg Plads 3, 2000 Frederiksberg, Denmark
> Phone: (+45)38153501
> Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list