<?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 to plot using PROC SGPLOT from 2 separate PROC MIXED outputs in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-using-PROC-SGPLOT-from-2-separate-PROC-MIXED-outputs/m-p/720698#M34898</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;! Thanks for the suggestions! A combination PROC SGPLOT with both bands and scatter worked well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=allplot;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;band x=visit lower=Lower upper=Upper / group=Source fillattrs=GraphConfidence1 legendlabel="95% CL"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name="band";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;scatter x=visit y=Estimate / group=Source yerrorlower=Lower yerrorupper=Upper groupdisplay=overlay;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; position=bottomright;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; xaxis grid values=(1 to 3 by 1);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; yaxis grid&amp;nbsp; colorbands=odd display=(nolabel) discreteorder=data;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Feb 2021 01:43:14 GMT</pubDate>
    <dc:creator>jeff_b</dc:creator>
    <dc:date>2021-02-21T01:43:14Z</dc:date>
    <item>
      <title>How to plot using PROC SGPLOT from 2 separate PROC MIXED outputs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-using-PROC-SGPLOT-from-2-separate-PROC-MIXED-outputs/m-p/720680#M34894</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to plot 2 separate PROC MIXED outputs in 1 PROC SGPLOT.&amp;nbsp; Here is the output I am keeping -only estimate and 95% CI's. Could you please suggest a way for me to plot them in the same PROC SGPLOT&amp;nbsp;series plot along with 95% CI's?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*1st output for the total sample*/&lt;/P&gt;&lt;P&gt;proc mixed data = temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;class ID visit group;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;model outcome = visit group&amp;nbsp;visit *group&amp;nbsp;/ cl ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;repeated visit / type=un subject=ID r;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;lsmeans visit group&amp;nbsp;visit *group / cl;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ods output lsmeans = plot1(where=(Effect="visit*group"));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*2 nd output from a subset of people */&lt;/P&gt;&lt;P&gt;proc mixed data = temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; where subset = 1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;class ID visit group;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;model outcome = visit group&amp;nbsp;visit *group&amp;nbsp;/ cl ;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;repeated visit / type=un subject=ID r;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;lsmeans visit group&amp;nbsp;visit *group / cl;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ods output lsmeans = plot2(where=(Effect="visit*group"));&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*This scatter plot plots a 1 output but can add 95% CI's, while proc sgplot series cannot add 95% CI's.&lt;/P&gt;&lt;P&gt;proc sgplot data=plot1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; scatter y=Estimate x=visit/ yerrorlower=Lower yerrorupper=Upper&lt;BR /&gt;&amp;nbsp; &amp;nbsp; markerattrs=(symbol=diamondfilled) group=GRP groupdisplay=cluster;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; refline 0 / axis=x;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;xaxis grid values=(1 to 3 by 1);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;yaxis values=(7 to 12 by 1) grid colorbands=odd display=(nolabel) discreteorder=data;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 22:11:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-using-PROC-SGPLOT-from-2-separate-PROC-MIXED-outputs/m-p/720680#M34894</guid>
      <dc:creator>jeff_b</dc:creator>
      <dc:date>2021-02-20T22:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot using PROC SGPLOT from 2 separate PROC MIXED outputs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-using-PROC-SGPLOT-from-2-separate-PROC-MIXED-outputs/m-p/720682#M34895</link>
      <description>&lt;P&gt;You would combine the data in a data step. Something like this perhaps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Data allplot;
   set plot1 plot2 indsname=ds;
   Source=ds;
