1. Home
  2. AN1ADVICE procedure

AN1ADVICE procedure

Aims to give useful advice if a design that is thought to be balanced fails to be analysed by ANOVA (R.W. Payne).


PRINT = string tokens Controls printed output (advice, suspects); default advi
FACTORIAL = scalar Limit on number of factors in a treatment term; default 3
METHOD = string tokens Method to use to predict the correct pattern of replication (median, mode, proportional); default mode
WEIGHTS = variate Weights for the analysis; default * i.e. all units have weight one
SUSPECTS = variate Saves the numbers of the units whose factor values are suspected to be incorrect


Y = variates Data values to be analysed (this is needed only if the analysis is to take place on a restricted set of units)


The ANOVA directive analyses “balanced” designs. These include most of the commonly occurring experimental designs such as randomized blocks, Latin squares, split plots and other orthogonal designs, as well as designs with balanced confounding like balanced incomplete blocks or balanced lattices. Details of the necessary condition of first-order balance are given by Wilkinson (1970), Payne & Wilkinson (1976) and Payne & Tobias (1992). However, ANOVA can itself detect whether or not a design can be analysed, so if you are not sure whether or not a particular design is analysable, you can run it through ANOVA and see whether it succeeds or fails with an “AN 1” diagnostic. Sometimes the design will genuinely be unbalanced, but on other occasions it may be that errors have been made in entering the data. So the aim of AN1ADVICE is to give useful advice if you find that a set of data that you had expected to be balanced fails to be analysed by ANOVA.

The use of AN1ADVICE is very similar to ANOVA. You must first define the model that is to be fitted in the analysis, using the BLOCKSTRUCTURE and TREATMENTSTRUCTURE directives. As in ANOVA, the treatment terms to be included in the model are controlled by the FACTORIAL option, and the WEIGHT option can specify weights for a weighted analysis of variance.

AN1ADVICE has a parameter Y to specify the variate whose values are being analysed. However, this is required only if you are analysing a subset of the units. (You would then have used the RESTRICT directive, directly or through a menu, to restrict Y to the units concerned.)

In a balanced design, the joint replications of sets of factors in the design will usually have a systematic pattern. Often there will be equal replication. Then, for example, if you look at the replication table for any pair of factors, it will contain a single value (the number of times each pair of their levels occurs in the design). Alternatively, the replications may have a proportional pattern. For example, you may have a “control” level of one of the factors with perhaps twice as many replicates as the other, “test”, levels. Then, in every replication table involving that factor, the cells for the “control” level will have values twice as large as those in the corresponding “test” cells. So AN1ADVICE examines the factors in the model terms that ANOVA has found to be unbalanced, and examines their replications to try to identify cells whose values seem to be too small or too large.

The METHOD option controls how AN1ADVICE works out what the replication in each table ought to be. The default setting, mode, assumes that the values should all be equal, and that the non-zero value that occurs most often in the table is the correct one. The setting median is similar except that the right value is assumed to be the median of the non-zero values. Finally, the proportional setting estimates the correct values for each table by assuming that the replication has a proportional pattern.

The PRINT option controls the printed output, with settings:

    advice prints advice including replication tables of the factors that seem to be incorrect, highlighting the cells that seem to be too small or too large, and
    suspects prints the units with the combinations of factor levels that seem to occur too often in the design.

The default is PRINT=advice. The list of suspect units can also be saved, in a variate, using the SUSPECTS option.

If you believe that the design should be balanced, you may find that the factor values (or weights) of some of suspect units have been entered incorrectly. Alternatively, you may find that some units with the factor combinations whose replication has been highlighted as too low have been accidentally omitted from the data. If these mistakes can be corrected, the design may become balanced. Alternatively, if you cannot find any mistakes in the data, you will need to use regression or REML instead of ANOVA.


Parameter: Y.

Action with RESTRICT

You can restrict the set of units used for the analysis by applying a restriction to the y-variate.


Payne, R.W. & Wilkinson, G.N. (1977). A general algorithm for analysis of variance. Applied Statistics, 26, 251-260.

Payne, R.W. & Tobias, R.D. (1992). General balance, combination of information and the analysis of covariance. Scandinavian Journal of Statistics, 19, 3-23.

Wilkinson, G.N. (1970). A general recursive algorithm for analysis of variance. Biometrika, 57, 19-46.

See also


Commands for: Analysis of variance.


CAPTION   'AN1ADVICE example',!t('Split plot design, see the',\
         'Guide to Genstat, Part 2, Section 4.2.1.'); STYLE=meta,plain
&         [LEVELS=3] Wplots
&         [LEVELS=4] Subplots
GENERATE  Blocks,Wplots,Subplots
FACTOR    [NVALUES=72; LABELS=!T(Victory,'Golden rain',Marvellous)] Variety
&         [LABELS=!T('0 cwt','0.2 cwt','0.4 cwt','0.6 cwt')] Nitrogen
READ      [SERIAL=yes] Nitrogen,Variety
 4 3 2 1 1 2 4 3 1 2 3 4 3 1 2 4 4 1 2 3 2 1 3 4
 2 3 4 1 4 2 3 1 1 4 2 3 3 4 1 2 1 3 4 2 2 3 4 1
 4 1 3 2 3 4 1 2 3 4 2 1 3 1 4 2 4 3 1 2 1 2 3 4 :
 3 3 3 3 1 1 1 1 2 2 2 2 3 3 3 3 1 1 1 1 2 2 2 2
 2 2 2 2 3 3 3 3 1 1 1 1 3 3 3 3 2 2 2 2 1 1 1 1
 2 2 2 2 1 1 1 1 3 3 3 3 1 1 1 1 2 2 2 2 3 3 3 3 :
TREATMENTS Variety*Nitrogen
BLOCKS     Blocks/Wplots/Subplots
CAPTION    'With the correct factor values, the design is balanced.'
CAPTION    !t('Now switch the Nitrogen values in units 43 & 44',\
           'with those in 45 & 46 so that it becomes unbalanced.')
CALCULATE  nn1,nn2 = Nitrogen$[!(43,44),!(45,46)]
&          Nitrogen$[!(43,44),!(45,46)] = nn2,nn1
AN1ADVICE  [PRINT=advice,suspects]
Updated on March 11, 2019

Was this article helpful?