<?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: question about lsmean pdiff=;option in proc glm step, st102d03, SAS STAT1 in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968382#M48687</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/284679"&gt;@JackieJ_SAS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then, instead of having to run st100d05.sas every time you open SAS, you can use this code below in order to access the stat1.formats format catalog. This is the same code you mentioned in your reply:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options fmtsearch = (stat1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Good luck with the course!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Note that over the years SAS made it easier to update the values of options like FMTSEARCH that take a list of values by adding the APPEND and INSERT options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So to add the STAT1.FORMATS catalog to the end of the FMTSEARCH list of catalogs use one of these two statements.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options append=fmtsearch=stat1;
options append=fmtsearch=stat1.formats;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should end up with FMTSEARCH option that looks like this:&lt;/P&gt;
&lt;PRE&gt;293  %put %sysfunc(getoption(fmtsearch));
(WORK LIBRARY STAT1)
&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_063/lesysoptsref/p1q9ay0ai0h2ein1n68qxomnm3q7.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/v_063/lesysoptsref/p1q9ay0ai0h2ein1n68qxomnm3q7.htm&lt;/A&gt;&lt;/P&gt;
&lt;H2 class="xisDoc-title"&gt;Comparisons&lt;/H2&gt;
&lt;P class="xisDoc-paragraph"&gt;The APPEND= system option adds a new value to the end of the current value of the AUTOEXEC, CMPLIB, FMTSEARCH, SASHELP, MSG, MAPSGFK, SASAUTOS, SASSCRIPT, or SET system options. The INSERT= system option adds a new value as the first value of one of these system options.&lt;/P&gt;</description>
    <pubDate>Sat, 07 Jun 2025 16:19:20 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-06-07T16:19:20Z</dc:date>
    <item>
      <title>question about lsmean pdiff=;option in proc glm step, st102d03, SAS STAT1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968342#M48675</link>
      <description>&lt;P&gt;Hi, anyone did this question can help and confirm this? Should the '&lt;EM&gt;Average/Typical&lt;/EM&gt;' be '&lt;EM&gt;TA&lt;/EM&gt;' (see screen capture)? I got error message when run the &lt;EM&gt;ls means/pdiff=control;&lt;/EM&gt; statement with the value as '&lt;EM&gt;Average/Typical&lt;/EM&gt;', which is not the value in the &lt;EM&gt;Heating_QC&lt;/EM&gt; column, that value in fact is '&lt;EM&gt;TA&lt;/EM&gt;' (see screen capture).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107677iA757D4A3137D5F7C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Untitled.png" alt="Untitled.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Untitled1.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107678i50E39179025C629B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Untitled1.png" alt="Untitled1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The error message when run with a value of &lt;EM&gt;'Average/Typical&lt;/EM&gt;' is like this (and there was no &lt;EM&gt;Dunnett&lt;/EM&gt; test results (there was only results for &lt;EM&gt;tukey&lt;/EM&gt; test).&lt;/P&gt;
&lt;PRE&gt; 73         ods select lsmeans diff diffplot controlplot;
 74         proc glm data=STAT1.ameshousing3
 75                  plots(only)=(diffplot(center) controlplot);
 76             class Heating_QC;
 77             model SalePrice=Heating_QC;
 78             lsmeans Heating_QC / pdiff=all
 79                                  adjust=tukey;
 80             lsmeans Heating_QC / pdiff=control('Average/Typical')
 81                                  adjust=dunnett;
 82             format Heating_QC $Heating_QC.;
 83             title "Post-Hoc Analysis of ANOVA - Heating Quality as Predictor";
 84         run;
 
&lt;FONT color="#FF0000"&gt; ERROR: Cannot find control level for effect Heating_QC.&lt;/FONT&gt;
 85         quit;&lt;/PRE&gt;
&lt;P&gt;The code works when change the value to '&lt;EM&gt;TA&lt;/EM&gt;' and produces the results of &lt;EM&gt;Dunnett&lt;/EM&gt; test.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics;
ods select lsmeans diff diffplot controlplot;
proc glm data=STAT1.ameshousing3 
         plots(only)=(diffplot(center) controlplot);
    class Heating_QC;
    model SalePrice=Heating_QC;
    lsmeans Heating_QC / pdiff=all 
                         adjust=tukey;
    lsmeans Heating_QC / pdiff=control('TA') 
                         adjust=dunnett;
    format Heating_QC $Heating_QC.;
    title "Post-Hoc Analysis of ANOVA - Heating Quality as Predictor";
run;
quit;
title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dxiao2017_0-1749223051210.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107679i87194EB96DBFA40A/image-size/large?v=v2&amp;amp;px=999" role="button" title="dxiao2017_0-1749223051210.png" alt="dxiao2017_0-1749223051210.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 15:20:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968342#M48675</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-06-06T15:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: question about lsmean pdiff=;option in proc glm step, st102d03, SAS STAT1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968344#M48676</link>
      <description>&lt;P&gt;Yes, you should specify only valid formatted values for the PDIFF=CONTROL option.&amp;nbsp; It looks like it is coded/formatted as TA so that should be the value.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 15:23:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968344#M48676</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2025-06-06T15:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: question about lsmean pdiff=;option in proc glm step, st102d03, SAS STAT1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968348#M48677</link>
      <description>&lt;P&gt;However, my test result is different from the results in course video (see screen capture), do I get different dataset?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dxiao2017_0-1749224168759.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107680i95ABB0FE551B1441/image-size/large?v=v2&amp;amp;px=999" role="button" title="dxiao2017_0-1749224168759.png" alt="dxiao2017_0-1749224168759.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 15:36:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968348#M48677</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-06-06T15:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: question about lsmean pdiff=;option in proc glm step, st102d03, SAS STAT1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968349#M48678</link>
      <description>&lt;P&gt;The ordering of the tables is different, but I do not see a difference in the values.&amp;nbsp; The table will automatically be ordered according to the sort order of the formatted values.&amp;nbsp; I suspect if you were running an example that you missed some Proc FORMAT code which set those values you tried to use initially and are shown in the other table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 15:41:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968349#M48678</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2025-06-06T15:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: question about lsmean pdiff=;option in proc glm step, st102d03, SAS STAT1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968350#M48679</link>
      <description>&lt;P&gt;Hi, As you have noticed, the datasets in the ST1 course use formats. Formats allow you to print different values than the values stored in the dataset. Often, formatted values are longer and more descriptive than the actual data values. In your case, the actual data value stored in the dataset is "TA", and its formatted version is "Average/Typical".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code doesn't work because the $Heating_QC format is not defined. Make sure you have defined the $Heating_QC format (and all the formats in general) every time you open up SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do that by running the program st100d05.sas every time you open us SAS. This calls programs st100d01.sas - st100d04.sas, which define the datasets and formats.&lt;BR /&gt;&lt;BR /&gt;Your code should work as originally written with "Average/Typical" once the formats are defined.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 15:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968350#M48679</guid>
      <dc:creator>JackieJ_SAS</dc:creator>
      <dc:date>2025-06-06T15:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: question about lsmean pdiff=;option in proc glm step, st102d03, SAS STAT1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968352#M48680</link>
      <description>&lt;P&gt;Thanks a lot&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/284679"&gt;@JackieJ_SAS&lt;/a&gt;&amp;nbsp;! So the reason was I did not run the &lt;EM&gt;format&lt;/EM&gt;&amp;nbsp;program before I did that question. In fact I noticed the &lt;EM&gt;format;&lt;/EM&gt; statement in the code and knew the format was not applied, and I have even tried &lt;EM&gt;options fmtsearch=(stat1);&lt;/EM&gt; and did not work, then I had a wrong conclusion that &lt;EM&gt;lsmean pdiff=;&lt;/EM&gt; statement does not allow a formatted value and need the original values. I'll run st100d05 and see the results for that question&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;, again, thanks a lot for let me know this, really helpful!&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>Fri, 06 Jun 2025 16:28:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968352#M48680</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-06-06T16:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: question about lsmean pdiff=;option in proc glm step, st102d03, SAS STAT1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968354#M48681</link>
      <description>&lt;P&gt;Awesome! I'm glad the response helped!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Regarding your comment about the FMTSEARCH option.. The st100d05.sas program saves the formats to a format library named work.formats, not stat1.formats. That is why your FMTSEARCH option code did not work. (Though- it's cool that you tried!)&lt;BR /&gt;&lt;BR /&gt;You can list all the formats in a particular library (and convince yourself that work.formats exists) by running this code below after you have run the st100d05.sas program. This prints all the formats in work.formats to the results window:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format fmtlib library=work.formats;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you try running the code above, but you insert "stat1.formats" for "work.formats", the code throws an error, since stat1.formats does not exist.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;This is a bit too much information, but if you would like to save the STAT1 formats permanently, you can run the program st100d05.sas then run the program below. This copies the file "work.formats" to a file "formats.sas7bcat" that is located in the STAT1 Data folder.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc catalog catalog = work.formats;
  copy out = stat1.formats;
  run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, instead of having to run st100d05.sas every time you open SAS, you can use this code below in order to access the stat1.formats format catalog. This is the same code you mentioned in your reply:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options fmtsearch = (stat1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Good luck with the course!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 18:28:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968354#M48681</guid>
      <dc:creator>JackieJ_SAS</dc:creator>
      <dc:date>2025-06-06T18:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: question about lsmean pdiff=;option in proc glm step, st102d03, SAS STAT1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968380#M48685</link>
      <description>&lt;P&gt;Thanks a lot for this information! I will need to learn and try these steps (save my formats in particular library and re-use them) in near future I think! Thank you and all then best&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jun 2025 13:32:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968380#M48685</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-06-07T13:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: question about lsmean pdiff=;option in proc glm step, st102d03, SAS STAT1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968381#M48686</link>
      <description>Thanks a lot for your information and help, Rob!</description>
      <pubDate>Sat, 07 Jun 2025 13:34:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968381#M48686</guid>
      <dc:creator>dxiao2017</dc:creator>
      <dc:date>2025-06-07T13:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: question about lsmean pdiff=;option in proc glm step, st102d03, SAS STAT1</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968382#M48687</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/284679"&gt;@JackieJ_SAS&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then, instead of having to run st100d05.sas every time you open SAS, you can use this code below in order to access the stat1.formats format catalog. This is the same code you mentioned in your reply:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options fmtsearch = (stat1);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Good luck with the course!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Note that over the years SAS made it easier to update the values of options like FMTSEARCH that take a list of values by adding the APPEND and INSERT options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So to add the STAT1.FORMATS catalog to the end of the FMTSEARCH list of catalogs use one of these two statements.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options append=fmtsearch=stat1;
options append=fmtsearch=stat1.formats;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should end up with FMTSEARCH option that looks like this:&lt;/P&gt;
&lt;PRE&gt;293  %put %sysfunc(getoption(fmtsearch));
(WORK LIBRARY STAT1)
&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_063/lesysoptsref/p1q9ay0ai0h2ein1n68qxomnm3q7.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/v_063/lesysoptsref/p1q9ay0ai0h2ein1n68qxomnm3q7.htm&lt;/A&gt;&lt;/P&gt;
&lt;H2 class="xisDoc-title"&gt;Comparisons&lt;/H2&gt;
&lt;P class="xisDoc-paragraph"&gt;The APPEND= system option adds a new value to the end of the current value of the AUTOEXEC, CMPLIB, FMTSEARCH, SASHELP, MSG, MAPSGFK, SASAUTOS, SASSCRIPT, or SET system options. The INSERT= system option adds a new value as the first value of one of these system options.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jun 2025 16:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/question-about-lsmean-pdiff-option-in-proc-glm-step-st102d03-SAS/m-p/968382#M48687</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-06-07T16:19:20Z</dc:date>
    </item>
  </channel>
</rss>

