<?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: Programing Contrast Statment for 4x2 factorial design in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Programing-Contrast-Statment-for-4x2-factorial-design/m-p/780456#M38308</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data=WORK.IMPORT;
Class NIVEL ENZ;
Model CMMS = NIVEL ENZ NIVEL*ENZ/ddfm=kr;
Lsmeans NIVEL*ENZ/ adjust=tukey diff lines e;
   contrast 'Linear NIVEL at ENZ=0'     NIVEL*ENZ  -3 -1 1 3  0 0 0 0;
   contrast 'Quadratic NIVEL at ENZ=0' NIVEL*ENZ 1 -1 -1 1  0 0 0 0;
   contrast 'Linear NIVEL at ENZ=1'     NIVEL*ENZ  0 0 0 0  -3 -1 1 3;
   contrast 'Quadratic NIVEL at ENZ=0' NIVEL*ENZ 0 0 0 0   1 -1 -1 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since you are using CONTRAST rather than ESTIMATE, you can use integer coefficients.&amp;nbsp; If you want some output value, rather than just a p value, switch to LSMESTIMATE statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added the 'E' option to your LSMEANS statement as a check on the arrangement of coefficients in the CONTRAST statements.&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;</description>
    <pubDate>Tue, 16 Nov 2021 14:48:08 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2021-11-16T14:48:08Z</dc:date>
    <item>
      <title>Programing Contrast Statment for 4x2 factorial design</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Programing-Contrast-Statment-for-4x2-factorial-design/m-p/779704#M38270</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;How can I program the CONTRAST statment for decomposition of a 4x2 interaction by using linear and quadratic contrasts?&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;SPAN&gt;The SAS code I'm performing just shown the main component "NIVEL" contrast.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc glimmix data=WORK.IMPORT;
Class NIVEL ENZ;
Model CMMS = NIVEL ENZ NIVEL*ENZ/ddfm=kr;
Lsmeans NIVEL*ENZ/ adjust=tukey diff lines;
   contrast 'Linear'     NIVEL -0.67082 -0.223607 0.2236068 0.6708204;
   contrast 'Quadratico' NIVEL 0.5	-0.5	-0.5	0.5;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;The significant NIVEL*ENZ interaction should be&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt; decomposed in linear and quadratic contrasts of the LEVEL(0; 7.5; 15.0; or 22.5) component into the ENZ(0 or 1) component.&lt;/SPAN&gt;&lt;/SPAN&gt; Please, if anyone can help me! &lt;SPAN class=""&gt;&lt;SPAN&gt;Thank you very much!&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 12:05:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Programing-Contrast-Statment-for-4x2-factorial-design/m-p/779704#M38270</guid>
      <dc:creator>Maicon</dc:creator>
      <dc:date>2021-11-11T12:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Programing Contrast Statment for 4x2 factorial design</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Programing-Contrast-Statment-for-4x2-factorial-design/m-p/779822#M38271</link>
      <description>&lt;P&gt;Post was moved to&amp;nbsp;&lt;SPAN&gt;statistical_procedures board by me.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 15:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Programing-Contrast-Statment-for-4x2-factorial-design/m-p/779822#M38271</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-11T15:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Programing Contrast Statment for 4x2 factorial design</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Programing-Contrast-Statment-for-4x2-factorial-design/m-p/779823#M38272</link>
      <description>&lt;P&gt;Just adding this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many contrast and estimate statements can be "avoided" by using :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;LSMEANS statement and / or LSMESTIMATE Statement and SLICE Statement.&lt;/P&gt;
