[R] Expected pairwise.student.t and TukeyHSD behavior?

Walmes Zeviani walmeszeviani at hotmail.com
Thu Mar 25 04:03:32 CET 2010


This is because pairwise.student.t and TukeyHSD use differents estimates for
error term. TukeyHSD use the parameters covariance matrix and t use sample
variance. In this case a treatment with only one value doesn't have sample
variance but has a estimated standard error in a covariance matrix. The
lines below will illustrate the point:

# toy data
da <- data.frame(A=factor(rep(c("a","b","c"), c(1,5,7))))
da$y <- rnorm(da$A)

# sample variance
tapply(da$y, da$A, var)
pairwise.t.test(da$y, da$A, p.adj="none") # problem!

# model and covariance matriz
m0 <- aov(y~A, da)
vcov(m0)
TukeyHSD(m0) # no problem!

Walmes.



-----
..ooo0
...................................................................................................
..(....)... 0ooo...                              Walmes Zeviani
...\..(.....(.....)...     Master in Statistics and Agricultural
Experimentation
....\_)..... )../....       walmeszeviani at hotmail.com, Lavras - MG, Brasil
............
(_/............................................................................................
-- 
View this message in context: http://n4.nabble.com/Expected-pairwise-student-t-and-TukeyHSD-behavior-tp1690100p1690136.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list