Learn R Programming

mixlm (version 1.4.0)

simple.glht: Pairwise comparison with multiple testing compensation.

Description

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.

Usage

simple.glht(mod, effect, corr = c("Tukey","Bonferroni","Fisher"),
	level = 0.95, df = NULL, ...)

Value

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.

Arguments

mod

A fitted model object, usually an lm or glm fit.

effect

A character vector giving the term of the fitted model for which the intervals should be calculated. This can also be an interaction.

corr

A character vector giving the multiple testing correction method. Defaults to Tukey.

level

A numeric value between zero and one giving the family-wise confidence level to use.

df

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.

Author

Douglas Bates, extended to mixed effect models by Kristian Hovde Liland.

Details

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.

References

Miller, R. G. (1981) Simultaneous Statistical Inference. Springer.

Yandell, B. S. (1997) Practical Data Analysis for Designed Experiments. Chapman & Hall.

See Also

aov, qtukey, model.tables, glht in package multcomp.

Examples

Run this code
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