Tom La Bone
2007-Apr-16 10:05 UTC
[R] Difficulties Using glht.mmc to Calculate Tukey Intervals for Means
Greetings, In the following one-way ANOVA I am attempting to calculate the means of each treatment along with their 95% Tukey confidence intervals for the data shown below using a routine from the HH package. library(HH) options(digits=10) # load data treat voltage 1 130 1 74 1 155 1 180 2 150 2 159 2 188 2 126 3 138 3 168 3 110 3 160 4 34 4 80 4 40 4 75 5 136 5 106 5 122 5 115 6 174 6 150 6 120 6 139 7 20 7 82 7 70 7 58 8 25 8 58 8 70 8 45 9 96 9 82 9 104 9 60 treat <- factor(treat) fit <- aov(voltage ~ treat) summary(fit) fit.mmc <- glht.mmc(fit,linfct = mcp(treat = "Tukey")) fit.mmc The problem I am having is that the confidence intervals are different every time I run the glht.mmc routine. Is this behavior the result of something I am doing wrong? Thanks Tom La Bone [[alternative HTML version deleted]]
Richard M. Heiberger
2007-Apr-16 14:05 UTC
[R] Difficulties Using glht.mmc to Calculate Tukey Intervals for Means
The behavior you are seeing is part of the design of the summary.glht function in the multcomp package. There is some randomness in the adjustment for multiplicity. See library(multcomp) ?summary.glht ?adjusted
Maybe Matching Threads
- multcomp::glht() doesn't work for an incomplete factorial using aov()?
- Tukey HSD (or other post hoc tests) following repeated measures ANOVA
- Is using glht with "Tukey" for lme post-hoc comparisons an appropriate substitute to TukeyHSD?
- glht: Problem with symbolic contrast for factors with number-levels
- Tukey HSD plot with lines indicating (non-)significance