Tables of Means and Effects for ANOVA Models

DESCRIPTION:

Returns tables of means, effects, factorial effects, or residuals for an ANOVA model. Information on replication is also returned. Optionally, standard errors can be computed for balanced designs.

USAGE:

model.tables.aov(aov.object, type="effects", se=F, cterms) 
model.tables.aovlist(aov.object, type="effects", se=F) 

REQUIRED ARGUMENTS:

aov.object
an aov object, or any object that inherits from class "aov" or "aovlist".

OPTIONAL ARGUMENTS:

type
character string specifying the type of tables desired. Choices are: "effects" for tables of marginal effects for each term in the model; "feffects" for effects for factorial (2^k) models; "means" for tables of fitted means; and "residuals" for tables of residuals. The names can be abbreviated: only enough of a string to uniquely identify it is required.
se
logical value: should standard errors be computed for the tables? If se=TRUE, a component named se is returned that contains standard error information for each table. The form of the standard errors returned is determined by the type of table requested. If type="effects", standard errors for individual effects are returned. If type="means", standard errors for the difference of two means are returned. If type="residuals", standard errors for residuals are returned. When type="effects" or type="means", the design must be balanced for standard errors to be computed. Standard errors for unbalanced designs can be computed for contrasts of interest using the function se.contrast. By default, se=FALSE.
cterms
character vector giving the names of the terms that tables should be computed for. By default, tables for all terms in the model are computed.

VALUE:

an object of class "tables.aov" with the following components:
tables
a list of tables, one for each model term.
n
a list corresponding to the tables component, giving the replication factor for each table element (i.e. the number of observations contributing to each element of the table). If type="residuals", then n is the degrees of freedom.
se
a list corresponding to the tables component, giving standard error information for the tables. This is returned only when se=T.

DETAILS:

Effects are defined by the hierarchy of the model: the effects are average responses due to the given treatment combinations, having adjusted for all higher order model terms. For instance, the interaction effects are changes in response after adjusting for the grand mean and both main effects. The effects sum to zero in the balanced case.

Factorial effects are specific to 2^k models, where effects are conventionally defined as the difference between the upper and lower levels of a factor. We follow the convention used in Box, Hunter and Hunter (1978) for scaling of higher order interactions: all the factorial effects are on the same scale, and represent the average difference due to the interaction between two different levels.

Standard errors for differences of means (or SEDs) can be complex for multistratum anova (objects of class "aovlist"), even in the balanced case. This is because the standard error depends on the shared main effects of the means. For instance, different standard errors can apply for comparisons of means within the same stratum, as opposed to between different strata. Where different SEDs apply, a vector of SEDs are returned and labeled accordingly.

Treatment effects are sometimes computed in more than one stratum, with different efficiencies (see the help file for eff.aovlist). In this case, results are returned only for the most efficient strata, usually the lowest. No attempt is made to recombine information about effects estimated in different strata. Effects, means, and standard errors are based on results that have been rescaled by their relative efficiency.

To construct the tables, model.tables uses proj(aov.object), together with the auxiliary information returned with the projection. Hence, it is a good idea to use qr=T when fitting the aov model.

These functions are methods for the generic function for the classes "aov" and "aovlist". They can be invoked by calling for an object of the appropriate class, or by calling model.tables.aov (or model.tables.aovlist) directly, regardless of the class of the object.

REFERENCES:

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

Box, G.E.P., Hunter, W.G., and Hunter, J.S. (1978). Statistics for Experimenters. New York: Wiley.

Searle, S.R. (1987). Linear Models for Unbalanced Data. New York: Wiley.

SEE ALSO:

, , , , .

EXAMPLES:

gun.aov <- aov(Rounds ~ Method + Team %in% Physique, data = gun) 
model.tables(gun.aov, type = "means", se = T) 
        # tables of means, replications, and standard errors 
        # of differences for gun.aov  
model.tables(gun.aov, type = "means", cterms = "Method") 
guayule.aov <- aov(plants ~ variety * treatment + Error(reps + flats), 
        data = guayule) 
model.tables(guayule.aov, type = "eff", se = T) 
        # tables of effects, replications, and standard errors 
        # for guayule.aov