<?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 proc mixed in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-mixed/m-p/851697#M336651</link>
    <description>&lt;P&gt;I run a mixed model according to the PROC MIXED step in SAS. My code is like this below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;proc mixed data=inds;
   class subject arm(ref='C组（对照组）') ;
   model aval =base arm avisitn arm*avisitn /s ;
   random subject ;
   repeated /  subject=subject ;
   lsmeans arm / diff cl at avisitn=0;
   lsmeans arm / diff cl at avisitn=1;
   lsmeans arm / diff cl at avisitn=2;
   ods output  diffs=diff ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then I change the variable in the model option at the left side of the equation like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;proc mixed data=inds;
   class subject arm(ref='C组（对照组）') ;
   model chg =base arm avisitn arm*avisitn /s;
   random subject ;
   repeated / subject=subject ;
/*   lsmeans arm / pdiff cl at avisitn=0;*/
   lsmeans arm / pdiff cl at avisitn=1;
   lsmeans arm / pdiff cl at avisitn=2;
   ods output  diffs=diff1 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I just change the variable from the value at each time point to the change from baseline. Then I find that the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Differences of Least Squares Means&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is the same. I do not know how this works. Can anyone tell me why?&lt;/P&gt;&lt;P&gt;A explanation from the model and a suggestion from the code so that I can see why I get the same results.&lt;/P&gt;</description>
    <pubDate>Sat, 31 Dec 2022 14:33:46 GMT</pubDate>
    <dc:creator>XixiHaha</dc:creator>
    <dc:date>2022-12-31T14:33:46Z</dc:date>
    <item>
      <title>proc mixed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-mixed/m-p/851697#M336651</link>
      <description>&lt;P&gt;I run a mixed model according to the PROC MIXED step in SAS. My code is like this below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;proc mixed data=inds;
   class subject arm(ref='C组（对照组）') ;
   model aval =base arm avisitn arm*avisitn /s ;
   random subject ;
   repeated /  subject=subject ;
   lsmeans arm / diff cl at avisitn=0;
   lsmeans arm / diff cl at avisitn=1;
   lsmeans arm / diff cl at avisitn=2;
   ods output  diffs=diff ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then I change the variable in the model option at the left side of the equation like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;proc mixed data=inds;
   class subject arm(ref='C组（对照组）') ;
   model chg =base arm avisitn arm*avisitn /s;
   random subject ;
   repeated / subject=subject ;
/*   lsmeans arm / pdiff cl at avisitn=0;*/
   lsmeans arm / pdiff cl at avisitn=1;
   lsmeans arm / pdiff cl at avisitn=2;
   ods output  diffs=diff1 ;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I just change the variable from the value at each time point to the change from baseline. Then I find that the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Differences of Least Squares Means&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is the same. I do not know how this works. Can anyone tell me why?&lt;/P&gt;&lt;P&gt;A explanation from the model and a suggestion from the code so that I can see why I get the same results.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2022 14:33:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-mixed/m-p/851697#M336651</guid>
      <dc:creator>XixiHaha</dc:creator>
      <dc:date>2022-12-31T14:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc mixed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-mixed/m-p/851709#M336654</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/438057"&gt;@XixiHaha&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I just change the variable from the value at each time point to the change from baseline. Then I find that the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Differences of Least Squares Means&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is the same. I do not know how this works. Can anyone tell me why?&lt;/P&gt;
&lt;P&gt;A explanation from the model and a suggestion from the code so that I can see why I get the same results.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It would help if you showed us the two outputs so we can see for ourselves what you are seeing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nevertheless, if all you did was change from the value at each time point to the change from baseline, then differences of Least Squares Means won't change. This is simple algebra. You have just subtracted a constant value from the values. Your original differences were&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Mean of AVAL at level 1) – (Mean of AVAL at level 2)&amp;nbsp;&amp;nbsp; &amp;lt;== first formula&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and now they are&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;((Mean of AVAL at level 1) – baseline) – ((Mean of AVAL at level 2) – baseline) &amp;lt;= second formula&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Homework assignment for you ... show that the result of the first formula is exactly equal to the result of the second formula using algebra&lt;/P&gt;</description>
      <pubDate>Sat, 31 Dec 2022 18:53:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-mixed/m-p/851709#M336654</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-31T18:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: proc mixed</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-mixed/m-p/851743#M336671</link>
      <description>Thanks.</description>
      <pubDate>Sun, 01 Jan 2023 14:23:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-mixed/m-p/851743#M336671</guid>
      <dc:creator>XixiHaha</dc:creator>
      <dc:date>2023-01-01T14:23:39Z</dc:date>
    </item>
  </channel>
</rss>

