<?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 How do I make a contrast in repeated measures data? in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-make-a-contrast-in-repeated-measures-data/m-p/650707#M31232</link>
    <description>&lt;DIV class="forum-topic-flex-article"&gt;&lt;DIV class="forum-article"&gt;&lt;DIV class="forum-post"&gt;&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;Hello there,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;Is there someone that knows how to do contrast analyze in repeated measures?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;I have a data with three treatments in cattle: the first group is a control, the second group got a habituation protocol and third group got another different habituation protocol. So I would like to test the control (first) vs habituated (second + third group); and test between the habituated ones (second vs third). The traits were collected in day 0 (no habituation in any groups) and day 14 (14 days after end of habituation of the second and third group) and day 28 (28 days after end of habituation of the second and third group). So I have 3 repeated measures.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;Is it possible to use the proc Mixed?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;proc mixed data=B; /*behaviour*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;class group breed animal day;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;MODEL VAR=GROUP DAY BREED GROUP*DAY;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;repeated DAY / type= ANTE(1) subject=animal*group;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;random breed / subject=animal;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;lsmeans group*day / pdiff;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;lsmeans group / pdiff;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;lsmeans day / pdiff;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;Thank you&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 26 May 2020 12:46:35 GMT</pubDate>
    <dc:creator>aska_ujita</dc:creator>
    <dc:date>2020-05-26T12:46:35Z</dc:date>
    <item>
      <title>How do I make a contrast in repeated measures data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-make-a-contrast-in-repeated-measures-data/m-p/650707#M31232</link>
      <description>&lt;DIV class="forum-topic-flex-article"&gt;&lt;DIV class="forum-article"&gt;&lt;DIV class="forum-post"&gt;&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;Hello there,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;Is there someone that knows how to do contrast analyze in repeated measures?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;I have a data with three treatments in cattle: the first group is a control, the second group got a habituation protocol and third group got another different habituation protocol. So I would like to test the control (first) vs habituated (second + third group); and test between the habituated ones (second vs third). The traits were collected in day 0 (no habituation in any groups) and day 14 (14 days after end of habituation of the second and third group) and day 28 (28 days after end of habituation of the second and third group). So I have 3 repeated measures.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;Is it possible to use the proc Mixed?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;proc mixed data=B; /*behaviour*/&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;class group breed animal day;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;MODEL VAR=GROUP DAY BREED GROUP*DAY;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;repeated DAY / type= ANTE(1) subject=animal*group;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;random breed / subject=animal;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;lsmeans group*day / pdiff;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;lsmeans group / pdiff;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;lsmeans day / pdiff;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="batang,apple gothic" size="2"&gt;Thank you&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 26 May 2020 12:46:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-make-a-contrast-in-repeated-measures-data/m-p/650707#M31232</guid>
      <dc:creator>aska_ujita</dc:creator>
      <dc:date>2020-05-26T12:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I make a contrast in repeated measures data?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-make-a-contrast-in-repeated-measures-data/m-p/650732#M31237</link>
      <description>&lt;P&gt;That is quite close. The key will be to limit the comparisons for group*day, unless comparing Group 1 on Day 0 to Group 3 on Day 14 has some interest for you.&amp;nbsp; I would recommend the following lsmean statements:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;lsmean group^day/diff slice=day;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This would give an F test for the difference between groups for each day.&lt;/P&gt;
&lt;P&gt;If you wished to be more explicit in your tests, you could construct LSMESTIMATE statements that make the comparisons which are of interest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, the LSMEAN statement has more options in PROC GLIMMIX.&amp;nbsp; If you changed your analysis to the following&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data=B; /*behaviour*/
class group breed animal day;
MODEL VAR=GROUP DAY BREED GROUP*DAY;
random DAY / type= ANTE(1) subject=animal*group residual;
random breed / subject=animal;
lsmeans group*day / slicediff ( group day);
lsmeans group / diff;
lsmeans day / diff;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In addition, with only 3 timepoints, I would specify the type= as type=chol, which would use a Cholesky factorization of an unstructured matrix, just in case there is a marked difference in the variance and covariance as time progressed in your experiment.&lt;/P&gt;
&lt;P&gt;&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;</description>
      <pubDate>Tue, 26 May 2020 13:23:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-make-a-contrast-in-repeated-measures-data/m-p/650732#M31237</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-05-26T13:23:42Z</dc:date>
    </item>
  </channel>
</rss>

