AFIELDRESIDUALS procedure

Display residuals in field layout (R.W. Payne & A.D.Todd).


Options

PRINT = strings
Controls output (contour, shade, table); default cont

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

METHOD = string
Type of residuals to take from the save structure when the RESIDUALS parameter is not specified (combined, finalstratum, standardizedfinal); default comb

MARGIN = string
Whether to include margins in printed tables (yes, no); default no

PENCONTOUR = scalar
Pen number to be used for the contours; default 1

PENFILL = scalar or variate
Pen number(s) defining how to fill the areas between contours; default 3

PENSHADE = scalar or variate
Pen(s) to use for the shade plot; default 3


Parameters

Y = variates or factors
Specifies the y-coordinates of the plots

X = variates or factors
Specifies the x-coordinates of the plots

RESIDUALS = variates
Residuals to be plotted; default is to take the residuals from the save structure specified by the SAVE option, or from the most recent ANOVA if that is unspecified

SAVE = ANOVA, REML or regression save structures
Save structure of the ANOVA, REML or regression analysis from which to take the residuals if the RESIDUALS parameter is not specified; default is to take the most recent ANOVA analysis

FIELDWIDTH = scalars
Field width for printing the residuals; default 12

DECIMALS = scalars
Number of decimal places to use when printing the residuals

TITLE = texts
Titles for the plots


Description

In a field experiment it can be useful to study the spatial pattern of the residuals, for example to see if there are any systematic trends in fertility.

   The locations of the plots are defined by the Y and X parameters, specifying variates or factors containing their y- and x-coordinates respectively. By default the residuals are taken from the most recent ANOVA analysis. You can take the residuals from some other analysis, by specifying its save structure using the SAVE parameter. This can be from another ANOVA analysis, a REML analysis or a regression analysis (see MODEL).

   The METHOD option determines the type of residuals that are taken. The default setting combined gives residuals combining the residuals from all the strata or error terms in the analysis. These corresponds to the CBRESIDUALS option of the AKEEP directive, or the use of the RESIDUALS option in VKEEP with option RMETHOD=all. Regression allows only a single error term, so combined is treated as the same as the next setting, finalstratum.

   The setting finalstratum uses simple residuals from the final stratum or error term. These correspond to the RESIDUALS option of AKEEP with option RMETHOD=simple, or the RESIDUALS option of VKEEP with option RMETHOD=final, or the RESIDUALS parameter of RKEEP with option RMETHOD=simple.

   The last setting, standardizedfinal, uses standardized residuals from the final stratum or error term. These correspond to the RESIDUALS option of AKEEP with option RMETHOD=standardized, or the RESIDUALS parameter of RKEEP with option RMETHOD=deviance. They are not available from REML analyses.

   Usually, the plots will all have different coordinates. However, if there are several plots with the same coordinates, mean residuals are calculated for each location. Thus for example, if you wanted only to look at the block and whole-plot residuals in a split-plot design, you could request combined residuals and then set identical coordinates for the (sub-) plots within each whole plot.

   AFIELDRESIDUALS provides three forms of representation, selected using the PRINT option as follows:

    table
prints the residuals in a table whose structure corresponds to the field layout,

    contour
generates a contour plot if the plots are on a regular grid or a line graph if they are arranged in a single line, and

    shade
can produce a shade plot for plots that are on a regular grid.

   The GRAPHICS option determines the type of graphics that is used, with settings highresolution (the default) and lineprinter. No graph can be produced if the plots are in an irregular 2-dimensional arrangement. High-resolution contour plots require more than 3 rows and columns, and line-printer contour plots require more than 4 rows and columns. The way in which the lines are drawn in high-resolution contour plots is defined by the properties of the pen specified by the PENCONTOUR option, while the pen specified by the PENFILL parameter defines how to shade the areas between the contours. Their defaults are 1 and 3 respectively. Similarly, the pen or pens specified by the PENSHADE option control the colouring of the shade plot; the default is to use pen 3. For more information see the DCONTOUR and DSHADE directives.

   The MARGIN option, with settings no (default) and yes, determines whether or not marginal summaries are included with the printed tables. The FIELDWIDTH and DECIMALS parameters can be used to specify the formats of the printed tables (as in the PRINT directive). The TITLE parameter can supply a title for the plots. If this is unset, a default title is formed.

 

Options: PRINT, GRAPHICS, METHOD, MARGIN, PENCONTOUR, PENFILL, PENSHADE.

Parameters: Y, X, RESIDUALS, SAVE, FIELDWIDTH, DECIMALS, TITLE.


Method

AFIELDRESIDUALS obtains the residuals using the AKEEP, VKEEP or RKEEP directives, and then uses the standard GenStat facilities for manipulation and plotting.


Action with RESTRICT

If any of X, Y or RESIDUALS is restricted, only the unrestricted plots are displayed.