A2WAY procedure

Performs analysis of variance of a balanced or unbalanced design with up to two treatment factors (R.W. Payne).


Options

PRINT = strings
Controls printed output from the analysis (aovtable, information, covariates, effects, residuals, means, %cv, missingvalues); default aovt, mean

TREATMENTS = factors
Defines either one or two treatment factors

BLOCKS = factor
Can specify a blocking factor e.g. for a randomized block design

COVARIATES = variates
Specifies any covariates

FACTORIAL = scalar
Can be set to 1 to fit only the main effects of the treatments factors; default 2 also fits their interaction

FPROBABILITY = string
Probabilities for variance ratio (yes, no); default no

PLOT = strings
Which residual plots to provide (fittedvalues, normal, halfnormal, histogram, absresidual); default fitt, norm, half, hist

GRAPHICS = string
Type of graphs (lineprinter, highresolution); default high

COMBINATIONS = string
Factor combinations for which to form predicted means ( present, estimable); default esti

ADJUSTMENT = string
Type of adjustment to be made when predicting means (marginal, equal, observed); default marg

PSE = strings
Types of standard errors to be printed with the means (differences, lsd, means, alldifferences, alllsd); default diff

LSDLEVEL = scalar
Significance level (%) for least significant differences; default 5

RMETHOD = string
Type of residuals to save or display (simple, standardized); default simp

EXIT = scalar
Saves an exit code indicating the properties of the design


Parameters

Y = variates
Each of these contains the data values for an analysis

RESIDUALS = variates
Saves the residuals from each analysis

FITTEDVALUES = variates
Saves the fitted values from each analysis

SAVE = pointers
Save structure for each analysis (to use in A2DISPLAY or A2KEEP)


Description

A2WAY provides specialized facilities for analysis of variance with either one or two treatment factors. There can also be a blocking factor. It automatically determines the type of design and uses the appropriate method: the ANOVA directive if the design is balanced, or the regression directives (FIT, ADD and so on) if it is unbalanced. So, for example, it can analyse randomized complete block designs with one or two treatment factors, or unbalanced two-way treatment structures with or without blocking, or designs with a single treatment factor whose levels are allocated unevenly across the blocks. Any units with missing values are excluded from the analysis. Conversely, in ANOVA, they need to be included to ensure balance in the more general situations that it covers, and are estimated as part of the analysis.

   The output is also customized. For example, if the treatments have unequal replication, a standard error is printed for each mean, rather than the summary for comparisons of means with minimum and maximum replication as given by ANOVA. Similarly, the two-way analyses show the sums of squares for the main effects both omitting and ignoring the other main effect. In addition, A2WAY provides residual plots directly, instead of requiring you to use procedure APLOT after the analysis.

   The Y parameter supplies a variate containing the data values to be analysed. The RESIDUALS parameter can save the residuals from the analysis, and the FITTEDVALUES parameter can save the fitted values. The RMETHOD option controls whether simple or standardized residuals are saved or displayed; by default RMETHOD=simple.

   The SAVE parameter can save a "save" structure that can be used as input to procedure A2DISPLAY to produce further output, or to procedure A2KEEP to copy output into GenStat data structures.

   The treatment factor or factors are specified by the TREATMENTS option, and the BLOCKS option can be used to supply a blocking factor. Covariates can be supplied using the COVARIATES option. As in ANOVA, the FACTORIAL option sets a limit in the number of factors in each treatment term. So you can set FACTORIAL=1 to fit only the main effects when there are two treatment factors; the default FACTORIAL=2 also fits their interaction.

   Printed output is controlled by the PRINT option, with settings:

    aovtable
analysis-of-variance table (probabilities are given for the variance ratios if option FPROBABILITY=yes);

    information
information about the design (non-orthogonality &c);

    covariates
covariate regression coefficients);

    effects
treatment parameters in the linear model;

    means
table of means;

    %cv
to print the coefficient of variation;

    missingvalues
to print estimates for any missing values.

   The PSE option controls the types of standard errors that are produced to accompany the tables of means, with settings:

    differences
summary of standard errors for differences between pairs of means;

    alldifferences
standard errors for differences between all pairs of means (unbalanced designs only);

    lsd
summary of least significant differences between pairs of means;

    alllsd
least significant differences between all pairs of means (unbalanced designs only);

    means
standard errors of the means - for unbalanced designs, these are approximate effective standard errors formed by procedure SED2ESE with the aim of allowing good approximations to the standard errors for differences to be calculated by the usual formula of sedij = √(esei2 + esej2)

The default is differences. The LSDLEVEL option sets the significance level

(as a percentage) for the least significant differences.

   For unbalanced designs, analysed using GenStat regression, the means are produced using the PREDICT directive. The first step (A) of the calculation forms the full table of predictions, classified by all the treatment and blocking factors. The second step (B) averages the full table of over the factors that do not occur in the table of means. The COMBINATIONS option specifies which cells of the full table are to be formed in Step A. The default setting, estimable, fills in all the cells other than those that involve parameters that cannot be estimated. Alternatively, setting COMBINATIONS=present excludes the cells for factor combinations that do not occur in the data. The ADJUSTMENT option then defines how the averaging is done in Step B. The default setting, marginal, forms a table of marginal weights for each factor, containing the proportion of observations with each of its levels; the full table of weights is then formed from the product of the marginal tables. The setting equal weights all the combinations equally. Finally, the setting observed uses the WEIGHTS option of PREDICT to weight each factor combination according to its own individual replication in the data.

   The PLOT option allows up to four of the following residual plots to be requested:

    fittedvalues
for a plot of residuals against fitted values;

    normal
for a Normal plot;

    halfnormal
for a half-Normal plot;

    histogram
for a histogram of residuals; and

    absresidual
for a plot of the absolute values of the residuals against the fitted values.

By default the first four are produced. The GRAPHICS option determines the type of graphics that is used, with settings highresolution (the default) and lineprinter.

   The RMETHOD option controls whether simple or standardized residuals are printed or plotted; by default RMETHOD=simple.

   The EXIT option can save an exit code indicating how the analysis was done. For the exact meanings of the values see the ANOVA directive. Essentially, it has the values 0 or 1 if the analysis has been done using ANOVA (0 if design orthogonal and 1 if it is balanced). Other values indicate that it has been done using the regression directives.

 

Options: PRINT, TREATMENTS, BLOCKS, COVARIATES, FACTORIAL, FPROBABILITY, PLOT, GRAPHICS, COMBINATIONS, ADJUSTMENT, PSE, LSDLEVEL, RMETHOD, EXIT.

Parameters: Y, RESIDUALS, FITTEDVALUES, SAVE.


Method

The EXIT option of the ANOVA directive is used to determine whether or not the design is unbalanced (and thus whether the GenStat regression facilities need to be used rather than the analysis of variance facilities).


Action with RESTRICT

If the Y variate is restricted, only the units not excluded by the restriction will be analysed.