<?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 PROC MIXED with nested/clustered repeated measures in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-MIXED-with-nested-clustered-repeated-measures/m-p/794912#M39000</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello -&lt;/P&gt;
&lt;P&gt;I’m running a repeated measures mixed model with lab data. &amp;nbsp;&amp;nbsp;For each patient - lab value is measured at 4 timepoints, but at each timepoint the lab data value is measured by 2 separate devices. Each patient was also randomized to one of 2 treatments. I am interested in testing the difference in lab values by treatment, timepoint, and device.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each patient has results at 4 timepoints, for 2 devices (8 records per patient). I am unsure how to specify the nested/clustered nature of device and patient. In the repeated statement, I included subject = ptno(device) - &amp;nbsp;is this correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt; &lt;STRONG&gt;MIXED&lt;/STRONG&gt; DATA=labdat;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; CLASS ptno device time trt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; MODEL labval = device time trt device*time trt*device trt*time trt*device*time;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; REPEATED time / subject=ptno(device) type=cs;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LSMeans device*time*trt/ cl DIFF;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each patient has 8 records (2 devices, 4 timepoints each):&lt;/P&gt;
&lt;P&gt;ptno&amp;nbsp; trt&amp;nbsp; device time labval&lt;/P&gt;
&lt;P&gt;1 1 1 1 99&lt;/P&gt;
&lt;P&gt;1 1 1 2 105&lt;/P&gt;
&lt;P&gt;1 1 1 3 520&lt;/P&gt;
&lt;P&gt;1 1 1 4 467&lt;/P&gt;
&lt;P&gt;1 1 2 1 267&lt;/P&gt;
&lt;P&gt;1 1 2 2 325&lt;/P&gt;
&lt;P&gt;1 1 2 3 261&lt;/P&gt;
&lt;P&gt;1 1 2 4 313&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;20&amp;nbsp; 2&amp;nbsp; 1&amp;nbsp; 1&amp;nbsp; 119&lt;/P&gt;
&lt;P&gt;20&amp;nbsp; 2&amp;nbsp; 1&amp;nbsp; 2&amp;nbsp; 127&lt;/P&gt;
&lt;P&gt;20&amp;nbsp; 2&amp;nbsp; 1&amp;nbsp; 3&amp;nbsp; 618&lt;/P&gt;
&lt;P&gt;20&amp;nbsp; 2&amp;nbsp; 1&amp;nbsp; 4&amp;nbsp; 529&lt;/P&gt;
&lt;P&gt;20&amp;nbsp; 2&amp;nbsp; 2&amp;nbsp; 1&amp;nbsp; 267&lt;/P&gt;
&lt;P&gt;20 2&amp;nbsp; 2&amp;nbsp; 2&amp;nbsp; 320&lt;/P&gt;
&lt;P&gt;20 2&amp;nbsp; 2&amp;nbsp; 3&amp;nbsp; 290&lt;/P&gt;
&lt;P&gt;20 2&amp;nbsp; 2&amp;nbsp; 4&amp;nbsp; 400&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;, any suggestions?&lt;/P&gt;</description>
    <pubDate>Tue, 08 Feb 2022 03:11:51 GMT</pubDate>
    <dc:creator>tka726</dc:creator>
    <dc:date>2022-02-08T03:11:51Z</dc:date>
    <item>
      <title>PROC MIXED with nested/clustered repeated measures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-MIXED-with-nested-clustered-repeated-measures/m-p/794912#M39000</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello -&lt;/P&gt;
