Extension of glht from the multcomp package to handle Fisher family-wise error and Bonferroni testing. Create a set of confidence intervals on the differences between the means of the levels of a factor with the specified family-wise probability of coverage. The intervals are based on the Studentized range statistic, Tukey's ‘Honest Significant Difference’ method, Fisher's family-wise error, or Bonferroni testing.
simple.glht(mod, effect, corr = c("Tukey","Bonferroni","Fisher"),
level = 0.95, df = NULL, ...)
An object of classes "simple.glht"
, "summary.glht"
and "glht"
containing information to produce confidence intervals,
tests and plotting.
There are print
, plot
and cld
methods for class
"simple.glht"
.
The plot
method does not accept
xlab
, ylab
or main
arguments and creates its own
values for each plot.
A character vector giving the term of the fitted model for which the intervals should be calculated. This can also be an interaction.
A character vector giving the multiple testing correction
method. Defaults to Tukey
.
A numeric value between zero and one giving the family-wise confidence level to use.
User supplied number of degrees of freedom. If not supplied or NULL, the default is to extract these from the model.
Optional additional arguments. None are used at present.
Douglas Bates, extended to mixed effect models by Kristian Hovde Liland.
When comparing the means for the levels of a factor in an analysis of variance, a simple comparison using t-tests will inflate the probability of declaring a significant difference when it is not in fact present. This because the intervals are calculated with a given coverage probability for each interval but the interpretation of the coverage is usually with respect to the entire family of intervals.
John Tukey introduced intervals based on the range of the sample means rather than the individual differences. The intervals returned by this function are based on this Studentized range statistics.
The intervals constructed in this way would only apply exactly to balanced designs where there are the same number of observations made at each level of the factor. This function incorporates an adjustment for sample size that produces sensible intervals for mildly unbalanced designs.
If which
specifies non-factor terms these will be dropped with
a warning: if no terms are left this is a an error.
Miller, R. G. (1981) Simultaneous Statistical Inference. Springer.
Yandell, B. S. (1997) Practical Data Analysis for Designed Experiments. Chapman & Hall.
aov
, qtukey
, model.tables
,
glht
in package multcomp.
require(graphics)
summary(fm1 <- lm(breaks ~ wool + tension, data = warpbreaks))
simple.glht(fm1, "tension")
plot(simple.glht(fm1, "tension"))
cld(simple.glht(fm1, "tension"))
Run the code above in your browser using DataLab