run;&lt;/PRE&gt;
&lt;P&gt;The Indsname option creates a temporary variable with the name of the data set records come from. The Source variable keeps that so you can use it later. You may want to use this as a Group option variable in plots to indicate just which plot you are looking at.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Large economy sized hint: If you use a SERIES plot and a SCATTER plot with the same x and y variables they will overlay each other. So the errorbars from the scatter appear with to be from the series.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Feb 2021 22:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-using-PROC-SGPLOT-from-2-separate-PROC-MIXED-outputs/m-p/720682#M34895</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-20T22:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot using PROC SGPLOT from 2 separate PROC MIXED outputs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-using-PROC-SGPLOT-from-2-separate-PROC-MIXED-outputs/m-p/720685#M34896</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;! Thank you for the quick reply to my post.&lt;/P&gt;&lt;P&gt;I followed your suggestion and combined the 2 data in a data step and plotted them in PROC SGPLOT using both scatter and series. Please see the code below. However, the plot looks a bit messy. I was hoping to get more of connected lines like in time series and 95% CI's as bands around them. Thanks in advance for any suggestions!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=allplot noautolegend;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; series x=VISIT y=Estimate / group=Source;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; scatter x=VISIT y=Estimate / group=Source yerrorlower=Lower yerrorupper=Upper groupdisplay=cluster;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; xaxis grid values=(1 to 3 by 1);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;yaxis values=(7 to 12 by 1) grid colorbands=odd display=(nolabel) discreteorder=data;&lt;BR /&gt;run;&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="jeff_b_1-1613860301942.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54983iBFDE430EED67DB2C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jeff_b_1-1613860301942.png" alt="jeff_b_1-1613860301942.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV class="c"&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 20 Feb 2021 22:32:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-using-PROC-SGPLOT-from-2-separate-PROC-MIXED-outputs/m-p/720685#M34896</guid>
      <dc:creator>jeff_b</dc:creator>
      <dc:date>2021-02-20T22:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot using PROC SGPLOT from 2 separate PROC MIXED outputs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-using-PROC-SGPLOT-from-2-separate-PROC-MIXED-outputs/m-p/720693#M34897</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/304378"&gt;@jeff_b&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;! Thank you for the quick reply to my post.&lt;/P&gt;
&lt;P&gt;I followed your suggestion and combined the 2 data in a data step and plotted them in PROC SGPLOT using both scatter and series. Please see the code below. However, the plot looks a bit messy. I was hoping to get more of connected lines like in time series and 95% CI's as bands around them. Thanks in advance for any suggestions!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data=allplot noautolegend;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; series x=VISIT y=Estimate / group=Source;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; scatter x=VISIT y=Estimate / group=Source yerrorlower=Lower yerrorupper=Upper groupdisplay=cluster;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; xaxis grid values=(1 to 3 by 1);&lt;BR /&gt;&amp;nbsp; &amp;nbsp;yaxis values=(7 to 12 by 1) grid colorbands=odd display=(nolabel) discreteorder=data;&lt;BR /&gt;run;&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="jeff_b_1-1613860301942.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54983iBFDE430EED67DB2C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jeff_b_1-1613860301942.png" alt="jeff_b_1-1613860301942.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV class="c"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The BAND plot instead of series or scatter then.&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=allplot noautolegend;
    band x=VISIT y=Estimate  lower=Lower upper=Upper
        / group=Source ;
    xaxis grid values=(1 to 3 by 1);
    yaxis values=(7 to 12 by 1) grid colorbands=odd display=(nolabel) discreteorder=data;
run;  &lt;/PRE&gt;
&lt;P&gt;But I think you need to look at your output data set a bit. I'm not sure about that your "limits" are as intended.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 00:22:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-using-PROC-SGPLOT-from-2-separate-PROC-MIXED-outputs/m-p/720693#M34897</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-21T00:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot using PROC SGPLOT from 2 separate PROC MIXED outputs</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-using-PROC-SGPLOT-from-2-separate-PROC-MIXED-outputs/m-p/720698#M34898</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;! Thanks for the suggestions! A combination PROC SGPLOT with both bands and scatter worked well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=allplot;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;band x=visit lower=Lower upper=Upper / group=Source fillattrs=GraphConfidence1 legendlabel="95% CL"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name="band";&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;scatter x=visit y=Estimate / group=Source yerrorlower=Lower yerrorupper=Upper groupdisplay=overlay;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; position=bottomright;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; xaxis grid values=(1 to 3 by 1);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; yaxis grid&amp;nbsp; colorbands=odd display=(nolabel) discreteorder=data;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 01:43:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-using-PROC-SGPLOT-from-2-separate-PROC-MIXED-outputs/m-p/720698#M34898</guid>
      <dc:creator>jeff_b</dc:creator>
      <dc:date>2021-02-21T01:43:14Z</dc:date>
    </item>
  </channel>
</rss>

