<?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 do I overlay plots with effectplot command in proc genmod (e.g., multiple &amp;quot;sliceby&amp;amp; in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-overlay-plots-with-effectplot-command-in-proc-genmod-e/m-p/410909#M21501</link>
    <description>&lt;P&gt;Thank you for your helpful reply. I do not have much experience with sgplot but I will give this a try.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are aware of an example of this&amp;nbsp;being done, please share!&lt;/P&gt;</description>
    <pubDate>Mon, 06 Nov 2017 16:17:02 GMT</pubDate>
    <dc:creator>jrbrauer</dc:creator>
    <dc:date>2017-11-06T16:17:02Z</dc:date>
    <item>
      <title>How do I overlay plots with effectplot command in proc genmod (e.g., multiple "sliceby" options)?</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-overlay-plots-with-effectplot-command-in-proc-genmod-e/m-p/410544#M21499</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to show predicted event rates for Y by X at two different values of Z1 and two different values of Z2 in a single plot using "effectplot" in proc genmod. I can plot at&amp;nbsp;two different values of Z1 (or Z2) using the "sliceby" command, and I can&amp;nbsp;compare these curves across two different values of Z2 (or Z1) across two different plots by adding a "plotby" command.&amp;nbsp;Is there any way to stack or overlay these two plots in SAS? Conceptually, I think it would be equivalent to simultaneously requesting two "sliceby" commands, though that does not appear to be a possibility.&amp;nbsp;Here is an example of my code:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods graphics on ;&lt;BR /&gt;proc genmod data=tempd plots=(resraw resdev); &lt;BR /&gt; model prjdlqad = female age16p famsplit famstep famoth finsesza acachfs &lt;BR /&gt; impulsza allblfza morctxza impulsza*allblfza impulsza*morctxza allblfza*morctxza &lt;BR /&gt; / dist=nb link=log; store nbmodel1; run;&lt;BR /&gt; ods html style=statistical ; &lt;BR /&gt; title "Impulsivity &amp;amp; Projected Delinquency, by Moral Beliefs &amp;amp; Context";&lt;BR /&gt; proc plm source=nbmodel1;&lt;BR /&gt; effectplot slicefit(x=impulsza sliceby=allblfza= -8.12 8.12 plotby=morctxza= -4.42 4.42) &lt;BR /&gt; / CLM at(female=0 age16p=0 famsplit=0 famstep=0 famoth=0); &lt;BR /&gt; run;&lt;BR /&gt; ods graphics off;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for any help!&lt;/P&gt;
&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2017 15:06:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-overlay-plots-with-effectplot-command-in-proc-genmod-e/m-p/410544#M21499</guid>
      <dc:creator>jrbrauer</dc:creator>
      <dc:date>2017-11-04T15:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I overlay plots with effectplot command in proc genmod (e.g., multiple "sliceby&amp;quot</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-overlay-plots-with-effectplot-command-in-proc-genmod-e/m-p/410650#M21500</link>
      <description>&lt;P&gt;One way I could think is useing ODS TRACE to get the name of graphic and using ODS OUTPUT to get their data and finally using proc sgplot to overlap the graphic.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Nov 2017 10:12:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-overlay-plots-with-effectplot-command-in-proc-genmod-e/m-p/410650#M21500</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-11-05T10:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I overlay plots with effectplot command in proc genmod (e.g., multiple "sliceby&amp;</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-overlay-plots-with-effectplot-command-in-proc-genmod-e/m-p/410909#M21501</link>
      <description>&lt;P&gt;Thank you for your helpful reply. I do not have much experience with sgplot but I will give this a try.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are aware of an example of this&amp;nbsp;being done, please share!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2017 16:17:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-overlay-plots-with-effectplot-command-in-proc-genmod-e/m-p/410909#M21501</guid>
      <dc:creator>jrbrauer</dc:creator>
      <dc:date>2017-11-06T16:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I overlay plots with effectplot command in proc genmod (e.g., multiple "sliceby&amp;</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-overlay-plots-with-effectplot-command-in-proc-genmod-e/m-p/411176#M21520</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods trace on;
          ods output FitPlot=plot;
          proc genmod data=sashelp.class;
          model sex=age weight height;
          effectplot fit(x=age);
         run;
  ods trace off;
        
         proc sgplot data=plot;
          band x=_xcont1 lower=_lclm upper=_uclm;
          series x=_xcont1 y=_predicted/lineattrs=(color=red);
          run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Nov 2017 13:41:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-overlay-plots-with-effectplot-command-in-proc-genmod-e/m-p/411176#M21520</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-11-07T13:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I overlay plots with effectplot command in proc genmod (e.g., multiple "sliceby&amp;</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-overlay-plots-with-effectplot-command-in-proc-genmod-e/m-p/411191#M21525</link>
      <description>&lt;P&gt;Thank you! This is exactly what I needed. After your initial post, I was able&amp;nbsp;to save the predicted values using ods&amp;nbsp;output. Then, I created a new "group" variable using the "_plotby" and "_group" variables and modified the sgplot code you provided here by adding "/group=z" after the series.&amp;nbsp;Now I just need to learn how to tweak the colors! Here is the full code in case anyone else ever has this question:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods graphics on ; ods trace on;&lt;BR /&gt;proc genmod data=tempd plots=(resraw resdev); &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;model prjdlqad = female age16p famsplit famstep famoth finsesza acachfs &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;impulsza allblfza morctxza impulsza*allblfza impulsza*morctxza allblfza*morctxza &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;/ dist=nb link=log; store nbmodel1; run;&lt;BR /&gt; ods listing style=statistical; &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;title "Impulsivity &amp;amp; Projected Delinquency, by Moral Beliefs &amp;amp; Context";&lt;BR /&gt; proc plm source=nbmodel1;&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;effectplot slicefit(x=impulsza sliceby=allblfza= -8.12 8.12 plotby=morctxza= -4.42 4.42) &lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;/ CLM at(female=0 age16p=0 famsplit=0 famstep=0 famoth=0) ;&lt;BR /&gt;ods output SliceFitPanel = mygraph;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data mygraph2; set mygraph;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;if _plotby = "morctxza=-4.42" &amp;amp; _group = -8.12 then morfiltr = 1;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;if _plotby = "morctxza=-4.42" &amp;amp; _group = 8.12 then morfiltr = 2;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;if _plotby = "morctxza=4.42" &amp;amp; _group = -8.12 then morfiltr = 3;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if _plotby = "morctxza=4.42" &amp;amp; _group = 8.12 then morfiltr = 4;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data=mygraph2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;title "Impulsivity &amp;amp; Projected Delinquency, by Moral Beliefs &amp;amp; Context";&lt;BR /&gt;&amp;nbsp; &amp;nbsp;band x=_xcont1 lower=_lclm upper=_uclm / group=morfiltr;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;series x=_xcont1 y=_predicted/group=morfiltr lineattrs=(color=red);&lt;BR /&gt; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again. I really appreciate the help!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 14:20:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-do-I-overlay-plots-with-effectplot-command-in-proc-genmod-e/m-p/411191#M21525</guid>
      <dc:creator>jrbrauer</dc:creator>
      <dc:date>2017-11-07T14:20:21Z</dc:date>
    </item>
  </channel>
</rss>

