<?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: Write a contrast statement to test a group effet at a given time point (mixed model) in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945406#M47236</link>
    <description>&lt;P&gt;From your CONTRAST statement,&lt;BR /&gt;You want "Time effect5 - Time effect1 &lt;BR /&gt;in group 1" , NOT "Time effect in group 1" .&lt;BR /&gt;If you want Time5 v.s. Time1 effect, I think the best way is using LSMESTIMATE:&lt;BR /&gt;&lt;BR /&gt;lsmestimate group*week 'time5- time1 at group1' -1 0 0 0 1 ;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Sep 2024 01:05:50 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2024-09-27T01:05:50Z</dc:date>
    <item>
      <title>Write a contrast statement to test a group effet at a given time point (mixed model)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945347#M47231</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I run a mixed model for a repeated mesures analysis. I have 2 factors : group factor with 4 levels and week factor with 5 levels. I want to test the time effect in each group and the group effect in each week.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the following code to test time effect in group 1 and group effect in week 2 :&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc mixed data=rawdata;&lt;/DIV&gt;&lt;DIV&gt;class mice group week;&lt;/DIV&gt;&lt;DIV&gt;model col1 =&amp;nbsp; group week week*groupe ;&lt;/DIV&gt;&lt;DIV&gt;repeated / subject=mice type=cs;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;contrast "Time effect in group 1"&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;week -1 0 0 0 1 groupe*week -1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;week 0 -1 0 0 1 groupe*week 0 -1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;week 0 0 -1 0 1 groupe*week 0 0 -1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;week 0 0 0 -1 1 groupe*week 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;contrast "Group effect at time 2"&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; group -1 0 0&amp;nbsp; 1 week*group 0 0 0 0 -1 0&amp;nbsp; 0 1 0 0 0 0 0 0 0 0 0 0 0 0,&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; group 0 -1 0&amp;nbsp; 1 week*group 0 0 0 0 0 -1&amp;nbsp; 0 1 0 0 0 0 0 0 0 0 0 0 0 0,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; group 0&amp;nbsp; 0 -1 1 week*group 0 0 0 0 0&amp;nbsp; 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0;&lt;/DIV&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;It is working for&amp;nbsp;"Time effect in group 1" but it does not work for&amp;nbsp;"Group effect at time 2".&lt;/P&gt;&lt;P&gt;In the log, I can see " the contrast is not estimable".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please, can you let me know if my first contrast is correct and if so, why the second one does not work?&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Matthieu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 16:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945347#M47231</guid>
      <dc:creator>MattMaill</dc:creator>
      <dc:date>2024-09-26T16:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Write a contrast statement to test a group effet at a given time point (mixed model)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945349#M47232</link>
      <description>&lt;P&gt;Contrast statements are difficult for me (and others) to write, and there is a much simpler tool. Please look at the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_introcom_sect064.htm" target="_self"&gt;SLICE statement&lt;/A&gt;, it will estimate the values you want in this case. SAS has done the hard job of coming up with the right Contrasts (behind the scenes) so you don't have to do it yourself.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 17:28:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945349#M47232</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-09-26T17:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Write a contrast statement to test a group effet at a given time point (mixed model)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945355#M47233</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;-- the SLICE statement is much easier to use. For example --&lt;/P&gt;
&lt;DIV&gt;proc mixed data=rawdata;&lt;/DIV&gt;
&lt;DIV&gt;class mice group week;&lt;/DIV&gt;
&lt;DIV&gt;model col1 =&amp;nbsp; group week week*group ;&lt;/DIV&gt;
&lt;DIV&gt;repeated / subject=mice type=cs;&lt;/DIV&gt;
&lt;DIV&gt;slice week*group / sliceby=group sliceby=week;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;For your CONTAST statement, see if the following statement works for you --&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;contrast "Group effect at time 2"&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; group -1 0 0&amp;nbsp; 1 week*group 0 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0,&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; group 0 -1 0&amp;nbsp; 1 week*group 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 1 0 0 0,&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; group 0&amp;nbsp; 0 -1 1 week*group 0 0 0 0 0&amp;nbsp;&lt;SPAN&gt;0 0 0 0 0 0 -1 0 0 0 0 1 0 0 0&lt;/SPAN&gt;;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV&gt;Hope this helps,&lt;/DIV&gt;
&lt;DIV&gt;Jill&lt;/DIV&gt;</description>
      <pubDate>Thu, 26 Sep 2024 18:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945355#M47233</guid>
      <dc:creator>jiltao</dc:creator>
      <dc:date>2024-09-26T18:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Write a contrast statement to test a group effet at a given time point (mixed model)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945406#M47236</link>
      <description>&lt;P&gt;From your CONTRAST statement,&lt;BR /&gt;You want "Time effect5 - Time effect1 &lt;BR /&gt;in group 1" , NOT "Time effect in group 1" .&lt;BR /&gt;If you want Time5 v.s. Time1 effect, I think the best way is using LSMESTIMATE:&lt;BR /&gt;&lt;BR /&gt;lsmestimate group*week 'time5- time1 at group1' -1 0 0 0 1 ;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 01:05:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945406#M47236</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-09-27T01:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Write a contrast statement to test a group effet at a given time point (mixed model)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945408#M47237</link>
      <description>slice week*group / sliceby(group='1') diff;&lt;BR /&gt;slice week*group / sliceby(week='2') diff;</description>
      <pubDate>Fri, 27 Sep 2024 01:01:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945408#M47237</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-09-27T01:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Write a contrast statement to test a group effet at a given time point (mixed model)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945432#M47238</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/469989"&gt;@MattMaill&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Advice: only use CONTRAST statements when the coefficients in the contrast statement are not some combination of -1 or&amp;nbsp; 0 or 1. For example, if you want coefficients 2 -5 3, then CONTRAST is probably the way to go. Otherwise use SLICE or LSMEANS.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:06:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945432#M47238</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-09-27T10:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Write a contrast statement to test a group effet at a given time point (mixed model)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945439#M47239</link>
      <description>&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Slice statement is much simpler !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945439#M47239</guid>
      <dc:creator>MattMaill</dc:creator>
      <dc:date>2024-09-27T10:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Write a contrast statement to test a group effet at a given time point (mixed model)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945440#M47240</link>
      <description>&lt;P&gt;Thank you very much,&lt;/P&gt;&lt;P&gt;I tried both, slice statement&amp;nbsp; and revised contrast statement as you suggested.&lt;/P&gt;&lt;P&gt;It is working perfectly.&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;P&gt;Regards,Matthieu&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945440#M47240</guid>
      <dc:creator>MattMaill</dc:creator>
      <dc:date>2024-09-27T10:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Write a contrast statement to test a group effet at a given time point (mixed model)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945441#M47241</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your the suggested statements. It helps me too to compare groups two by two.&lt;/P&gt;&lt;P&gt;Matthieu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2024 10:51:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945441#M47241</guid>
      <dc:creator>MattMaill</dc:creator>
      <dc:date>2024-09-27T10:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Write a contrast statement to test a group effet at a given time point (mixed model)</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945442#M47242</link>
      <description>Ok, get it !</description>
      <pubDate>Fri, 27 Sep 2024 10:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Write-a-contrast-statement-to-test-a-group-effet-at-a-given-time/m-p/945442#M47242</guid>
      <dc:creator>MattMaill</dc:creator>
      <dc:date>2024-09-27T10:52:22Z</dc:date>
    </item>
  </channel>
</rss>

