<?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 Two way anova repeated measure in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Two-way-anova-repeated-measure/m-p/772769#M37795</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run a two-way ANOVA repeated measure using PROC GLIMMIX. My first factor is soil type with two levels and the second factor is treatment with four levels and the repeated measure is days. I tried the code below but I am not sure if this is correct. I am using GLIMMIX instead of MIXED because I found it easier to using LSMEANS for mean comparisons.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc Glimmix data=idinc.labstud&lt;BR /&gt;plots=studentpanel;&lt;/P&gt;&lt;P&gt;class treatment soiltype rep day ;&lt;BR /&gt;lNitrate_Ammon =log(Nitrate_Ammon);&lt;BR /&gt;model lNitrate_Ammon = treatment|soiltype|day;&lt;BR /&gt;random day / subject=treatment(day) soiltype(day) type=ar(1) residual v vcorr;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS 10_7_2021 10_49_26 AM.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64470iD4FF936ABEA6BE22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SAS 10_7_2021 10_49_26 AM.jpg" alt="SAS 10_7_2021 10_49_26 AM.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
    <pubDate>Thu, 07 Oct 2021 14:51:23 GMT</pubDate>
    <dc:creator>iaatoloye</dc:creator>
    <dc:date>2021-10-07T14:51:23Z</dc:date>
    <item>
      <title>Two way anova repeated measure</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Two-way-anova-repeated-measure/m-p/772769#M37795</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run a two-way ANOVA repeated measure using PROC GLIMMIX. My first factor is soil type with two levels and the second factor is treatment with four levels and the repeated measure is days. I tried the code below but I am not sure if this is correct. I am using GLIMMIX instead of MIXED because I found it easier to using LSMEANS for mean comparisons.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc Glimmix data=idinc.labstud&lt;BR /&gt;plots=studentpanel;&lt;/P&gt;&lt;P&gt;class treatment soiltype rep day ;&lt;BR /&gt;lNitrate_Ammon =log(Nitrate_Ammon);&lt;BR /&gt;model lNitrate_Ammon = treatment|soiltype|day;&lt;BR /&gt;random day / subject=treatment(day) soiltype(day) type=ar(1) residual v vcorr;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS 10_7_2021 10_49_26 AM.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64470iD4FF936ABEA6BE22/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SAS 10_7_2021 10_49_26 AM.jpg" alt="SAS 10_7_2021 10_49_26 AM.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 14:51:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Two-way-anova-repeated-measure/m-p/772769#M37795</guid>
      <dc:creator>iaatoloye</dc:creator>
      <dc:date>2021-10-07T14:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Two way anova repeated measure</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Two-way-anova-repeated-measure/m-p/773416#M37802</link>
      <description>&lt;P&gt;The error is that your RANDOM statement has terms in it that are not recognized.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is your code:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;random day / subject=treatment(day) soiltype(day) type=ar(1) residual v vcorr;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Day within soiltype is a problem for the subject= option to recognize.&amp;nbsp; Instead try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;random day / subject=day(rep) type=ar(1) residual v vcorr;&lt;/PRE&gt;
&lt;P&gt;Here I assume that there are multiple reps of each of the 8 soil by treatment combinations, and that these are uniquely identified.&amp;nbsp; If reps are nested within the design by treatment, this becomes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;random day / subject=day(rep*treatment) type=ar(1) residual v vcorr&lt;/PRE&gt;
&lt;P&gt;If rep is nested within soiltype, substitute in for treatment, and if nested within both, but with nonunique rep identifiers, try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;random day / subject=day(rep*treatment*soiltype) type=ar(1) residual v vcorr&lt;/PRE&gt;
&lt;P&gt;Finally, depending on how many reps you have, and how they are identified, you might consider adding another RANDOM statement, so that the block of random statements looks like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;random intercept/subject=rep*treatment*soiltype;
random day / subject=day(rep*treatment*soiltype) type=ar(1) residual v vcorr&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 15:19:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Two-way-anova-repeated-measure/m-p/773416#M37802</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-10-11T15:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Two way anova repeated measure</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Two-way-anova-repeated-measure/m-p/773426#M37803</link>
      <description>&lt;P&gt;Thank you very much, Steve.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Oct 2021 16:07:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Two-way-anova-repeated-measure/m-p/773426#M37803</guid>
      <dc:creator>iaatoloye</dc:creator>
      <dc:date>2021-10-11T16:07:17Z</dc:date>
    </item>
  </channel>
</rss>

