<?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: Generating plots for mixed-effect models (group, time, interaction terms) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Generating-plots-for-mixed-effect-models-group-time-interaction/m-p/891586#M352209</link>
    <description>&lt;P&gt;Hey so the dataset anova_analysis2023 is not included in the post. Hope this link helps&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2018/12/19/visualize-mixed-model.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2018/12/19/visualize-mixed-model.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Aug 2023 20:00:22 GMT</pubDate>
    <dc:creator>Seadrago</dc:creator>
    <dc:date>2023-08-29T20:00:22Z</dc:date>
    <item>
      <title>Generating plots for mixed-effect models (group, time, interaction terms)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-plots-for-mixed-effect-models-group-time-interaction/m-p/890287#M351778</link>
      <description>&lt;P&gt;Hello, I am trying to figure out how to generate plots from mixed-effects models from SAS. I am interested to see whether group show statistical differences on outcomes (measured at t0 and t2) at different time points (t0 and t2). Specifically, I am looking for a plot similar to ggeffects in R with predicted means, values between these two groups.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see the SAS codes below for the mixed-effect models. I tried several codes online (e.g., effect plot in the PROC PLM) but unable to generate the plots. Ideally, the plot will show timepoints at x-axis, pi/pdi at y-axis (they are the same measurement related at two points), and different lines representing two groups (variable BRIGHT).&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;DATA Mixed1;
	SET anova_analysis2023;
	ARRAY A1{*} pit0 pdit2;
	DO TMP = 1 to 2; 
		TMPV = VNAME(A1{TMP});
		AVAL = A1{TMP};
		OUTPUT;
	END;
RUN;

PROC MIXED DATA = Mixed1;
	CLASS ID TMP(ref="1") BRIGHT(ref="0") POC/*IF CATEGORICAL COVARIATES ADD HERE*/;
	MODEL AVAL = TMP|BRIGHT POC other_op_inlife_t0/*IF CONTINUOUS COVARIATES HERE*/ / S E1 E2;
	REPEATED TMP / SUBJECT = ID TYPE = UN RCORR;
	LSMEANS TMP TMP*BRIGHT / CL DIFFS;
	TITLE1 “Mixed Model (Interaction) between group (BRIGHT) and Time”;
RUN;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Some of the codes I have tested are as follows. Maybe I need to combine pit0 and pdit2 into one variable? Thanks for any advice.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc plm restore=PIPDIModel;                   /* use item store to create fit plots */
   effectplot fit(x=TMP plotby=BRIGHT);        /* panel */
   effectplot slicefit(x=TMP sliceby=BRIGHT);  /* overlay */
run;

proc sgplot data=Mixed1;
   scatter x=TMP y=AVAL / group=BRIGHT;
   series x=TMP y=AVAL / groupLC=BRIGHT curvelabel;
   legenditem type=line name="E" / label="Experiment" lineattrs=GraphData1; 
   legenditem type=line name="C" / label="Control" lineattrs=GraphData2(pattern=dash); 
   keylegend "E" "C";
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Aug 2023 19:45:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-plots-for-mixed-effect-models-group-time-interaction/m-p/890287#M351778</guid>
      <dc:creator>SpongeEvan</dc:creator>
      <dc:date>2023-08-21T19:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Generating plots for mixed-effect models (group, time, interaction terms)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Generating-plots-for-mixed-effect-models-group-time-interaction/m-p/891586#M352209</link>
      <description>&lt;P&gt;Hey so the dataset anova_analysis2023 is not included in the post. Hope this link helps&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2018/12/19/visualize-mixed-model.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2018/12/19/visualize-mixed-model.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 20:00:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Generating-plots-for-mixed-effect-models-group-time-interaction/m-p/891586#M352209</guid>
      <dc:creator>Seadrago</dc:creator>
      <dc:date>2023-08-29T20:00:22Z</dc:date>
    </item>
  </channel>
</rss>

