10-23-2014 11:45 AM
I ran across and interesting issue in Proc Mixed. First, my data are doubly longitudinal. I have multiple behavioral measures for participants, nested within groups, at four different time periods. My goal for the initial analysis is to compute the "Latent Group Model" (Gonzalez & Griffin, 2002), which essentially estimates covariances at both group and individual levels of analysis. One repeated measure is a breeze, but 2 present a problem. After some head scratching and web searching, I found a solution. Here's the code:
proc mixed method=reml lognote maxiter=500 covtest nobound data=scale1 noitprint noclprint;
class group_id ami_ID trial id_var;
model DV = trial|id_var / noint ddfm=satterth;
random trial*id_var / sub= group_id type=un g;
repeated trial*id_var / sub= ami_ID(group_id) type=un r;
Pretty simple--the trial*id_var interaction is the random effect at the group level and the repeated effect at the individual level. "Trial" is the repeated measure across time and "id_var" identifies each of the four behavioral measures within time. And "group_id" and "ami_ID" are the group and individual-level nesting variables, respectively.
Output is attached (with reduced data--2 time periods and 2 behavioral measures within time). Notice the R matrix, especially row 2, column 2, then compare that to what ought to be the corresponding estimate, UN(2,2), in the "Covariance Parameter Estimates" section--that estimate is actually UN(3,3). (I've circled those items in the screenshot.) It seems the R matrix does not preserve matrix order, or least doesn't use the same ordering. The G matrix lines up fine with the covariance parameter estimates section. Note I've also attached a print out of the ODS R covariance matrix.
Any thoughts? BTW, I'm using 9.4 on a Linux system.
Thanks in advance.
10-24-2014 01:47 PM
It might be due to treating ami_id as a continuous effect, which you probably have to do to handle the number of subjects, but that is a guess, and a pretty wild-assed one at that.
What happens with other mixed model procedures (HPMIXED or GLIMMIX). I realize the syntax will be a little different, but this seems, um, "unusual".
I would gather everything together and get ready to submit a ticket to Tech Services...
Message was edited by: Steve Denham
10-27-2014 04:52 PM
Thanks for your response. I've edited/updated the original post to reflect that the ami_id variable is in the code and treated as categorical. Also made the variables correspond to the output.
10-28-2014 09:47 AM
Well, it replicated when ami_id was categorical, so any ideas I had are out the window. And it appears that the actual values are identical, just moved around. Any formats associated that might be changing the order? Frankly, I'm baffled. Tech Services would be my next step.
10-28-2014 11:58 AM
Yes, values are correct, just in different places. I do have a PROC Format statement at the beginning of the file but don't use it to process the data in PROC Mixed. PROC Contents shows that both trial and id_var are numeric.
So, yes, time to contact Tech Services.