<?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: proc plm plotting interactions in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786508#M38563</link>
    <description>&lt;P&gt;That is not the same model.&amp;nbsp; I need to include SEX in the model; of course the pred values change if I do not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the model with the four predictors, but then plot the 3-way interaction.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Dec 2021 16:26:35 GMT</pubDate>
    <dc:creator>emaneman</dc:creator>
    <dc:date>2021-12-17T16:26:35Z</dc:date>
    <item>
      <title>proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785624#M38533</link>
      <description>&lt;P&gt;hello all.&lt;/P&gt;&lt;P&gt;I could use some help with plotting interactions and a main effect with proc plm, from a store produced with proc mixed.&lt;/P&gt;&lt;P&gt;The syntax is included.&lt;/P&gt;&lt;P&gt;The effectplot in the PLM gives me the three way interaction plotted as i want, but only for males (sesso=m)&amp;nbsp; -- see attached image.&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that since categorical variable sesso is in the model, proc plm chooses to plot the requested interaction at one of the two levels of it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I get PLM to plot the three way interaction between the three other variables (two continuous and one categorical) for the whole sample, that is, for men and women together?&amp;nbsp; I attach a figure of the current output, and the SAS syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc mixed ic data=mls2;
class id gruppo2 scuola classe luogo sesso;
model cas2= 	gruppo2|cas1|sesso|ageyears;
Random intercept  /subject=classe;
Random intercept  /subject=scuola;
Random intercept  /subject=luogo;
lsmeans gruppo2 /pdiff;
store sunday2;
run;quit;


proc plm source=sunday2;
	   effectplot slicefit (x=cas1 sliceby=gruppo2 plotby=ageyears=-1 1)/ clm;
   
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-12-12 at 15.46.34.png" style="width: 906px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66671iC0195AC5565AB552/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-12-12 at 15.46.34.png" alt="Screenshot 2021-12-12 at 15.46.34.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Dec 2021 14:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785624#M38533</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-12-12T14:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785646#M38534</link>
      <description>&lt;P&gt;Either use an interaction in PLOTBY or use the AT option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;effectplot slicefit(x=cas1 sliceby=gruppo2 plotby=ageyears) / at(sesso=all);
effectplot slicefit(x=cas2 sliceby=gruppo2 plotby=ageyears*sesso);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 Dec 2021 20:16:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785646#M38534</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-12-12T20:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785648#M38535</link>
      <description>&lt;P&gt;using the / AT option gives me the plots by sex, not a single plot including both males and females.&lt;/P&gt;&lt;P&gt;the second suggestion does not work either, because ageyears is a continuous variable. But even if it worked, the problem would be the same, namely that it would give me different plots for males and females.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since I have no interaction effects involving sex, i would like the plots NOT to be divided by sex.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Dec 2021 20:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785648#M38535</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-12-12T20:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785650#M38536</link>
      <description>The vertical bars between all of the variables means you have several interactions involving sex. You have a choice of either separate plots or separate lines involving sex - the latter if you specify sliceby=gruppo*sesso.</description>
      <pubDate>Sun, 12 Dec 2021 20:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785650#M38536</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-12-12T20:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785653#M38537</link>
      <description>&lt;P&gt;What I mean is that no interaction involving sex is statistically significant. So I &lt;U&gt;do not want separate&lt;/U&gt; plots for the two sex levels.&lt;/P&gt;&lt;P&gt;Is there a way to do that?&lt;/P&gt;</description>
      <pubDate>Sun, 12 Dec 2021 21:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785653#M38537</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-12-12T21:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785654#M38538</link>
      <description>As long as sex is in the model it obviously must affect the predicted values. So, the only way an effect plot will not involve sex at all is to remove it from the model.</description>
      <pubDate>Sun, 12 Dec 2021 21:33:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785654#M38538</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-12-12T21:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785655#M38539</link>
      <description>&lt;P&gt;That is not the case. Even if sex were to have significant interaction effects, one may want to plot interaction effects between other variables for men and women together, not separately. This is easily achievable when the "third" variable is&amp;nbsp; continuous variable, either by default or by specifying the average level of the continuous variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Dec 2021 21:40:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785655#M38539</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-12-12T21:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785804#M38542</link>
      <description>&lt;P&gt;Since it's true that different predicted values are produced depending on the sex value, what you want amounts to averaging the two values from the two sexes at any given setting of the other variables. This isn't possible with the EFFECTPLOT statement. If all of the predictors were CLASS variables, then this could be relatively easy by specifying the 3-way interaction that omits sex in the LSMEANS statement, saving the predicted values with an ODS OUTPUT statement, and then creating the plot as desired using PROC SGPLOT. Since some of the variables are continuous, it would require some programming to generate a data set of settings to score, averaging the scores within each 3-way setting, and then plotting.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 17:13:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785804#M38542</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-12-13T17:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785884#M38544</link>
      <description>&lt;P&gt;Thank you Dave. I will indeed have to find a way around it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 20:56:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/785884#M38544</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-12-13T20:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786138#M38552</link>
      <description>&lt;P&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/208370?emcs_t=S2h8ZW1haWx8cG1fbm90aWZpY2F0aW9ufEtYN0VXNkRFQkdLNkRVfC0xfFBSSVZBVEVfTUVTU0FHRVN8aEs" target="_blank" rel="noopener"&gt;@Rick_SAS&amp;nbsp;&lt;/A&gt;&lt;SPAN&gt;do you have any advice?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 10:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786138#M38552</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-12-15T10:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786443#M38557</link>
      <description>&lt;P&gt;Yes, I suggest you post sample data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 11:42:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786443#M38557</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-12-17T11:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786450#M38558</link>
      <description>&lt;P&gt;Wonderful! Here you go, syntax and attached dataset in sas format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc mixed ic data=giunti.mls2;
