Standard Errors for Contrasts between Means

DESCRIPTION:

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

USAGE:

se.contrast.aov(object, contrast.obj, 
                coef=contr.helmert(ncol(contrast))[, 1], data=NULL) 
se.contrast.aovlist(object, contrast.obj, 
                coef=contr.helmert(ncol(contrast))[, 1], data=NULL) 

REQUIRED ARGUMENTS:

object
an object of class "aov" or "aovlist", or one that inherits from these classes.
contrast.obj
an object that determines the contrasts. The contrasts can be specified in one of two ways: 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 the matrix form; each column of the matrix defines a contrast.

OPTIONAL ARGUMENTS:

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
the data frame (if any) used to fit object.

VALUE:

a standard error for each contrast.

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 in split plot designs, for instance. For more details on efficiencies, see the help file for eff.aovlist.

REFERENCES:

Cochran, W.G., Cox, G.M. (1957). Experimental Designs. New York: Wiley.

SEE ALSO:

, , , .

EXAMPLES:

gun.aov <- aov(Rounds ~ Method + Physique/Team, data = gun)
se.contrast(gun.aov, list(Team == "T1" & Physique == "S", 
        Team == "T2" & Physique == "S"), data = gun) 

# For all pairwise contrasts between Physiques: 
attach(gun) 
PhysiqueS <- (Physique == "S")/sum(Physique == "S")
PhysiqueA <- (Physique == "A")/sum(Physique == "A")
PhysiqueH <- (Physique == "H")/sum(Physique == "H")
detach("gun")
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)