<?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: Overlay plots from two different Proc Logistic in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780583#M81220</link>
    <description>&lt;P&gt;that doesn't work well, but the syntax below works. I have to find a way not to print the single observations, and I am done!&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;data mdistant; set mdistant (keep= policy prd lowcl uppcl ); gruppo='distant';
data mclose; set mclose (keep= policy prd lowcl uppcl ); gruppo='close';

data tutti;
set mdistant mclose;

proc sort data=tutti; by gruppo;

proc sgplot data=tutti ;
reg x=policy y=prd / clm group=gruppo ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 16 Nov 2021 21:14:21 GMT</pubDate>
    <dc:creator>emaneman</dc:creator>
    <dc:date>2021-11-16T21:14:21Z</dc:date>
    <item>
      <title>Overlay plots from two different Proc Logistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780524#M81211</link>
      <description>&lt;P&gt;Dear all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running these two separate PROC LOGISTIC:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc logistic data=covid plots=effect ( clband=yes SHOWOBS=NO );&lt;BR /&gt;model close2 (event='1') = policy close1 identif igrcont ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc logistic data=covid plots=effect ( clband=yes SHOWOBS=NO );&lt;BR /&gt;model distant2 (event='1') = policy distant1 identif igrcont ;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see, the only difference is the criterion and one of the predictors in the model. The rest is identical. Below you can see the plots that I obtain for two models. I would like to know whether it is possible to combine them, in the same graph, ideally with different colors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-11-16 at 19.36.05.png" style="width: 930px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65774iC85D6C0A1765223C/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-11-16 at 19.36.05.png" alt="Screenshot 2021-11-16 at 19.36.05.png" /&gt;&lt;/span&gt;&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-11-16 at 19.32.01.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65773i4F74E363DBD5F6EF/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-11-16 at 19.32.01.png" alt="Screenshot 2021-11-16 at 19.32.01.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 18:37:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780524#M81211</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-11-16T18:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay plots from two different Proc Logistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780542#M81214</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would output data sets (#2) with predicted probs and conf. limits.&lt;/P&gt;
&lt;P&gt;Like here :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=sashelp.class plots=effect ( clband=yes SHOWOBS=NO );
 model sex(event='F') = _NUMERIC_;
 output out=work.toplot predicted=prd lower=lowcl upper=uppcl / ALPHA=0.10;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Then concatenate both output datasets vertically (make an extra binary variable to indicate which data set the observations are coming from (with the indsname= option for example)), then use PROC SGPLOT with grouping functionality to draw both lines.&lt;BR /&gt;&lt;BR /&gt;Can you do that or do you need help doing that?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 19:49:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780542#M81214</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-16T19:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay plots from two different Proc Logistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780576#M81218</link>
      <description>&lt;P&gt;hello Koen,&lt;/P&gt;&lt;P&gt;that's a good idea. I tried it, adding a category variable go use as a group in the new dataset containing the outputs of both proc logistic, but I am doing something wrong with SGPLOT. I used the SGPLOT syntax that I typically use with the output from the STORE function, so there's something I am missing. I attach my output.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc logistic data=covid plots=effect ( clband=yes SHOWOBS=NO );
model distant2 (event='1') = policy distant1 identif igrcont ;
output out = mdistant predicted=prd lower=lowcl upper=uppcl / ALPHA=0.05;
run;

proc logistic data=covid plots=effect ( clband=yes SHOWOBS=NO );
model close2 (event='1') = policy close1 identif igrcont ;
output out = mclose predicted=prd lower=lowcl upper=uppcl / ALPHA=0.05;
run;

data mdistant; set mdistant (keep= prd lowcl uppcl ); gruppo='distant';
data mdistant; set mclose (keep= prd lowcl uppcl ); gruppo='close';

data tutti;
set mdistant mclose;

