<?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: How to add a tukey test to the proc mixed procedure in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-tukey-test-to-the-proc-mixed-procedure/m-p/915465#M360720</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That code does work, but it doesn't do what I was hoping it would. I was looking to make a tukey table with letters assigned to significance levels. (I think it's called a tukeys honestly significant difference test?). Would this be something that can be done with proc mixed?&lt;/P&gt;</description>
    <pubDate>Sun, 11 Feb 2024 19:42:50 GMT</pubDate>
    <dc:creator>caroline_rg</dc:creator>
    <dc:date>2024-02-11T19:42:50Z</dc:date>
    <item>
      <title>How to add a tukey test to the proc mixed procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-tukey-test-to-the-proc-mixed-procedure/m-p/915455#M360717</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to add a tukey test to the proc mixed procedure but I can not find a way that works. I have tried adding a line "adjust=tukey" but SAS did not recognize "adjust" as a command. I also tried "lsmeans BW/tukey cldiff", but SAS did not recognize "tukey cldiff". When I say SAS does not recognize the statements I mean the text stays grey.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my current code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc mixed data=GLANDES_TRUIE;
  class TRAIT truie;
  model BW=TRAIT/alpha=0.05;
  repeated / group=TRAIT;
  ods output tests3=tests;
  lsmeans TRAIT / cl;
  ods output lsmeans=lsm;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is when I add "adjust=tukey":&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc mixed data=GLANDES_TRUIE;
  class TRAIT truie;
  model BW=TRAIT/alpha=0.05;
  repeated / group=TRAIT;
  ods output tests3=tests;
  lsmeans TRAIT / cl;
  ods output lsmeans=lsm;
  adjust=tukey;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Error code:&lt;/P&gt;&lt;PRE&gt; 77           adjust=tukey;
              ______
              180
 ERROR 180-322: Statement is not valid or it is used out of proper order.
 78         run;
 79         
 80         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 90  &lt;/PRE&gt;&lt;P&gt;This is when I add "lsmeans BW/tukey cldiff":&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc mixed data=GLANDES_TRUIE;
  class TRAIT truie;
  model BW=TRAIT/alpha=0.05;
  repeated / group=TRAIT;
  ods output tests3=tests;
  lsmeans TRAIT / cl;
  ods output lsmeans=lsm;
  lsmeans BW/tukey cldiff
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Error Code:&lt;/P&gt;&lt;PRE&gt;77           lsmeans BW/tukey cldiff;
                         _____
                         22
                         202
 ERROR 22-322: Syntax error, expecting one of the following: ;, ADJ, ADJDFE, ADJUST, ADJUSTMENT, ALPHA, AT, BYLEVEL, CL, CORR, COV, 
               DF, DIFF, DIFFS, E, EST, OBSMARGINS, PDIFF, SIMPLE, SINGULAR, SLICE, TDIFF.  
 ERROR 202-322: The option or parameter is not recognized and will be ignored.
 78         run;
 79     &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Feb 2024 18:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-tukey-test-to-the-proc-mixed-procedure/m-p/915455#M360717</guid>
      <dc:creator>caroline_rg</dc:creator>
      <dc:date>2024-02-11T18:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a tukey test to the proc mixed procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-tukey-test-to-the-proc-mixed-procedure/m-p/915463#M360719</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/463699"&gt;@caroline_rg&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's &lt;EM&gt;extremely&lt;/EM&gt; useful to become familiar with the SAS documentation and the way how syntax is described there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The syntax of the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_mixed_syntax10.htm" target="_blank" rel="noopener"&gt;MODEL statement&lt;/A&gt; of PROC MIXED is&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="aa-statement"&gt;MODEL&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="aa-statementoptional"&gt;&lt;EM&gt;dependent&lt;/EM&gt;&amp;nbsp;&lt;SPAN class=" aa-keyword"&gt;=&lt;/SPAN&gt;&amp;nbsp;&amp;lt;&lt;EM&gt;fixed-effects&lt;/EM&gt;&amp;gt; &amp;lt;/ &lt;EM&gt;options&lt;/EM&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;and the syntax of the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_mixed_syntax08.htm" target="_blank" rel="noopener"&gt;LSMEANS statement&lt;/A&gt; is&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN class="aa-statement"&gt;LSMEANS&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="aa-statementoptional"&gt;&lt;EM&gt;fixed-effects&lt;/EM&gt; &amp;lt;/ &lt;EM&gt;options&lt;/EM&gt;&amp;gt;&lt;/SPAN&gt;;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So, assuming that your MODEL statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;model BW=TRAIT/alpha=0.05;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is correct, your second LSMEANS statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;lsmeans BW/tukey cldiff&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is wrong because &lt;FONT face="courier new,courier"&gt;BW&lt;/FONT&gt; is the &lt;EM&gt;dependent&lt;/EM&gt; variable (and neither TUKEY nor CLDIFF are among the &lt;EM&gt;options&lt;/EM&gt; and the closing semicolon is missing).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your first LSMEANS statement,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;lsmeans TRAIT / cl;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;however, makes sense and the option to request a Tukey adjustment is called &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_mixed_syntax08.htm#statug.mixed.lsmeansstmt_adjust" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;ADJUST=&lt;/STRONG&gt;TUKEY&lt;/A&gt;&amp;nbsp;:&lt;/P&gt;
