<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Inconsistent Ordering of Random Variance Components in Proc Mixed in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Inconsistent-Ordering-of-Random-Variance-Components-in-Proc/m-p/139289#M296217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran across and interesting issue in Proc Mixed.&amp;nbsp; First, my data are doubly longitudinal.&amp;nbsp; I have multiple behavioral measures for participants, nested within groups, at four different time periods.&amp;nbsp; My goal for the initial analysis is to compute the "Latent Group Model" (Gonzalez &amp;amp; Griffin, 2002), which essentially estimates covariances at both group and individual levels of analysis.&amp;nbsp; One repeated measure is a breeze, but 2 present a problem.&amp;nbsp; After some head scratching and web searching, I found a solution.&amp;nbsp; Here's the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc mixed method=reml lognote maxiter=500 covtest nobound data=scale1 noitprint noclprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; class group_id ami_ID trial id_var;&lt;/P&gt;&lt;P&gt;&amp;nbsp; model DV = trial|id_var / noint ddfm=satterth;&lt;/P&gt;&lt;P&gt;&amp;nbsp; random trial*id_var / sub= group_id type=un g;&lt;/P&gt;&lt;P&gt;&amp;nbsp; repeated trial*id_var / sub= ami_ID(group_id) type=un r;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp; And "group_id" and "ami_ID" are the group and individual-level nesting variables, respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output is attached (with reduced data--2 time periods and 2 behavioral measures within time).&amp;nbsp; 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.)&amp;nbsp;&amp;nbsp; It seems the R matrix does not preserve matrix order, or least doesn't use the same ordering.&amp;nbsp; The G matrix lines up fine with the covariance parameter estimates section.&amp;nbsp; Note I've also attached a print out of the ODS R covariance matrix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&amp;nbsp; BTW, I'm using 9.4 on a Linux system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11101i35FA7C9DA3F5FB67/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screen Shot 2014-10-23 at 11.49.09 AM.png" title="Screen Shot 2014-10-23 at 11.49.09 AM.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11102iE8B92061DA5AAC25/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screen Shot 2014-10-23 at 8.37.11 AM.png" title="Screen Shot 2014-10-23 at 8.37.11 AM.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Oct 2014 15:45:03 GMT</pubDate>
    <dc:creator>jbonito</dc:creator>
    <dc:date>2014-10-23T15:45:03Z</dc:date>
    <item>
      <title>Inconsistent Ordering of Random Variance Components in Proc Mixed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inconsistent-Ordering-of-Random-Variance-Components-in-Proc/m-p/139289#M296217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran across and interesting issue in Proc Mixed.&amp;nbsp; First, my data are doubly longitudinal.&amp;nbsp; I have multiple behavioral measures for participants, nested within groups, at four different time periods.&amp;nbsp; My goal for the initial analysis is to compute the "Latent Group Model" (Gonzalez &amp;amp; Griffin, 2002), which essentially estimates covariances at both group and individual levels of analysis.&amp;nbsp; One repeated measure is a breeze, but 2 present a problem.&amp;nbsp; After some head scratching and web searching, I found a solution.&amp;nbsp; Here's the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc mixed method=reml lognote maxiter=500 covtest nobound data=scale1 noitprint noclprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; class group_id ami_ID trial id_var;&lt;/P&gt;&lt;P&gt;&amp;nbsp; model DV = trial|id_var / noint ddfm=satterth;&lt;/P&gt;&lt;P&gt;&amp;nbsp; random trial*id_var / sub= group_id type=un g;&lt;/P&gt;&lt;P&gt;&amp;nbsp; repeated trial*id_var / sub= ami_ID(group_id) type=un r;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp; And "group_id" and "ami_ID" are the group and individual-level nesting variables, respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Output is attached (with reduced data--2 time periods and 2 behavioral measures within time).&amp;nbsp; 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.)&amp;nbsp;&amp;nbsp; It seems the R matrix does not preserve matrix order, or least doesn't use the same ordering.&amp;nbsp; The G matrix lines up fine with the covariance parameter estimates section.&amp;nbsp; Note I've also attached a print out of the ODS R covariance matrix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&amp;nbsp; BTW, I'm using 9.4 on a Linux system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11101i35FA7C9DA3F5FB67/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screen Shot 2014-10-23 at 11.49.09 AM.png" title="Screen Shot 2014-10-23 at 11.49.09 AM.png" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11102iE8B92061DA5AAC25/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Screen Shot 2014-10-23 at 8.37.11 AM.png" title="Screen Shot 2014-10-23 at 8.37.11 AM.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Oct 2014 15:45:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inconsistent-Ordering-of-Random-Variance-Components-in-Proc/m-p/139289#M296217</guid>
      <dc:creator>jbonito</dc:creator>
      <dc:date>2014-10-23T15:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering of Random Variance Components in Proc Mixed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inconsistent-Ordering-of-Random-Variance-Components-in-Proc/m-p/139290#M296218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What happens with other mixed model procedures (HPMIXED or GLIMMIX).&amp;nbsp; I realize the syntax will be a little different, but this seems, um, "unusual".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would gather everything together and get ready to submit a ticket to Tech Services...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 17:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inconsistent-Ordering-of-Random-Variance-Components-in-Proc/m-p/139290#M296218</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-10-24T17:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering of Random Variance Components in Proc Mixed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inconsistent-Ordering-of-Random-Variance-Components-in-Proc/m-p/139291#M296219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response.&amp;nbsp; I've edited/updated the original post to reflect that the ami_id variable is in the code and treated as categorical.&amp;nbsp; Also made the variables correspond to the output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 20:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inconsistent-Ordering-of-Random-Variance-Components-in-Proc/m-p/139291#M296219</guid>
      <dc:creator>jbonito</dc:creator>
      <dc:date>2014-10-27T20:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering of Random Variance Components in Proc Mixed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inconsistent-Ordering-of-Random-Variance-Components-in-Proc/m-p/139292#M296220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, it replicated when ami_id was categorical, so any ideas I had are out the window.&amp;nbsp; And it appears that the actual values are identical, just moved around.&amp;nbsp; Any formats associated that might be changing the order?&amp;nbsp; Frankly, I'm baffled.&amp;nbsp; Tech Services would be my next step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve Denham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 13:47:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inconsistent-Ordering-of-Random-Variance-Components-in-Proc/m-p/139292#M296220</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2014-10-28T13:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: Ordering of Random Variance Components in Proc Mixed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Inconsistent-Ordering-of-Random-Variance-Components-in-Proc/m-p/139293#M296221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Steve,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, values are correct, just in different places.&amp;nbsp; 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.&amp;nbsp; PROC Contents shows that both trial and id_var are numeric.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, yes, time to contact Tech Services.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 15:58:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Inconsistent-Ordering-of-Random-Variance-Components-in-Proc/m-p/139293#M296221</guid>
      <dc:creator>jbonito</dc:creator>
      <dc:date>2014-10-28T15:58:35Z</dc:date>
    </item>
  </channel>
</rss>

