The syntax for the REPEATED statement in PROC MIXED is
repeated <repeated-effect> / subject=<subject-effect> type=<covariance-structure>;
The subject effect is the experimental unit on which the repeated measures are taken. In a clinical trial, the subject might be a patient ID or an animal ID. In a crop field trial, the subject might be a specific plant or a sub-plot of a field. The repeated effect is the variable that uniquely identifies the repeated measure within a subject. Typically the repeated effect is some indicator of time.
If you run the analysis with and without the repeated effect included in your REPEATED statement and get different results, you generally should trust the results with the repeated effect included. One exception is when TYPE=CS (compound symmetry) is specified as the covariance structure in the REPEATED statement. Under the compound symmetric structure, the covariance is the same between any pair of measurements within a subject. In this case, the order of the measurements within a subject is not important and does not need to be preserved. You should get the same results with and without the repeated effect with this structure. However, the order of the measurements is important for other structures as illustrated below.
You can safely omit the repeated effect preceding the slash in the REPEATED statement when the data are sorted by subject and time and every subject has complete data with no missing values. If missing values appear in the explanatory variables or the dependent variable of your model, you should include the repeated effect in the REPEATED statement to preserve the correct spacing of the measurements for a given subject.
The following example illustrates the effect of omitting the repeated effect when the response is missing for some time point(s). These statements create data set TEMP with three subjects (ID). Each subject is measured at nine time points (Time), except for ID=1 whose measurement at Time=3 is not present in the data set.
data temp;
input ID Time Y;
datalines;
1 1 56
1 2 41
1 4 36
1 5 24
1 6 41
1 7 50
1 8 39
1 9 35
2 1 30
2 2 25
2 3 36
2 4 28
2 6 36
2 7 40
2 8 33
2 9 30
3 1 32
3 2 24
3 3 31
3 4 27
3 5 45
3 6 32
3 7 23
3 8 15
3 9 19
;
The following statements fit an AR(1) structure to the data. Note that no repeated effect is specified.
proc mixed data=temp;
class ID Time;
model Y = Time;
repeated / subject=ID type=ar(1);
run;
Without the repeated effect to properly position the measurements within a subject, the third measurement for ID=1 is assumed to be the measurement for Time=3 rather than for Time=4 as indicated in the data. Following are the covariance estimates for this analysis.
Now, if you include Time as the repeated effect, the measurements are correctly positioned. The third observation for ID=1 is correctly treated as the Time=4 measurement when fitting the model.
proc mixed data=temp;
class ID Time;
model Y = Time;
repeated Time / subject=ID type=ar(1);
run;
The results are slightly different now that the measurements are all correctly placed in time.
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.