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.
contrast.obj:
The contrasts can be specified in two ways: a list together with coefficients, or a matrix. A single contrast is specified by a list of logical vectors, defining the cell means used 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:
Defines the contrast between cell means specified by contrast.obj when contrast.obj is a list. Coef must sum to zero, and be the same length of contrast.obj. The default value gives the standard error of the difference between the first and second cell means specified by contrast.obj (the first helmert contrast).
data:
The data frame (if any) used in fitting x.

VALUE:
A standard error for each contrast.

DETAILS:
A typical question in ANOVA models is whether contrasts of treatment means are "significant". This function returns the classical standard error of these contrasts, based on the residual sum of squares of the anova model.

In multistrata 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 (see eff.aovlist), and different standard errors are given when comparisons are made between and within strata (this is relevant for split plot designs, for instance).


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

SEE ALSO:
model.tables , contrasts .

EXAMPLES:
se.contrast(gun.aov, list(Team == "T1" & Physique== "S",
        Team=="T2",Physique=="S"), data = gun)
#for all pairwise contrasts between Physiques:
attach(gun)
cont <- cbind(Physique == "S", Physique == "A", Physique == "H")
contr.means <- cbind(c(1, -1, 0),contr.sum(levels(Physique)))/
        as.vector(table(Physique))
cont <- cont %*% contr.means
dimnames(cont)[[2]] <- paste(c("S","S","A"), "and",
        c("A","H","H"))
se.contrast(gun.aov, contrast=cont, data = NULL)