Inconsistent Ordering of Random Variance Components in Proc Mixed

Reply
Occasional Contributor
Posts: 18

Inconsistent Ordering of Random Variance Components in Proc Mixed

Hi Everyone,

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;

run;

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.

Joe


Screen Shot 2014-10-23 at 11.49.09 AM.pngScreen Shot 2014-10-23 at 8.37.11 AM.png
Respected Advisor
Posts: 2,655

Re: Ordering of Random Variance Components in Proc Mixed

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...

Steve Denham

Message was edited by: Steve Denham

Occasional Contributor
Posts: 18

Re: Ordering of Random Variance Components in Proc Mixed

Hi Steve,

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.

Joe

Respected Advisor
Posts: 2,655

Re: Ordering of Random Variance Components in Proc Mixed

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.

Steve Denham

Occasional Contributor
Posts: 18

Re: Ordering of Random Variance Components in Proc Mixed

Hi Steve,

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.

Joe

Ask a Question
Discussion stats
  • 4 replies
  • 273 views
  • 0 likes
  • 2 in conversation