&lt;P&gt;I’m running a repeated measures mixed model with lab data. &amp;nbsp;&amp;nbsp;For each patient - lab value is measured at 4 timepoints, but at each timepoint the lab data value is measured by 2 separate devices. Each patient was also randomized to one of 2 treatments. I am interested in testing the difference in lab values by treatment, timepoint, and device.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each patient has results at 4 timepoints, for 2 devices (8 records per patient). I am unsure how to specify the nested/clustered nature of device and patient. In the repeated statement, I included subject = ptno(device) - &amp;nbsp;is this correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt; &lt;STRONG&gt;MIXED&lt;/STRONG&gt; DATA=labdat;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; CLASS ptno device time trt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; MODEL labval = device time trt device*time trt*device trt*time trt*device*time;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; REPEATED time / subject=ptno(device) type=cs;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; LSMeans device*time*trt/ cl DIFF;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each patient has 8 records (2 devices, 4 timepoints each):&lt;/P&gt;
&lt;P&gt;ptno&amp;nbsp; trt&amp;nbsp; device time labval&lt;/P&gt;
&lt;P&gt;1 1 1 1 99&lt;/P&gt;
&lt;P&gt;1 1 1 2 105&lt;/P&gt;
&lt;P&gt;1 1 1 3 520&lt;/P&gt;
&lt;P&gt;1 1 1 4 467&lt;/P&gt;
&lt;P&gt;1 1 2 1 267&lt;/P&gt;
&lt;P&gt;1 1 2 2 325&lt;/P&gt;
&lt;P&gt;1 1 2 3 261&lt;/P&gt;
&lt;P&gt;1 1 2 4 313&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;20&amp;nbsp; 2&amp;nbsp; 1&amp;nbsp; 1&amp;nbsp; 119&lt;/P&gt;
&lt;P&gt;20&amp;nbsp; 2&amp;nbsp; 1&amp;nbsp; 2&amp;nbsp; 127&lt;/P&gt;
&lt;P&gt;20&amp;nbsp; 2&amp;nbsp; 1&amp;nbsp; 3&amp;nbsp; 618&lt;/P&gt;
&lt;P&gt;20&amp;nbsp; 2&amp;nbsp; 1&amp;nbsp; 4&amp;nbsp; 529&lt;/P&gt;
&lt;P&gt;20&amp;nbsp; 2&amp;nbsp; 2&amp;nbsp; 1&amp;nbsp; 267&lt;/P&gt;
&lt;P&gt;20 2&amp;nbsp; 2&amp;nbsp; 2&amp;nbsp; 320&lt;/P&gt;
&lt;P&gt;20 2&amp;nbsp; 2&amp;nbsp; 3&amp;nbsp; 290&lt;/P&gt;
&lt;P&gt;20 2&amp;nbsp; 2&amp;nbsp; 4&amp;nbsp; 400&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;, any suggestions?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 03:11:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-MIXED-with-nested-clustered-repeated-measures/m-p/794912#M39000</guid>
      <dc:creator>tka726</dc:creator>
      <dc:date>2022-02-08T03:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MIXED with nested/clustered repeated measures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-MIXED-with-nested-clustered-repeated-measures/m-p/794989#M39001</link>
      <description>&lt;P&gt;This looks as though it should work.&amp;nbsp; Is there something in the log or listing that indicates that there is an issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 14:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-MIXED-with-nested-clustered-repeated-measures/m-p/794989#M39001</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2022-02-08T14:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MIXED with nested/clustered repeated measures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-MIXED-with-nested-clustered-repeated-measures/m-p/794990#M39002</link>
      <description>&lt;P&gt;There are different ways to model the correlations in this data. One approach is to use the kronecker product covariance structure --&lt;/P&gt;
&lt;P&gt;repeated device time / subject=patno type=un@ar(1);&amp;nbsp; *** or &lt;A href="mailto:un@un" target="_blank"&gt;un@un&lt;/A&gt;&amp;nbsp;or &lt;A href="mailto:un@cs;" target="_blank"&gt;un@cs;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Other ways are also possible, including using both RANDOM and REPEATED statements. See my paper below (pages 4 and 5 are relevant here).&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings15/SAS1919-2015.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings15/SAS1919-2015.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Jill&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 14:50:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-MIXED-with-nested-clustered-repeated-measures/m-p/794990#M39002</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2022-02-08T14:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MIXED with nested/clustered repeated measures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-MIXED-with-nested-clustered-repeated-measures/m-p/794992#M39004</link>
      <description>&lt;P&gt;Follow&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60873"&gt;@jiltao&lt;/a&gt;&amp;nbsp;'s advice. She is who I would turn to if I had any questions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 14:52:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-MIXED-with-nested-clustered-repeated-measures/m-p/794992#M39004</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2022-02-08T14:52:52Z</dc:date>
    </item>
    <item>
      <title>Re: PROC MIXED with nested/clustered repeated measures</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/PROC-MIXED-with-nested-clustered-repeated-measures/m-p/795024#M39005</link>
      <description>&lt;P&gt;Thank you, both.&lt;/P&gt;
&lt;P&gt;This paper perfectly answers my questions!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Feb 2022 17:01:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/PROC-MIXED-with-nested-clustered-repeated-measures/m-p/795024#M39005</guid>
      <dc:creator>tka726</dc:creator>
      <dc:date>2022-02-08T17:01:48Z</dc:date>
    </item>
  </channel>
</rss>

