I have an experiment that is unbalanced where at three sites (L, M, H) we measure a parameter (met) in four different vegetation types (a, b, c, d). All vegetation types are present at all three sites. Vegetation types are replicated 4 times at L and M and 8 times at H.
Therefore a simple anova and TukeyHSD will not work. Packages Agricolae (HSD.test) and DTK (DTK.test) are only working for one way designs, and then there is multcomp... Does the Tukey test in the mcp function calculate Tukey-Kramer contrasts, or does it give the regular Tukey contrasts? I presume the first to be the case because the package is geared towards testing multiple comparisons for unbalanced designs, but I am unsure because p-values produced with both approaches are virtually the same. What test would then be appropriate?
Also, are there more suitable approaches towards doing such a two way anova for unbalanced data sets?
library(multcomp)
(met <- c(rnorm(16,6,2),rnorm(16,5,2),rnorm(32,4,2)))
(site <- c(rep("L", 16), rep("M", 16), rep("H", 32)))
(vtype <- c(rep(letters[1:4], 16), rep(letters[1:4], 16), rep(letters[1:4], 32)))
dat <- data.frame(site, vtype, met)
# using aov and TukeyHSD
aov.000 <- aov(met ~ site * vtype, data=dat)
summary(aov.000)
TukeyHSD(aov.000)
# using Anova, and multcomp
lm.000 <- lm(met ~ site * vtype, data=dat)
summary(lm.000)
library(car)
Anova.000 <- Anova(lm.000, data=dat)
dat$int <- with(dat, interaction(site, vtype, sep = "x"))
lm.000 <- lm(met ~ int, data = dat)
summary(lm.000)
summary(glht.000 <- glht(lm.000, linfct = mcp(int = "Tukey")))