Help using Base SAS procedures

PROC MIXED: "Consider using a classification effect in the REPEATED statement"

Reply
Regular Contributor
Posts: 199

PROC MIXED: "Consider using a classification effect in the REPEATED statement"

[ Edited ]
I'm attempting a linear mixed-effects regression using PROC MIXED. I have never done this analysis before, and frankly, it's over my head..
 
Can someone help me understand this warning in the log. It only appears in my fully-adjusted model.
 
"The R matrix depends on observation order within subjects. Omitting observations from the analysis because of missing
values can affect this matrix. Consider using a classification effect in the REPEATED statement to determine ordering in
the R matrix."
 
The documentation for the REPEATED statement states that "Specifying a repeated effect is useful...", but it's not clear what or how I would do so.
 
Thanks for the assistance.
 
	PROC MIXED DATA=have METHOD=REML EMPIRICAL;		
	CLASS condition sex school baseline;
	MODEL score = condition timepoint_num condition*timepoint_num age sex school baseline / SOLUTION;
	REPEATED / TYPE=UN SUBJECT=patientid;
	QUIT;
 
SAS Super FREQ
Posts: 3,755

Re: PROC MIXED: "Consider using a classification effect in the REPEATED statement"

To address the "over my head" concern, you might want to read the papers

I'm nit an expert in mixed models, but in KTG (2012), on p. 3, there is an example similar to yours. The surrounding text seems to imply that since you did not put PATIENTID on the CLASS statement, that you should sort the data by PATIENTID and by the time-like variable (which might be timepoint_num???). So try this before the PROC MIXED step:

 

proc sort data=have;

by patientid timepoint_num; /* or whatever variable is used to order the repeated obs */

run;

 

Respected Advisor
Posts: 2,655

Re: PROC MIXED: "Consider using a classification effect in the REPEATED statement"

Working from @Rick_SAS's surmission about your code, try the following:

PROC MIXED DATA=have METHOD=REML EMPIRICAL;		
	CLASS condition sex school baseline timepoint_num patientid;
	MODEL score = condition timepoint_num condition*timepoint_num age sex school baseline / SOLUTION;
	REPEATED timepoint_num / TYPE=UN SUBJECT=patientid;
	RUN;

This will give you a medium inference space solution--broad for patients, narrow for schools.  You might want to consider school as a random effect, in which case the following would be appropriate:

PROC MIXED DATA=have METHOD=REML EMPIRICAL;		
	CLASS condition sex school baseline timepoint_num patientid;
	MODEL score = condition timepoint_num condition*timepoint_num age sex  baseline / SOLUTION;
	REPEATED timepoint_num / TYPE=UN SUBJECT=patientid;
        RANDOM intercept/subject=school;
	RUN;

For these to work, you need unique patientid's across all schools, and you need unique observations at each timepoint_num for each patientid.

 

Now comes the flood--how does your data breakdown?  How many timepoint_num's are you trying to fit?  Since they are indexed (presumably, based on the variable name), is the spacing relatively equal between them, and is it similar in number of timepoints across schools?

 

Besides the texts @Rick_SAS mentioned, get a copy of SAS for MIxed Models, 2nd ed. by Littell et al. (3rd ed. soon to be issued).

 

Steve Denham

 

 

 

 

 

 

 

Ask a Question
Discussion stats
  • 2 replies
  • 784 views
  • 0 likes
  • 3 in conversation