1. Home
  2. AREPMEASURES procedure


Produces an analysis of variance for repeated measurements (R.W. Payne).


PRINT = string tokens Controls output about the covariance structure (vcovariance, correlation, epsilon, test); default epsi, test
APRINT = string tokens Printed output from the analysis of variance (as for the ANOVA PRINT option); default *
TREATMENTSTRUCTURE = formula Defines the treatments given to the subjects; if this is not set, the default is taken from any existing setting defined by the TREATMENTSTRUCTURE directive
BLOCKSTRUCTURE = formula Defines any block structure over the subjects if this is not set, the default is taken from any existing setting defined by the BLOCKSTRUCTURE directive
COVARIATE = variates Specifies any covariates on the subjects if this is not set, the default is taken from any existing setting defined by the COVARIATE directive
FACTORIAL = scalar Limit in the number of factors in the terms generated from the TREATMENTSTRUCTURE formula
TIMEPOINTS = variate, text or factor When the DATA parameter supplies a separate variate of observations for each time this can specify numbers or labels for the time points, when there is a single DATA variate this must supply a factor to indicate the time of each observation
CONTRASTS = scalar Limit on the order of a contrast of a treatment term; default 4
DEVIATIONS = scalar Limit on the number of factors in a treatment term for the deviations from its fitted contrasts to be retained in the model; default 9
FPROBABILITY = string token Printing of probabilities for variance ratios in the aov table (no, yes); default no
PSE = string tokens Standard errors to be printed with tables of means (differences, lsd, means); default diff
MAXCYCLE = scalar Maximum number of iterations for estimating missing values; default 20
LSDLEVEL = scalar Significance level (%) to use in the calculation of least significant differences; default 5
EPSILON = scalar Saves the correction factor epsilon
SAVEFACTORS = pointer Saves the factors used in the analysis of variance
ASAVE = identifier Saves the ANOVA save structure from the analysis of variance


DATA = variates Data observations either in a list of variates (one for each time), or a single variate (with TIMEPOINTS set to a factor indicating the time of each observation)


A repeated-measures design is one in which subjects (animals, people, plots, etc) are observed several times. Each subject receives a randomly allocated treatment, either at the outset, or repeatedly through the experiment. The subjects are observed at successive occasions to see how the treatment effects develop.

The design might thus seem analogous to a split-plot design, with subjects corresponding to whole plots, and the occasions of observation to the sub-plots. There are, however, some important differences between the two situations. With repeated measurements, there is likely to be a greater correlation between observations that are made at adjacent time points than between those that are more greatly spaced. Furthermore, the Times factor cannot, by its very nature, be allocated at random to the occasions within subjects. In the customary split-plot situation we can usually assume that there is an equal correlation between the sub-plots of each whole plot and, even if this were not so, the sub-plot treatment should have been allocated at random to the sub-plots within each whole plot. The formal conditions for the validity of the split-plot analysis will be discussed in more detail below, together with advice on how to proceed if they do not hold.

It is worth pointing out first, though, that this problem affects only the Subjects.Times stratum. The Subjects stratum contains an analysis of variance of the measurements totalled over the subjects, and this part of the analysis will be valid whatever the within-subject correlation structure. A further point is that, when measurements are taken on only two occasions, the analysis in the Subjects.Times stratum will also be valid; there can then be only one within-subject correlation, and the analysis in the Subjects.Times stratum is of the difference between the observations at time 2 and time 1 on each subject.

Another potential problem arising from the systematic nature of the Times factor is that effects arising from the “length of treatment time” will be confounded with any effects arising from the duration of the experiment, such as age of subject (which may be important with short-lived material such as aphids), season of year, time of day, and so on. This does not affect the validity of the analysis, and some of the confusion may be capable of being unravelled by running the experiment during more than one period. Nevertheless, care needs to be taken in drawing conclusions about time-effects.

The Subjects.Times information, describing the way in which the treatment effects change differentially with time, is often the aspect of most interest in the study. The formal requirement for the validity of the analysis in the sub-plot stratum of a split-plot design is that all the normalised contrasts in that stratum have an equal variance. The only practical arrangement of covariances between times that satisfies this condition would have a single variance down the diagonal and a single covariance off-diagonal. This pattern is known as a uniform covariance structure or, equivalently, the matrix is said to show compound symmetry; Box (1950) describes how this can be tested. In the usual split-plot analysis, the Subjects.Times sum of squares is assumed to be distributed as σ2 × χ2r where σ2 is a constant and χ2r has a chi-square distribution on r degrees of freedom. Similarly, under the assumption that there is no Treatments.Times interaction, the Treatments.Times sum of squares is assumed to be distributed as σ2 × χ2t where χ2t has a chi-square distribution on t degrees of freedom. If the variance-covariance structure does not exhibit compound symmetry, it is possible to show that the distributions can still be approximated by chi-square distributions, but the degrees of freedom are instead epsilon × r and epsilon × t. The correction factor epsilon lies between one, which would give the ordinary split-plot analysis, and 1/(number of times minus one), which would leave just one degree of freedom within each subject (remember that when there are only two observation on each subject, and thus just one within-subject degree of freedom, the analysis is valid). Epsilon can be estimated by maximum likelihood, as described by Greenhouse & Geisser (1959), and the estimated value can be saved by the EPSILON option. A further point is that this correction applies to the calculation of least significant differences as well as to the F ratios in the analysis of variance table. So, instead of a t distribution on r degrees of freedom, these must use the square root of an F distribution on epsilon and epsilon × r degrees of freedom.