&lt;P&gt;Please use&amp;nbsp;LSMEANS / LSMESTIMATE / SLICE statements where appropriate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should you still need a CONTRAST statement, these blogs may learn you something new :&lt;/P&gt;
&lt;UL class="lia-list-style-type-disc"&gt;
&lt;LI&gt;Usage Note 67024: Using the ESTIMATE or CONTRAST statement or Margins macro to assess continuous variable effects in interactions and splines&lt;BR /&gt;&lt;A href="https://support.sas.com/kb/67/024.html" target="_blank"&gt;67024 - Using the ESTIMATE or CONTRAST statement or Margins macro to assess continuous variable effects in interactions and splines (sas.com)&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;The magical ESTIMATE (and CONTRAST) statements&lt;BR /&gt;By Chris Daman on SAS Learning Post April 23, 2012&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2012/04/23/the-magical-estimate-and-contrast-statements/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2012/04/23/the-magical-estimate-and-contrast-statements/&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;"Easy button" for ESTIMATE statements&lt;BR /&gt;By Chris Daman on SAS Learning Post April 25, 2012&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2012/04/25/easy-button-for-estimate-statements/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2012/04/25/easy-button-for-estimate-statements/&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;ESTIMATE Statements - the final installment&lt;BR /&gt;By Chris Daman on SAS Learning Post May 2, 2012&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2012/05/02/estimate-statements-the-final-installment/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2012/05/02/estimate-statements-the-final-installment/&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;How to write CONTRAST and ESTIMATE statements in SAS regression procedures?&lt;BR /&gt;By Rick Wicklin on The DO Loop June 6, 2016&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2016/06/06/write-contrast-estimate-statements-sas-regression-procedures.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2016/06/06/write-contrast-estimate-statements-sas-regression-procedures.html&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Usage Note 24447: Examples of writing CONTRAST and ESTIMATE statements&lt;BR /&gt;&lt;A href="https://support.sas.com/kb/24/447.html" target="_blank"&gt;https://support.sas.com/kb/24/447.html&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Koen&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 16:08:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Programing-Contrast-Statment-for-4x2-factorial-design/m-p/779823#M38272</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-11T16:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Programing Contrast Statment for 4x2 factorial design</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Programing-Contrast-Statment-for-4x2-factorial-design/m-p/779836#M38273</link>
      <description>&lt;P&gt;If you are saying that you want to assess the linear and quadratic effects of NIVEL and also whether those effects change depending on the level of ENZ, then you are saying that NIVEL is continuous and it can be removed from the CLASS statement. You can then fit the following model to assess the linear and quadratic effects of NIVEL and also their interactions with ENZ:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;class enz;&lt;/P&gt;
&lt;P&gt;model cmms = nivel nivel*nivel enz enz*nivel enz*nivel*nivel;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 17:33:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Programing-Contrast-Statment-for-4x2-factorial-design/m-p/779836#M38273</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-11-11T17:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Programing Contrast Statment for 4x2 factorial design</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Programing-Contrast-Statment-for-4x2-factorial-design/m-p/780456#M38308</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glimmix data=WORK.IMPORT;
Class NIVEL ENZ;
Model CMMS = NIVEL ENZ NIVEL*ENZ/ddfm=kr;
Lsmeans NIVEL*ENZ/ adjust=tukey diff lines e;
   contrast 'Linear NIVEL at ENZ=0'     NIVEL*ENZ  -3 -1 1 3  0 0 0 0;
   contrast 'Quadratic NIVEL at ENZ=0' NIVEL*ENZ 1 -1 -1 1  0 0 0 0;
   contrast 'Linear NIVEL at ENZ=1'     NIVEL*ENZ  0 0 0 0  -3 -1 1 3;
   contrast 'Quadratic NIVEL at ENZ=0' NIVEL*ENZ 0 0 0 0   1 -1 -1 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since you are using CONTRAST rather than ESTIMATE, you can use integer coefficients.&amp;nbsp; If you want some output value, rather than just a p value, switch to LSMESTIMATE statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added the 'E' option to your LSMEANS statement as a check on the arrangement of coefficients in the CONTRAST statements.&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;</description>
      <pubDate>Tue, 16 Nov 2021 14:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Programing-Contrast-Statment-for-4x2-factorial-design/m-p/780456#M38308</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2021-11-16T14:48:08Z</dc:date>
    </item>
  </channel>
</rss>

