<?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 Re: Proc Mixed, Repeated measures, nesting within sub in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-Repeated-measures-nesting-within-sub/m-p/351780#M18442</link>
    <description>&lt;P&gt;The syntax&lt;/P&gt;
&lt;PRE&gt;repeated day / subject=id(trt);&lt;/PRE&gt;
&lt;P&gt;corresponds to an experimental design in which each subject (&lt;EM&gt;id&lt;/EM&gt;) is randomly assigned to one level of &lt;EM&gt;trt&lt;/EM&gt;, and multiple observations are made on each &lt;EM&gt;id&lt;/EM&gt; at each level of &lt;EM&gt;day&lt;/EM&gt;. As such, &lt;EM&gt;id&lt;/EM&gt;s are nested within levels of &lt;EM&gt;trt&lt;/EM&gt;: each &lt;EM&gt;id&lt;/EM&gt; belongs to only one level of &lt;EM&gt;trt&lt;/EM&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;id(trt)&lt;/EM&gt;&amp;nbsp;identifies a random effects factor that has one level for each unique combination of &lt;EM&gt;id&lt;/EM&gt; and &lt;EM&gt;trt&lt;/EM&gt;. It does not mean that &lt;EM&gt;trt&lt;/EM&gt; is random; it's just a syntax shortcut.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you could assign each subject a unique id value and use&lt;/P&gt;
&lt;PRE&gt;repeated day / subject=unique_id;&lt;/PRE&gt;
&lt;P&gt;which is the point that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;is making.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even with unique values for subjects, I still use the nested syntax because it does a better job of giving me the denominator df that I think are appropriate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I note that you have &lt;EM&gt;time&lt;/EM&gt; in the MODEL statement. I bet this is a repeated measures factor as well, probably multiple times within each day. If so, your model is wrong, along with your understanding of the MIXED syntax. But that's another topic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I highly recommend&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="SAS System for Mixed Models" href="https://www.sas.com/store/books/categories/usage-and-reference/sas-for-mixed-models-second-edition/prodBK_59882_en.html" target="_self"&gt;https://www.sas.com/store/books/categories/usage-and-reference/sas-for-mixed-models-second-edition/prodBK_59882_en.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It will tell you most of what you need to know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Apr 2017 16:20:36 GMT</pubDate>
    <dc:creator>sld</dc:creator>
    <dc:date>2017-04-20T16:20:36Z</dc:date>
    <item>
      <title>Proc Mixed, Repeated measures, nesting within sub</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-Repeated-measures-nesting-within-sub/m-p/351325#M18430</link>
      <description>&lt;P&gt;Hello! I was presented with this model statement today, and am confused why you would nest an individual within a treatment?&lt;/P&gt;&lt;P&gt;example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&amp;nbsp;hotties;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input&amp;nbsp;&lt;/STRONG&gt;ID trt day time rtemp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1 1 3 1 103.6&lt;/P&gt;&lt;P&gt;1 1 3 2 103.6&lt;/P&gt;&lt;P&gt;1 1 4 1 104.2&lt;/P&gt;&lt;P&gt;1 1 4 2 104.6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2 2&lt;/SPAN&gt; 3 1 102.1&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2 2&lt;/SPAN&gt; 3 2 102.6&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2 2&lt;/SPAN&gt; 4 1 102.2&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2 2&lt;/SPAN&gt; 4 2 103.6&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;3 1 103.1&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3 1&lt;/SPAN&gt;&amp;nbsp;3 2 103.5&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;4 1 102.9&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;4 2 103.2&lt;/P&gt;&lt;P&gt;&lt;EM&gt;etc.&lt;/EM&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;class&lt;/STRONG&gt; ID trt&amp;nbsp;&lt;SPAN&gt;day time;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;model&lt;/STRONG&gt; rtemp = trt|day|time/ ddfm=satterw;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;repeat&amp;nbsp;&lt;/STRONG&gt;day/ sub = ID(trt); &amp;nbsp; &amp;nbsp;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; the sub = ID(trt), this is the part I do not understand what it does or why you would use it in this senario. Any thoughts? The SAS description of sub is to create a block, which is great. But my interpretation of this is that individual is then blocked by treatment, which does not make a whole lot of sense to me. Why would you block by treatment? Or am I interpretting this incorrectly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 14:41:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-Repeated-measures-nesting-within-sub/m-p/351325#M18430</guid>
      <dc:creator>ehines</dc:creator>
      <dc:date>2017-04-19T14:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Mixed, Repeated measures, nesting within sub</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-Repeated-measures-nesting-within-sub/m-p/351537#M18431</link>
      <description>&lt;P&gt;if your ID is unique ,then you can use&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;repeat&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;day/ sub = ID&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But if not ,then you have to use&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;repeat&amp;nbsp;&lt;/STRONG&gt;day/ sub = ID(trt)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;repeat&amp;nbsp;&lt;/STRONG&gt;day/ sub = ID*trt&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;to make subject id(strata) is unique.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;E.X.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;id trt&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1 1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2 1&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1 2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2 2&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;for this kind of data you have to use sub=id(trt) .&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 04:13:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-Repeated-measures-nesting-within-sub/m-p/351537#M18431</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-04-20T04:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Mixed, Repeated measures, nesting within sub</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-Repeated-measures-nesting-within-sub/m-p/351780#M18442</link>
      <description>&lt;P&gt;The syntax&lt;/P&gt;
&lt;PRE&gt;repeated day / subject=id(trt);&lt;/PRE&gt;
&lt;P&gt;corresponds to an experimental design in which each subject (&lt;EM&gt;id&lt;/EM&gt;) is randomly assigned to one level of &lt;EM&gt;trt&lt;/EM&gt;, and multiple observations are made on each &lt;EM&gt;id&lt;/EM&gt; at each level of &lt;EM&gt;day&lt;/EM&gt;. As such, &lt;EM&gt;id&lt;/EM&gt;s are nested within levels of &lt;EM&gt;trt&lt;/EM&gt;: each &lt;EM&gt;id&lt;/EM&gt; belongs to only one level of &lt;EM&gt;trt&lt;/EM&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;id(trt)&lt;/EM&gt;&amp;nbsp;identifies a random effects factor that has one level for each unique combination of &lt;EM&gt;id&lt;/EM&gt; and &lt;EM&gt;trt&lt;/EM&gt;. It does not mean that &lt;EM&gt;trt&lt;/EM&gt; is random; it's just a syntax shortcut.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you could assign each subject a unique id value and use&lt;/P&gt;
&lt;PRE&gt;repeated day / subject=unique_id;&lt;/PRE&gt;
&lt;P&gt;which is the point that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;is making.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even with unique values for subjects, I still use the nested syntax because it does a better job of giving me the denominator df that I think are appropriate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I note that you have &lt;EM&gt;time&lt;/EM&gt; in the MODEL statement. I bet this is a repeated measures factor as well, probably multiple times within each day. If so, your model is wrong, along with your understanding of the MIXED syntax. But that's another topic.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I highly recommend&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="SAS System for Mixed Models" href="https://www.sas.com/store/books/categories/usage-and-reference/sas-for-mixed-models-second-edition/prodBK_59882_en.html" target="_self"&gt;https://www.sas.com/store/books/categories/usage-and-reference/sas-for-mixed-models-second-edition/prodBK_59882_en.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It will tell you most of what you need to know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 16:20:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Proc-Mixed-Repeated-measures-nesting-within-sub/m-p/351780#M18442</guid>
      <dc:creator>sld</dc:creator>
      <dc:date>2017-04-20T16:20:36Z</dc:date>
    </item>
  </channel>
</rss>

