ASWEEP procedure

Performs sweeps for model terms in an analysis of variance (R.W. Payne).


Options

TERM = formula
Model term (or terms) involved in the sweep (this need not be specified if EMETHOD=given); default is to sweep for the grand mean

EFFICIENCY = scalar
Efficiency factor of the term(s)

EMETHOD = string
Source of the effects (calculated, given); default calc

RMETHOD = string
Method to be used to obtain the residual variate (subtract, replace); default subt


Parameters

Y = variate
Working variates to be swept

EFFECTS = table
Estimated effects

RESIDUALS = variate
New working variates, following the sweep

SS = scalars
Sum of squares due to the term(s)

RSS = scalars
Sum of squares of the working variate after the sweep


Description

The analysis-of-variance algorithm in the GenStat ANOVA directive involves a series of sweep operations performed on a working variate which initially contains the data values and finally contains the residuals. Sweeps may have two parts. The first involves the estimation of the effects of a particular term. For a term that is orthogonal to the terms that preceed it in the model, the effects are estimated simply by the tables of means for that term, calculated from the working variate; for non-orthogonal terms, the effects are the means divided by an efficiency factor. In the second part, the working variate is modified. Usually this involves subtracting the estimated effects. Alternatively there is a special sweep, known as a pivot, which is used to initiate the analysis within a stratum. In this, the value in each unit of the working variate is replaced by the corresponding effect of the term. Further details can be found in the Guide to GenStat, Part 2, Section 4.7.5, or in the paper by Payne & Wilkinson (1977). Procedure ASWEEP is provided as a research tool for studying the algorithm and its properties.

   The values initially in the working variate are specified by the Y parameter. The procedure can sweep for a single term or, if several terms have the same efficiency factor, these can all be swept together. The TERM option specifies the term (or terms) and the efficiency factor is defined by the EFFICIENCY option. The EFFECTS parameter allows the estimated effects of the term(s) to be stored if option EMETHOD=calculated, or to be supplied if EMETHOD=given. The values in the working variate after the sweep can be saved using the RESIDUALS parameter, and the RMETHOD option indicates whether these are to be formed by an ordinary sweep (RMETHOD=subtract) or by a pivot (RMETHOD=replace). The SS parameter saves the sum of squares due to the term(s), and the RSS parameter saves the sum of squares of the working variate after the sweep.


Options: TERM, EFFICIENCY, EMETHOD, RMETHOD.

Parameters: Y, EFFECTS, RESIDUAL, SS, RSS.


Method

The procedure uses the standard GenStat directives for analysis of variance, calculations and manipulation.


Action with RESTRICT

If the working variate (specified by the Y parameter) is restricted, the sweep will use only the units not excluded by the restriction.


Reference

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