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:
A 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; "residuals" for tables of residuals. The names can be abbreviated (one character is enough).
se:
a logical value indicating whether standard errors should be computed for the tables. If TRUE, a component se is returned, containing standard error information for each table. The form of standard error 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. For "effects" and "means" the design must be balanced. Standard errors for unbalanced designs can be computed for contrasts of interest using se.contrast.
cterms:
A character vector giving the names of the terms you want tables to be computed for. By default tables for all terms in the model are computed.

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

DETAILS:
Effects are defined by the hierarchy of the model: the effects are average reponses 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 level 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 that interaction between two different levels.

Standard errors for differences of means (sed's) can be complex for multistratum anova (objects of class aovlist), even in the balanced case, as 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 sed's apply, a vector of sed's are returned, labelled accordingly.

Treatment effects are sometimes computed in more than one stratum, with different efficiencies (see eff.aovlist). In this case results are only returned 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.

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

The result is printed by the function print.model.tables.aov This function is a method for the generic function model.tables for class "aov(aovlist)". It can be invoked by calling model.tables for an object of the appropriate class, or directly by calling model.tables.aov(aovlist) regardless of the class of the object.


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

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


SEE ALSO:
model.tables , eff.aovlist , aov , proj , se.contrast .

EXAMPLES:
gun.aov <- aov(Rounds ~ Method + Team %in% Physique, data = gun)
model.tables(gun.aov, type="means", se=T)
        #tables of means, replication 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, replication and standard errors for gun.aov
model.tables(guayule.aov, type= "eff", se=T)