<?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: combine the LSMEANS and differences in LSMEANS from Proc GLIMMIX in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/combine-the-LSMEANS-and-differences-in-LSMEANS-from-Proc-GLIMMIX/m-p/668345#M31913</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/155173"&gt;@SAS_Rob&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is sweet! I have spent years (literally) trying to figure out how to get MIANALYZE to handle mixed model stuff.&amp;nbsp; The answer is to get the results in which you are interested _by_ IMPUTATION in an ODS dataset, and then combine those.&amp;nbsp; It eliminates the transfer of covariance matrices which I never get right.&amp;nbsp; This is going to really help analysis of repeated measures where data are MNAR.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 12:20:20 GMT</pubDate>
    <dc:creator>SteveDenham</dc:creator>
    <dc:date>2020-07-10T12:20:20Z</dc:date>
    <item>
      <title>combine the LSMEANS and differences in LSMEANS from Proc GLIMMIX</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/combine-the-LSMEANS-and-differences-in-LSMEANS-from-Proc-GLIMMIX/m-p/666264#M31903</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm struggling to figure out how to combine LSMEANS differences from an analysis following multiple imputations. I think I have the right ODS OUTPUT statements to get the estimates but I'm not quite sure how to combine them using PROC MIANALYZE. I'm attempting to get the differences (comparisons) for the interaction term toradol*ibu along with the OR and 95% CLs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC GLIMMIX DATA=mi_xfer_analysis METHOD=RSPL NOCLPRINT;
	BY _imputation_; 
	CLASS hospital_number  toradol (ref='0') insurance (ref = '0') sex  ethnicity (ref = '2') race (ref = '1') region (ref = '3') open_surgery (ref='0')  ibu (ref='0');
	MODEL b_xfer30 (EVENT='1') = toradol ibu toradol*ibu sex race ethnicity insurance age_at_surgery year_of_surgery open_surgery region  / CL DIST=BINARY LINK=LOGIT SOLUTION
	ODDSRATIO (DIFF=FIRST LABEL);
	RANDOM RESIDUAL;
	RANDOM INTERCEPT / SUBJECT=hospital_number TYPE=VC SOLUTION CL g;

LSMEANS toradol ibu toradol*ibu / diff oddsratio cl;
ods output parameterestimates=parms3 solutionr=rand_parms3;
ods output lsmeans=lsmeans_ds;
ods output diffs=diff;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I tried adapting some code from a simple PROC MIXED example, however I'm interested in the interaction differences.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; 
*Example code that needs to be adjusted to work. 

proc sort data=lsmeans_ds;
      by toradol ibu _imputation_;
      run;
   proc mianalyze data=lsmeans_ds;
      by toradol ibu;
      modeleffects estimate;
      stderr stderr;
      run;

data diff2;
      set diff;
      comparison=toradol*ibu||' vs '||left(_toradol _ibu);
      run;
   
   proc sort data=diff2;
      by comparison _imputation_;
      run;
   
   proc mianalyze data=diff2;
      by comparison;
      modeleffects estimate;
      stderr stderr;
      run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hopefully I've provided enough details but let me know if any additional info would be helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 05:23:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/combine-the-LSMEANS-and-differences-in-LSMEANS-from-Proc-GLIMMIX/m-p/666264#M31903</guid>
      <dc:creator>Shad</dc:creator>
      <dc:date>2020-07-01T05:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: combine the LSMEANS and differences in LSMEANS from Proc GLIMMIX</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/combine-the-LSMEANS-and-differences-in-LSMEANS-from-Proc-GLIMMIX/m-p/668237#M31904</link>
      <description>&lt;P&gt;Moved to STAT forum in the hope you'll get an answer there.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 02:02:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/combine-the-LSMEANS-and-differences-in-LSMEANS-from-Proc-GLIMMIX/m-p/668237#M31904</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-07-10T02:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: combine the LSMEANS and differences in LSMEANS from Proc GLIMMIX</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/combine-the-LSMEANS-and-differences-in-LSMEANS-from-Proc-GLIMMIX/m-p/668327#M31911</link>
      <description>&lt;P&gt;You were on the right track, but you will need to set up the COMPARISON variable in the data set differently.&amp;nbsp; Here is an example you can follow as a template.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data outmi;&lt;BR /&gt;do _imputation_=1 to 3;&lt;BR /&gt;do trt='test','trt1','trt2';&lt;BR /&gt;do b=1 to 3;&lt;BR /&gt;do rep=1 to 10;&lt;BR /&gt;trtn+1;&lt;BR /&gt;y=1.3+.86*trtn+b*trtn+rannor(123);&lt;BR /&gt;output;&lt;BR /&gt;end; end; end;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc glimmix data=outmi;&lt;BR /&gt;by _imputation_;&lt;BR /&gt;class trt b;&lt;BR /&gt;model y=trt|b;&lt;BR /&gt;lsmeans trt|b/diff;&lt;BR /&gt;ods output diffs=lsmeans_diffs;&lt;BR /&gt;run; &lt;BR /&gt;data diff2;&lt;BR /&gt;set lsmeans_diffs;&lt;BR /&gt;comparison=trt||''||trim(left(b))||' vs '||left(_trt)||''||left(_b);&lt;BR /&gt;run;&lt;BR /&gt;proc sort data=diff2;&lt;BR /&gt;by comparison _imputation_;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc mianalyze data=diff2;&lt;BR /&gt;by comparison;&lt;BR /&gt;modeleffects estimate;&lt;BR /&gt;stderr stderr;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 11:20:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/combine-the-LSMEANS-and-differences-in-LSMEANS-from-Proc-GLIMMIX/m-p/668327#M31911</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2020-07-10T11:20:49Z</dc:date>
    </item>
    <item>
      <title>Re: combine the LSMEANS and differences in LSMEANS from Proc GLIMMIX</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/combine-the-LSMEANS-and-differences-in-LSMEANS-from-Proc-GLIMMIX/m-p/668345#M31913</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/155173"&gt;@SAS_Rob&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That is sweet! I have spent years (literally) trying to figure out how to get MIANALYZE to handle mixed model stuff.&amp;nbsp; The answer is to get the results in which you are interested _by_ IMPUTATION in an ODS dataset, and then combine those.&amp;nbsp; It eliminates the transfer of covariance matrices which I never get right.&amp;nbsp; This is going to really help analysis of repeated measures where data are MNAR.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 12:20:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/combine-the-LSMEANS-and-differences-in-LSMEANS-from-Proc-GLIMMIX/m-p/668345#M31913</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-07-10T12:20:20Z</dc:date>
    </item>
  </channel>
</rss>

