[R] Multiple Comparisons-Kruskal-Wallis-Test: kruskal{agricolae} and kruskalmc{pgirmess} don't yield the same results although they should do (?)

peter dalgaard pdalgd at gmail.com
Fri Aug 3 12:59:26 CEST 2012


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



More information about the R-help mailing list