I’d always assumed that if the option “order=internal” is used on the PROC MIXED statement, that the rows of an R matrix would be ordered according to the values of the time variable. It turns out that the rows of R have the same order as the time variable in the fixed effects. If “time(ref=first)” is used in the CLASS statement then the first category will be placed in the LAST row of R, as it is for the fixed effects.
The attached SAS program estimates a model using the ARH(1) covariance structure twice, first with “time(ref=first)”, then with “time(ref=last)”. Data are from https://stats.oarc.ucla.edu/wp-content/uploads/2016/02/repeat-1.txt, the model is:
Title1 "arh(1) structure, time(ref=first)";
ods output R=R1;
proc mixed data=long order=internal;
class exertype time(ref=first);
model pulse = exertype time exertype*time / solution;
repeated time / subject=id type=arh(1) R;
run;
ods output close;
Using “time(ref=first)”, I get the following covariance pattern estimates and R matrix:
Covariance Parameter Estimates
Cov Parm
Subject
Estimate
Var(1)
id
83.2217
Var(2)
id
120.57
Var(3)
id
35.9136
ARH(1)
id
0.5022
Estimated R Matrix for Subject 1
Row
Col1
Col2
Col3
1
35.9136
13.7881
33.0464
2
13.7881
83.2217
50.3053
3
33.0464
50.3053
120.57
R[1,1] corresponds with Var(3) in the covariance estimates, R[2,2] with Var(1), R[3,3] with Var(2). The order of the TIME variable in the fixed effects is 2, 3, 1 and that order seems to be used for the covariance parameter estimates as well.
The same model using “time(ref=last)” in the class statement produces the following covariance parameter estimates and R matrix:
Covariance Parameter Estimates
Cov Parm
Subject
Estimate
Var(1)
id
35.7683
Var(2)
id
87.1927
Var(3)
id
115.50
ARH(1)
id
0.5101
Estimated R Matrix for Subject 1
Row
Col1
Col2
Col3
1
35.7683
28.4861
16.7237
2
28.4861
87.1927
51.1893
3
16.7237
51.1893
115.50
Diagonal values of R now correspond with values for Var(1) to Var(3) from the covariance parameter estimates.
Is this a known "feature" for time variables using repeated measures in PROC MIXED? The R matrix will not be as expected if the default "ref=last" is not used for the time variable and the covariance pattern assumes ordered categories.
... View more