se.contrast.aov
Standard Errors for Contrasts between Means

Description

Calculates the standard error of a specified contrast or matrix of contrasts for an anova object.

Usage

# Generic function
se.contrast(object, ...)
## S3 method for class 'aov':
se.contrast(object, contrast.obj,
    coef = contr.helmert(ncol(contrast))[, 1L], data = NULL,
    ...)
## S3 method for class 'aovlist':
se.contrast(object, contrast.obj,
    coef = contr.helmert(ncol(contrast))[, 1L], data = NULL,
    ...) 				

Arguments

object an object of class "aov", "aovlist", or an object that inherits from one of these classes.
contrast.obj an object that determines the contrasts. The contrasts can be specified as either a list together with coefficients or a matrix. A single contrast is specified by a list of logical vectors that indicate the cell means to use in the contrast. The coef vector specifies the contrast between the cell means. Multiple contrasts are specified in a matrix where each column of the matrix defines a contrast.
coef an expression that defines the contrast between the cell means specified by contrast.obj when it is a list. The coef values must sum to zero and have the same length as contrast.obj. The default value gives the standard error of the difference between the first and second cell means specified by contrast.obj (i.e., the first helmert contrast).
data data frame in which to fit object. This is an optional argument.
... other optional arguments pass to or from the function.

Details

A typical question in ANOVA models is whether contrasts of treatment means are significant. The se.contrast function returns the classical standard error of these contrasts, based on the residual sum of squares of the anova model.
In multi-strata models, the means are assumed to be computed from the lowest stratum where an effect appears. The standard errors of the contrasts are adjusted for efficiencies, and different standard errors are given when comparisons are made between and within strata. This is relevant, for instance, in split plot designs. For more details on efficiencies, see eff.aovlist.
se.contrast is a generic function and has no default method. Two hidden methods for class aov and aovlist are implemented. The direct calling of se.contrast.aov or se.contrast.aovlist is invalid.
Value
returns a vector of standard errors for each contrast. Names are returned when possible.
References
Cochran, W. G., and Cox, G. M. 1957. Experimental Designs. New York, NY: John Wiley & Sons.
See Also
model.tables, contrasts, multicomp, eff.aovlist.
Examples
# "gun" is a dataset from the package Sdatasets.
gun.aov <- aov(Rounds ~ Method + Physique/Team, data = Sdatasets::gun)
se.contrast(gun.aov, list(Team == "T1" & Physique == "S",
	Team == "T2" & Physique == "S"), data = Sdatasets::gun)

# For all pairwise contrasts between Physiques: PhysiqueS <- with(Sdatasets::gun, (Physique == "S")/sum(Physique == "S")) PhysiqueA <- with(Sdatasets::gun, (Physique == "A")/sum(Physique == "A")) PhysiqueH <- with(Sdatasets::gun, (Physique == "H")/sum(Physique == "H")) cont <- cbind(PhysiqueS - PhysiqueA, PhysiqueS - PhysiqueH, PhysiqueA - PhysiqueH) dimnames(cont)[[2]] <- paste(c("S", "S", "A"), "and", c("A", "H", "H")) se.contrast(gun.aov, contrast = cont)

Package stats version 6.1.1-7
Package Index