[R] Multiple comparisons and letter assignments

Data Analytics Corp. dataanalytics at earthlink.net
Mon Feb 4 17:40:10 CET 2008


Good morning,

I'm trying to write a function to assign the mean separation grouping 
letters to the factors of an experiment.  A client wants this so I 
thought I'd write my own function for future use.  But I'm having 
trouble doing it because I don't understand the logic of the 
assignment.  As a general example, consider the following data and the 
results from SAS and its weak cousin, JMP:


The data:
=======
Strain  Nitrogen
3DOK1    19.40
3DOK1    32.60
3DOK1    27.00
3DOK1    32.10
3DOK1    33.00
3DOK5    17.70
3DOK5    24.80
3DOK5    27.90
3DOK5    25.20
3DOK5    24.30
3DOK4    17.00
3DOK4    19.40
3DOK4    9.10
3DOK4    11.90
3DOK4    15.80
3DOK7    20.70
3DOK7    21.00
3DOK7    20.50
3DOK7    18.80
3DOK7    18.60
3DOK13    14.30
3DOK13    14.40
3DOK13    11.80
3DOK13    11.60
3DOK13    14.20
COMPOS    17.30
COMPOS    19.40
COMPOS    19.10
COMPOS    16.90
COMPOS    20.80

Results from SAS:

Tukey Grouping          Mean      N    Strain
                  A           28.820      5    3DOK1
          B     A           23.980      5    3DOK5
          B     C          19.920      5    3DOK7
          B     C          18.700      5    COMPOS
                 C           14.640      5    3DOK4
                 C           13.260      5    3DOK13
 From JMP:

3DOK1    A            28.82
3DOK5    A    B        23.98
3DOK7        B    C    19.92
COMPOS        B    C    18.7
3DOK4            C    14.64
3DOK13            C    13.26

The results are the same as they should be.  What I don't understand is 
why only letters A-C?  Why not D and E also since each of five Strains 
appears in the first position of the 15 pairs?

Does anyone have a function to do this?

Thanks,

Walt Paczkowski



More information about the R-help mailing list