REPEATED Statement 
When values of the dependent variables in the MODEL statement represent repeated measurements on the same experimental unit, the REPEATED statement enables you to test hypotheses about the measurement factors (often called withinsubject factors), as well as the interactions of withinsubject factors with independent variables in the MODEL statement (often called betweensubject factors). The REPEATED statement provides multivariate and univariate tests as well as hypothesis tests for a variety of singledegreeoffreedom contrasts. There is no limit to the number of withinsubject factors that can be specified. For more details, see the section Repeated Measures Analysis of Variance in Chapter 41, The GLM Procedure.
The REPEATED statement is typically used for handling repeated measures designs with one repeated response variable. Usually, the variables on the lefthand side of the equation in the MODEL statement represent one repeated response variable.
This does not mean that only one factor can be listed in the REPEATED statement. For example, one repeated response variable (hemoglobin count) might be measured 12 times (implying variables Y1 to Y12 on the lefthand side of the equal sign in the MODEL statement), with the associated withinsubject factors treatment and time (implying two factors listed in the REPEATED statement). See the section Examples for an example of how PROC ANOVA handles this case.
Designs with two or more repeated response variables can, however, be handled with the IDENTITY transformation; see Example 41.9 in Chapter 41, The GLM Procedure, for an example of analyzing a doublymultivariate repeated measures design.
When a REPEATED statement appears, the ANOVA procedure enters a multivariate mode of handling missing values. If any values for variables corresponding to each combination of the withinsubject factors are missing, the observation is excluded from the analysis.
The simplest form of the REPEATED statement requires only a factorname. With two repeated factors, you must specify the factorname and number of levels (levels) for each factor. Optionally, you can specify the actual values for the levels (levelvalues), a transformation that defines singledegreeof freedom contrasts, and options for additional analyses and output. When more than one withinsubject factor is specified, factornames (and associated level and transformation information) must be separated by a comma in the REPEATED statement. These terms are described in the following section, "Syntax Details."
You can specify the following terms in the REPEATED statement.
The factorspecification for the REPEATED statement can include any number of individual factor specifications, separated by commas, of the following form:
factorname levels < (levelvalues) > < transformation >
where
names a factor to be associated with the dependent variables. The name should not be the same as any variable name that already exists in the data set being analyzed and should conform to the usual conventions of SAS variable names.
When specifying more than one factor, list the dependent variables in the MODEL statement so that the withinsubject factors defined in the REPEATED statement are nested; that is, the first factor defined in the REPEATED statement should be the one with values that change least frequently.
specifies the number of levels associated with the factor being defined. When there is only one withinsubject factor, the number of levels is equal to the number of dependent variables. In this case, levels is optional. When more than one withinsubject factor is defined, however, levels is required, and the product of the number of levels of all the factors must equal the number of dependent variables in the MODEL statement.
specifies values that correspond to levels of a repeatedmeasures factor. These values are used to label output; they are also used as spacings for constructing orthogonal polynomial contrasts if you specify a POLYNOMIAL transformation. The number of level values specified must correspond to the number of levels for that factor in the REPEATED statement. Enclose the levelvalues in parentheses.
The following transformation keywords define singledegreeoffreedom contrasts for factors specified in the REPEATED statement. Since the number of contrasts generated is always one less than the number of levels of the factor, you have some control over which contrast is omitted from the analysis by which transformation you select. The only exception is the IDENTITY transformation; this transformation is not composed of contrasts, and it has the same degrees of freedom as the factor has levels. By default, the procedure uses the CONTRAST transformation.
generates contrasts between levels of the factor and a reference level. By default, the procedure uses the last level; you can optionally specify a reference level in parentheses after the keyword CONTRAST. The reference level corresponds to the ordinal value of the level rather than the level value specified. For example, to generate contrasts between the first level of a factor and the other levels, use
contrast(1)
generates contrasts between each level of the factor and the mean of subsequent levels.
generates an identity transformation corresponding to the associated factor. This transformation is not composed of contrasts; it has degrees of freedom for an level factor, instead of . This can be used for doublymultivariate repeated measures.
generates contrasts between levels of the factor and the mean of all other levels of the factor. Specifying a reference level eliminates the contrast between that level and the mean. Without a reference level, the contrast involving the last level is omitted. See the CONTRAST transformation for an example.
generates orthogonal polynomial contrasts. Level values, if provided, are used as spacings in the construction of the polynomials; otherwise, equal spacing is assumed.
For examples of the transformation matrices generated by these contrast transformations, see the section Repeated Measures Analysis of Variance in Chapter 41, The GLM Procedure.
You can specify the following options in the REPEATED statement after a slash:
performs a canonical analysis of the and matrices corresponding to the transformed variables specified in the REPEATED statement.
specifies the method of evaluating the multivariate test statistics. The default is MSTAT=FAPPROX, which specifies that the multivariate tests are evaluated by using the usual approximations based on the distribution, as discussed in the "Multivariate Tests" section in Chapter 4, Introduction to Regression Procedures. Alternatively, you can specify MSTAT=EXACT to compute exact pvalues for three of the four tests (Wilks’ lambda, the HotellingLawley trace, and Roy’s greatest root) and an improved Fapproximation for the fourth (Pillai’s trace). While MSTAT=EXACT provides better control of the significance probability for the tests, especially for Roy’s Greatest Root, computations for the exact pvalues can be appreciably more demanding, and are in fact infeasible for large problems (many dependent variables). Thus, although MSTAT=EXACT is more accurate for most data, it is not the default method. For more information about the results of MSTAT=EXACT, see the section Multivariate Analysis of Variance in Chapter 41, The GLM Procedure.
displays the matrix for each combination of withinsubject factors, as well as partial correlation matrices for both the original dependent variables and the variables defined by the transformations specified in the REPEATED statement. In addition, the PRINTE option provides sphericity tests for each set of transformed variables. If the requested transformations are not orthogonal, the PRINTE option also provides a sphericity test for a set of orthogonal contrasts.
displays the (SSCP) matrix associated with each multivariate test.
displays the transformation matrices that define the contrasts in the analysis. PROC ANOVA always displays the matrix so that the transformed variables are defined by the rows, not the columns, of the displayed matrix. In other words, PROC ANOVA actually displays .
produces the characteristic roots and vectors for each multivariate test.
produces analysisofvariance tables for each contrast defined by the withinsubjects factors. Along with tests for the effects of the independent variables specified in the MODEL statement, a term labeled MEAN tests the hypothesis that the overall mean of the contrast is zero.
specifies the type of adjustment for the univariate test that is displayed in addition to the GreenhouseGeisser adjustment. The default is UEPSDEF=HFL, corresponding to the corrected form of the HuynhFeldt adjustment (Huynh and Feldt; 1976; Lecoutre; 1991). Other alternatives are UEPSDEF=HF, the uncorrected HuynhFeldt adjustment (the only available method in previous releases of SAS/STAT software), and UEPSDEF=CM, the adjustment of Chi and Muller (2009). See the section Hypothesis Testing in Repeated Measures Analysis in Chapter 41, The GLM Procedure, for details about these adjustments.
When specifying more than one factor, list the dependent variables in the MODEL statement so that the withinsubject factors defined in the REPEATED statement are nested; that is, the first factor defined in the REPEATED statement should be the one with values that change least frequently. For example, assume that three treatments are administered at each of four times, for a total of twelve dependent variables on each experimental unit. If the variables are listed in the MODEL statement as Y1 through Y12, then the following REPEATED statement
repeated trt 3, time 4;
implies the following structure:
Dependent Variables 

Y1 
Y2 
Y3 
Y4 
Y5 
Y6 
Y7 
Y8 
Y9 
Y10 
Y11 
Y12 

Value of trt 
1 
1 
1 
1 
2 
2 
2 
2 
3 
3 
3 
3 
Value of time 
1 
2 
3 
4 
1 
2 
3 
4 
1 
2 
3 
4 
The REPEATED statement always produces a table like the preceding one.
For more information about repeated measures analysis and about using the REPEATED statement, see the section Repeated Measures Analysis of Variance in Chapter 41, The GLM Procedure.