[R] TukeyHSD

C-G Pettersson Carl-Goran.Pettersson at evp.slu.se
Fri Jan 31 15:50:03 CET 2003


Hello everybody!
I´m working with a dataset from eleven field trails on barley 
fertilization. I use R 1.6.2 (Windows)

It is quite easy to fit aov() objects to the dataset.
The call:

 > (l1t4y.aov <- aov(Yield ~ Trial + Treatment, data=led1t4b))
Results in an object with this anova table:

              Df    Sum Sq   Mean Sq F value    Pr(>F)
Trial        10 121423585  12142358  63.499 < 2.2e-16 ***
Treatment     3  15252804   5084268  26.589 3.288e-13 ***
Residuals   118  22564015    191220

which is in line with what I know about the data.

When I then try to look at the treatment contrasts with an approach as near 
as possible to pp178-181 in MASS, the following happens:

 > (l1t4y.tk <- TukeyHSD(l1t4y.aov, which = "Treatment"))
Error in replications(paste("~", paste(names(tables), collapse = "+")),  :
         na.action must be a function

What have I done wrong, and what does the error message mean? There are no 
empty cells in the "Treatment" column. The TukeyHSD call works fine with 
the "immer" and "oats" datasets from MASS.

/CG




CG Pettersson, MSc, PhD-stud
Department of Ecology and Crop Production Science, SLU
P.O. Box 7043
S-750 07 Uppsala, Sweden
Phone: +46 (0)18 67 12 24; Fax: +46 (0)18 67 29 06
        +46 (0)70 330 66 85




More information about the R-help mailing list