class id Condition scuola classe luogo sex;
model cas2= 	Condition|cas1|sex|ageyears;
Random intercept  /subject=classe;
Random intercept  /subject=scuola;
Random intercept  /subject=luogo;
lsmeans Condition /pdiff cl;
store storecas;
run;quit;

proc plm source=storecas;
lsmeans Condition sex/cl  ;
lsmeans sex/cl;
   effectplot slicefit (x=cas1 sliceby=Condition plotby=ageyears=-1 1)/ clm ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Dec 2021 12:18:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786450#M38558</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-12-17T12:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786468#M38559</link>
      <description>&lt;P&gt;It sounds like you just want to overlay the graphs that you get with&amp;nbsp;@(sex='Male') and @(sex='Female')@@&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that is the case, you can do either of the following:&lt;/P&gt;
&lt;P&gt;1. Score the model on a uniform grid of CAS1 values. Use the OUTPREDM= option on the MODEL statement in PROC MIXED to output the predicted values. Use PROC SGPANEL to graph the results. The details are provided in the article &lt;A href="https://blogs.sas.com/content/iml/2018/12/19/visualize-mixed-model.html" target="_self"&gt;"Visualize a mixed model that has repeated measures or random coefficients."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2. &lt;A href="https://blogs.sas.com/content/iml/2012/08/01/data-fro-ods-graphics.html" target="_self"&gt;Use ODS OUTPUT to save the data model the underlies the graphs&lt;/A&gt; that are produced by the EFFECTPLOT statements. Merge the data.&amp;nbsp;Use PROC SGPANEL to graph the results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following implements the second approach. Hope this helps.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* save the prediction for males */
proc plm source=storecas;
ods output SliceFitPanel=Males;
effectplot slicefit (x=cas1 sliceby=Condition plotby=ageyears=-1 1)/ clm at(sex="Male");
run;
/* save the predictions for females */
proc plm source=storecas;
ods output SliceFitPanel=Females;
effectplot slicefit (x=cas1 sliceby=Condition plotby=ageyears=-1 1)/ clm at(sex="Female");
run;

/* merge the males and females; create a new Group variable that has four levels
   and combines the levels of the 'Condition' and 'Sex' groups */   
data AllSex;
length Sex $6 Group $21;  /* length(group)=length(Condition)+length(sex)+2 */
set Males(in=M) Females;
if M then Sex="Male  ";
else Sex = "Female";
Group = catx("; ", _Group, Sex); /* example: 'Control; Male' */
run;