&lt;PRE&gt;lsmeans TRAIT / cl &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;adjust=tukey&lt;/STRONG&gt;&lt;/FONT&gt;;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Feb 2024 19:27:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-tukey-test-to-the-proc-mixed-procedure/m-p/915463#M360719</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-02-11T19:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a tukey test to the proc mixed procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-tukey-test-to-the-proc-mixed-procedure/m-p/915465#M360720</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That code does work, but it doesn't do what I was hoping it would. I was looking to make a tukey table with letters assigned to significance levels. (I think it's called a tukeys honestly significant difference test?). Would this be something that can be done with proc mixed?&lt;/P&gt;</description>
      <pubDate>Sun, 11 Feb 2024 19:42:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-tukey-test-to-the-proc-mixed-procedure/m-p/915465#M360720</guid>
      <dc:creator>caroline_rg</dc:creator>
      <dc:date>2024-02-11T19:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a tukey test to the proc mixed procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-tukey-test-to-the-proc-mixed-procedure/m-p/915466#M360721</link>
      <description>&lt;P&gt;Sounds like&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/60547"&gt;@sbxkoenk&lt;/a&gt;'s solution&amp;nbsp;&lt;A href="https://communities.sas.com/t5/Statistical-Procedures/Letter-annotation-for-mean-separation/m-p/894969/highlight/true#M44366" target="_blank" rel="noopener"&gt;Re: Letter annotation for mean separation&lt;/A&gt; could be what you need: That is, add a &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_mixed_syntax16.htm" target="_blank" rel="noopener"&gt;STORE statement&lt;/A&gt; to the PROC MIXED step and then apply &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_plm_overview.htm" target="_blank" rel="noopener"&gt;PROC PLM&lt;/A&gt; to the stored analysis. The &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_plm_syntax06.htm" target="_blank" rel="noopener"&gt;LSMEANS statement&lt;/A&gt; of PROC PLM supports the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_introcom_sect041.htm#statug.introcom.lsmlines" target="_blank" rel="noopener"&gt;LINES&lt;/A&gt; and &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_introcom_sect041.htm#statug.introcom.lsmlinestable" target="_blank" rel="noopener"&gt;LINESTABLE&lt;/A&gt; options, which do not seem to be available in PROC MIXED directly.&lt;/P&gt;</description>
      <pubDate>Sun, 11 Feb 2024 20:27:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-tukey-test-to-the-proc-mixed-procedure/m-p/915466#M360721</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-02-11T20:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a tukey test to the proc mixed procedure</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-tukey-test-to-the-proc-mixed-procedure/m-p/915476#M360728</link>
      <description>Thank you!</description>
      <pubDate>Sun, 11 Feb 2024 22:05:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-tukey-test-to-the-proc-mixed-procedure/m-p/915476#M360728</guid>
      <dc:creator>caroline_rg</dc:creator>
      <dc:date>2024-02-11T22:05:04Z</dc:date>
    </item>
  </channel>
</rss>