proc sgplot data=tutti noautolegend;
band x=policy upper=uppcl lower=lowcl / transparency=0.5 group=gruppo;
series x=policy y=prd;
yaxis label=" " min=0 max=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Nov 2021 20:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780576#M81218</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-11-16T20:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay plots from two different Proc Logistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780580#M81219</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Try sthg. like this :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remark : I use NODUPKEY in PROC SORT because I have several IDs with same age.&lt;BR /&gt;This is just to make the plot "readable" and to prove to you this approach works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=sashelp.class plots=effect ( clband=yes SHOWOBS=NO ) noprint;
model sex (event='F') = _NUMERIC_ ;
output out = mdistant predicted=prd lower=lowcl upper=uppcl / ALPHA=0.05;
run;
proc logistic data=sashelp.class plots=effect ( clband=yes SHOWOBS=NO ) noprint;
model sex (event='M') = _NUMERIC_ ;
output out = mclose   predicted=prd lower=lowcl upper=uppcl / ALPHA=0.05;
run;

data tutti;
LENGTH gruppo $ 7;
set mdistant(in=int1) 
    mclose  (in=int2);
if int1 then gruppo='distant';
else if int2 then gruppo='close';
else;
run;

proc sort data=tutti NODUPKEY; by gruppo age; run; 
proc sgplot data=tutti noautolegend;
band    x=age upper=uppcl lower=lowcl / transparency=0.5 group=gruppo;
scatter x=age y=prd                   / group=gruppo;
series  x=age y=prd                   / group=gruppo;
yaxis label=" " min=0 max=1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 21:03:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780580#M81219</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-16T21:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay plots from two different Proc Logistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780583#M81220</link>
      <description>&lt;P&gt;that doesn't work well, but the syntax below works. I have to find a way not to print the single observations, and I am done!&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;data mdistant; set mdistant (keep= policy prd lowcl uppcl ); gruppo='distant';
data mclose; set mclose (keep= policy prd lowcl uppcl ); gruppo='close';

data tutti;
set mdistant mclose;

proc sort data=tutti; by gruppo;

proc sgplot data=tutti ;
reg x=policy y=prd / clm group=gruppo ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Nov 2021 21:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780583#M81220</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-11-16T21:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay plots from two different Proc Logistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780585#M81221</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-11-16 at 22.14.37.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65779i2DFCFE505EA07AFA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-11-16 at 22.14.37.png" alt="Screenshot 2021-11-16 at 22.14.37.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 21:15:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/780585#M81221</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-11-16T21:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay plots from two different Proc Logistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/781483#M81234</link>
      <description>&lt;P&gt;I eventually found that in order to not having the datapoints on the graph it is enough to add the option&amp;nbsp;NOMARKERS in the REG statement.&lt;/P&gt;&lt;P&gt;Thank you all for your help.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 18:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/781483#M81234</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-11-20T18:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay plots from two different Proc Logistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/781503#M81236</link>
      <description>&lt;P&gt;Sorry.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I misinterpreted your statement:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"I have to find a way not to print the single observations, and I am done!"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I thought you were done already when posting that, but you were still looking for the&amp;nbsp;NOMARKERS&amp;nbsp;option.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Koen&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 20:45:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/781503#M81236</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-20T20:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay plots from two different Proc Logistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/781506#M81237</link>
      <description>&lt;P&gt;thank you Koen. I meant to click on your response as the solution, but ended up clicking on my own reply!&lt;/P&gt;&lt;P&gt;Sorry about that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eman&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 21:09:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/781506#M81237</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2021-11-20T21:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Overlay plots from two different Proc Logistic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/781507#M81238</link>
      <description>&lt;P&gt;No worries!&lt;/P&gt;
&lt;P&gt;Keep contributing to (and profiting from) our communities I would say.&lt;/P&gt;
&lt;P&gt;Have a nice Saturday evening and a nice Sunday,&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 20 Nov 2021 21:17:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Overlay-plots-from-two-different-Proc-Logistic/m-p/781507#M81238</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-20T21:17:42Z</dc:date>
    </item>
  </channel>
</rss>

