[R] Question on TukeyHSD

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Aug 19 22:35:42 CEST 2004


On Thu, 19 Aug 2004, Hem Nalini Morzaria-Luna wrote:

> Hi,
> 	I am running a ANOVA on a factorial design, and using TukeyHSD
> for post hoc comparisons. I have 2 factors with three levels each:
> 		Factor B
> Factor A    1   2   3
> 	1
> 	2
> 	3
> 
> 
> When I look at the Tukey output (on the interaction of the factors) the
> comparisons come out numbered 1-36. 

Rather, they come out as unlabelled and this is a print of a matrix 
without rownames.

> e.g.
> $"A:B"
>              diff         lwr      upr
> [1,]  49.1666667 -160.041022 258.3744
> [2,]  50.0000000 -159.207689 259.2077
> ....
> 
> [35,]  84.3333333 -124.874355 293.5410
> [36,]  57.6666667 -151.541022 266.8744
> 
> Does anyone know how the function numbers the comparisons 

It doesn't.   However, this is standard R order, that is down columns
(1:1, 2:1, 3:1 etc).

> or an easy way of figuring out the order without having to go back and
> calculate the means between each pair and then going back to compare
> them with the output?

It should be easy to add labels for the next release.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list