A2WAY procedure
Performs analysis of variance of a balanced or unbalanced design with up to two treatment factors (R.W. Payne).
Options
Parameters
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:
The PSE option controls the types of standard errors that are produced to accompany the tables of means, with settings:
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:
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.