4/9/03 5:26 PM
File = E:\r\fns\aov.contrast doc.doc
Department of Psychology, Box 351525, University of Washington, Seattle, WA 98195
April 9, 2003
Documentation for the 'aov.contrast' Function
This documentation has four sections.
Section I presents documentation in the standard R-Help format.
It is probably more useful for people who are experienced users of R.
Section II has a more discursive
explanation of the aov.contrast function that is probably more useful to more inexperienced users of R.
Section III has examples that use 'aov.contrast' in the context of an analysis of covariance.
shows the R code for the 'aov.contrast' function.
Section I: R documentation for the 'aov.contrast' function
Computes t-tests, confidence intervals, and other statistics for user-defined contrasts (linear combinations
of cell means) in a between-subjects analysis of variance (completely randomized design).
aov.contrast <- function(lm.input, margin=1, contrast.list, strata=NA,
Confidence.Level = .95, var.equal=TRUE, show.cellcode=TRUE, p.digits=6)
A 'lm' or 'aov' object, i.e., the output of a call to 'lm' or 'aov'.
A vector of positive integers that indicate the factor or factors over whose levels the
contrast is defined.
The factors are listed in the same order as in the 'formula'
argument of the call to 'aov'.
For example, if the 'Y ~ A1*A2*A3' is the formula in
the call to 'aov', then 'margin=3' indicates that the contrast coefficients apply to the
levels of the 'A3' factor.
A list of numeric vectors.
Each vector indicates the contrast coefficients for the
marginal means specified by 'margin'.
All vectors must have the same length as the
number of marginal means determined by 'margin'.
If 'strata' is non-missing, it must be a vector of integers indicating the factor or
factors that play the role of strata.
Each contrast is computed within every fixed level
of the stratifying factors.
Level of confidence for the confidence intervals.
If var.equal = TRUE if and only if homogeneity of variance is assumed in the test of
The default is var.equal = TRUE.
When margin specifies more than one factor, e.g., 'margin = c(2, 3)', the contrast
coefficients define a linear combination with respect to all combinations of factors 2
If factor 2 has k levels and factor 3 has m levels, there are k*m combinations
If 'show.cellcode = TRUE', then the output displays the correspondence
between the sequence of coefficients specified through 'contrast.list' and the k*m
levels of factors 2 and 3.