The printing of information about the covariances is controlled by the strings listed for the PRINT option: vcovariance variance-covariance matrix, correlation correlation matrix, epsilon Greenhouse-Geisser epsilon, test test for compound symmetry.

The output from the analysis of variance is controlled by the APRINT option, with settings identical to those in the PRINT option of the ANOVA directive. The FPROBABILITY, PSE, MAXCYCLE and LSDLEVEL options also operate exactly as in ANOVA.

The treatments applied to the subjects can be specified (as a model formula) using the TREATMENTSTRUCTURE option, the block structure (if any) on the subjects can be specified by the BLOCKSTRUCTURE option, and the COVARIATE option can be used to list any covariates. If any of these options is unset, the default is taken from any existing setting defined by the directives TREATMENTSTRUCTURE, BLOCKSTRUCTURE or COVARIATE, respectively. The FACTORIAL option can be used to set a limit on the number of factors in the terms generated from the TREATMENTSTRUCTURE option.

Contrasts can be specified by using the functions POL, REG, COMPARISON, POLND or REGND in the TREATMENTSTRUCTURE formula, as in ANOVA. The CONTRASTS option places a limit on the order of contrasts that are fitted. The DEVIATIONS option sets a limit on the number of factors in the terms whose deviations from the fitted contrasts are to be retained in the model. See ANOVA for more details.

The observed data are specified by the DATA parameter in one of two ways. The first is to supply a list of variates, each one containing the measurements made on the subjects at one of the successive occasions on which they were observed. The TIMEPOINTS option can then supply a variate or text to define numbers or labels to use in output to identify the time point corresponding to each DATA variate; if TIMEPOINTS is unset, the labels are formed automatically from the identifiers of the DATA variates themselves. The DATA variates are appended into a single variate for the analysis, and the block and treatment factors are expanded to match. You can specify a pointer using the SAVEFACTORS option to save the expanded factors. The elements of the pointer are labelled by the factor names, and the time factor is also included, with the label 'Time factor'. You would need to use these, for example, if you wanted to plot the means using AGRAPH.

The second possibility is to supply a single DATA variate containing the data from all the times. The TIMEPOINTS option must then be set to a factor indicating the time of each observation. The block and treatment factors must already have been expanded to match the DATA variate, and each subject should be represented by a unique combination of the block factors. If not, Genstat prints a warning and assumes that the subjects occur in the same order within each time. To simplify the use of AREPMEASURES in general programs, the SAVEFACTORS pointer is also formed when the data are in a single variate. (However, it then contains the original factors.)

The ASAVE option lets you save the save structure from the ANOVA analysis.


Parameter: DATA.


The procedure uses the standard Genstat directives for calculations and manipulation to obtain the various matrices and tests. Formulae for these are given by Box (1950), Greenhouse & Geisser (1959) and Winer (1962) pages 523 and 594-599, although note that equation (1) on page 595 should contain N′ & ni, not N & ni.

Action with RESTRICT

The procedure does not allow for restrictions, and will cancel any that have been applied.


Box, G.E.P. (1950). Problems in the analysis of growth and wear curves. Biometrics, 6, 362-389.

Greenhouse, S.W. & Geisser, S. (1959). On methods in the analysis of profile data. Psychometrika, 24, 95-112.

Winer, B.J. (1962). Statistical Principals in Experimental Design (second edition). McGraw-Hill, New York.

See also

Directive: ANOVA.

Commands for: Repeated measurements.


        !t('Data from Winer (1962), Statistical Principals in Experimental',\
        'Design (2nd edition), McGraw-Hill, New York, p. 597.');\
FACTOR  [LEVELS=2; VALUES=5(1,2)] Groups
VARIATE [NVALUES=10] Data[1,2,3]
READ    Data[1,2,3]
4 7 2  3 5 1  7 9 6  6 6 2  5 5 1  8 2 5  4 1 1  6 3 4  9 5 2  7 1 1 :
AREPMEASURES [PRINT=vcovariance,correlation,epsilon,test; APRINT=aov,means;\
        FPROB=yes; PSE=diff,lsd; TREATMENTS=Groups] Data[]
Updated on August 30, 2019

Was this article helpful?