<?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 output the LSMEANS differences? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-LSMEANS-differences/m-p/804264#M316701</link>
    <description>Thank you for giving me this link, it was helpful!</description>
    <pubDate>Sat, 26 Mar 2022 14:10:13 GMT</pubDate>
    <dc:creator>Hello_there</dc:creator>
    <dc:date>2022-03-26T14:10:13Z</dc:date>
    <item>
      <title>How to output the LSMEANS differences?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-LSMEANS-differences/m-p/804136#M316632</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm running a model in proc GLM.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That looks something like this:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;PROC GLM data=a;
  by subject;
class activity;
model cont_var=activity;
lSMEANS activity / adjust = Tukey out=b;
run; quit;
&lt;/PRE&gt;
&lt;P&gt;The activities are a. (reference), b., c., d.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The current code only outputs cont_var LSMEANS and the p values for the difference from a.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would I be able to output the LSMEANS difference from a?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 16:32:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-LSMEANS-differences/m-p/804136#M316632</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2022-03-25T16:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to output the LSMEANS differences?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-LSMEANS-differences/m-p/804151#M316638</link>
      <description>This sounds like a job for the ODS tables, which allow you to export certain statistics from PROC GLM to an output data set.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_glm_details70.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_glm_details70.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;E.g., you might be looking to add a line like this to your code:&lt;BR /&gt;ods output LSMeans=LSMEANS_diffs;</description>
      <pubDate>Fri, 25 Mar 2022 17:52:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-LSMEANS-differences/m-p/804151#M316638</guid>
      <dc:creator>svh</dc:creator>
      <dc:date>2022-03-25T17:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to output the LSMEANS differences?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-LSMEANS-differences/m-p/804152#M316639</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this what you are after?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*ods trace on;
*ods output Diff=work.Difference_Matrix;
ods output  LSMeans=work.LSMeans;

PROC GLM data=sashelp.class;
*by subject;
class age;
model height=age;
LSMEANS age / adjust = Tukey out=b;
run; 
quit;

data work.LSMeans_DIFF;
 set work.LSMeans;
 retain ref .;
 if _N_=1 then do; ref=LSMean; end;
 Diff = LSMean - ref;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Fri, 25 Mar 2022 17:54:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-LSMEANS-differences/m-p/804152#M316639</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2022-03-25T17:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to output the LSMEANS differences?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-LSMEANS-differences/m-p/804264#M316701</link>
      <description>Thank you for giving me this link, it was helpful!</description>
      <pubDate>Sat, 26 Mar 2022 14:10:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-LSMEANS-differences/m-p/804264#M316701</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2022-03-26T14:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to output the LSMEANS differences?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-LSMEANS-differences/m-p/804265#M316702</link>
      <description>Thanks, this worked!</description>
      <pubDate>Sat, 26 Mar 2022 14:10:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-LSMEANS-differences/m-p/804265#M316702</guid>
      <dc:creator>Hello_there</dc:creator>
      <dc:date>2022-03-26T14:10:36Z</dc:date>
    </item>
  </channel>
</rss>