title "Fit for CAS2";
proc sgpanel data=AllSex;
   panelby _PlotBY;
   band x=_XCont1 lower=_LCLM upper=_UCLM / group=Group transparency=0.5;
   series x=_XCont1 y=_Predicted / group=Group;
   rowaxis grid;
   colaxis grid;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Dec 2021 13:57:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786468#M38559</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-12-17T13:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786493#M38560</link>
      <description>&lt;P&gt;Hello Rick, and thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The second approach still gives me the slopes separately for males and females, and that is what I am trying to avoid. In other words, I want to plot a 3-way, not a 4-way interaction.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with first approach (OUTPRED), but THEN I need to specify the two panels as low and high age (ageyears -1 and 1, since it is standardized).&lt;/P&gt;&lt;P&gt;When I use the LSMEANS output it can be done, since i output LSmeans at&amp;nbsp; ageyears = -1 and 1. But when I used the OUTPRED, of course ageyears is still continous, and I do not think there is a way to use a continuous variable in PANELBY and have the two panels be specific values of the continuous variables.&amp;nbsp; &amp;nbsp;In the article&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2018/12/19/visualize-mixed-model.html" target="_self" rel="nofollow noopener noreferrer"&gt;"Visualize a mixed model that has repeated measures or random coefficients." &amp;nbsp;&lt;/A&gt;&amp;nbsp;there is no SGPANEL example. I can use SGPLOT (see syntax below), and it gives me the two way interaction between CONDITION&amp;nbsp; and CAS1 (see attached graph), but I cannot see how I could obtain the same two-way plotted separately for high (1) and low (-1) levels of the variable ageyears - which is what I need.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc SGPLOT data=pred;
 reg x=cas1 y=Pred / group=condition  clm ;
 /*how to specify i want the above separately for ageyears= -1 and ageyears = 1* ??/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 15:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786493#M38560</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-12-17T15:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786504#M38561</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&lt;/a&gt;&amp;nbsp;already answered this question. Please reread his responses. If you want to plot the predicted values when sex is ignored, use the following:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
ods exclude all;
proc mixed ic data=giunti.mls2;
class id Condition scuola classe luogo sex;
model cas2= 	Condition|cas1|ageyears;
Random intercept  /subject=classe;
Random intercept  /subject=scuola;
Random intercept  /subject=luogo;
lsmeans Condition /pdiff cl;
store storecasNOSEX;
run;quit;
ods exclude none;

/* save the prediction for males */
proc plm source=storecasNOSEX;
ods select SliceFitPanel;
effectplot slicefit (x=cas1 sliceby=Condition plotby=ageyears=-1 1)/ clm;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Dec 2021 16:13:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786504#M38561</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-12-17T16:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786506#M38562</link>
      <description>&lt;P&gt;To answer your most recent question: When you set up the data set that you use to score the model, first output the scoring data for ageyears=-1. Then repeat the output for ageyears=+1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use PROC SGPANEL or a BY statement to get separate graphs for each level.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc SGPLOT data=pred;
reg x=cas1 y=Pred / group=condition  clm ;
by ageyears;  /*how to specify i want the above separately */
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might want to read the following articles:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2017/12/18/visualize-multivariate-regression-models-by-slicing-continuous-variables.html" target="_self"&gt;Visualize multivariate regression models by slicing continuous variables&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2017/12/20/create-sliced-fit-plot-sas.html" target="_self"&gt;How to create a sliced fit plot in SAS&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I think the second article might be most similar to your situation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 16:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786506#M38562</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-12-17T16:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786508#M38563</link>
      <description>&lt;P&gt;That is not the same model.&amp;nbsp; I need to include SEX in the model; of course the pred values change if I do not.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need the model with the four predictors, but then plot the 3-way interaction.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 16:26:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786508#M38563</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-12-17T16:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786522#M38564</link>
      <description>&lt;P&gt;I am taking too much of your time...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I do not see how I could "&lt;/SPAN&gt;&lt;SPAN&gt;output the scoring data for ageyears=-1. Then repeat the output for ageyears=+1." using outpred. I can of course do this using LSMEANS, but then I run into the problem of not being able to "merge" men and women. I feel like I am in a catch 22!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 16:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786522#M38564</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-12-17T16:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786525#M38565</link>
      <description>&lt;P&gt;Show the code you are using the create the scoring data set and to evaluate the model on the scoring data.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 16:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786525#M38565</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-12-17T16:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: proc plm plotting interactions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786528#M38566</link>
      <description>&lt;P&gt;As I summarized in my Monday post, if you want the plot to not involve sex then you will need to average over the two predicted values from the two sexes within each combination of the other three predictors in the model. I laid out the general approach in that post. This code implements and produces the plot.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mixed ic data=mls2;
class id Condition scuola classe luogo sex;
model cas2= 	Condition|cas1|sex|ageyears;
Random intercept  /subject=classe;
Random intercept  /subject=scuola;
Random intercept  /subject=luogo;
store storecas;
run;quit;
data new; 
do condition='Reading Aloud','Control'; 
do sex='Female','Male'; 
do cas1=-3.5,0,3.5; 
do ageyears=-1,1; 
 output;
end; end; end; end; 
run;
proc plm restore=storecas;
score data=new out=out;
run;
proc means nway data=out; 
class condition cas1 ageyears; 
var predicted; 
output out=out2 mean=; 
run;
proc sgpanel; 
panelby ageyears;
series y=predicted x=cas1 / group=condition;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPanel11.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66832i44CE07EBE25D323F/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPanel11.png" alt="SGPanel11.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 16:54:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-plm-plotting-interactions/m-p/786528#M38566</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-12-17T16:54:00Z</dc:date>
    </item>
  </channel>
</rss>

