<?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 SGPLOT GROUP BY ERROR - OVERLAY PLOTS in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-GROUP-BY-ERROR-OVERLAY-PLOTS/m-p/855651#M23453</link>
    <description>&lt;P&gt;You could create a value of the mean &amp;amp;COLUMN.binned, such that the value is the same for each value of the GROUP= variable. Then when you use the GROUP= option in the VLINE statement, all the lines plot on top of each other, making it look like one line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or maybe &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130"&gt;@DanH_sas&lt;/a&gt; has a better idea.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jan 2023 20:49:35 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-01-25T20:49:35Z</dc:date>
    <item>
      <title>PROC SGPLOT GROUP BY ERROR - OVERLAY PLOTS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-GROUP-BY-ERROR-OVERLAY-PLOTS/m-p/855648#M23452</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First of all, I am using SAS 9.4 on SAS EG 7.1.&lt;/P&gt;&lt;P&gt;I am trying to plot a stacked bar chart and a line chart on the same plot(figure) instead of plotting them in two separate figures. For the stacked bar chart I am using a "GROUP" statement because I have 5 different bins to be stacked on top of each other. For the line chart however I do not need a group since I would like to plot the mean for the overall population without partitions. In this case I get a group error stating that if I use group in vbar statement I must use group also in vline. Could anyone have any idea on how to overcome this problem? Below I put my code and result I get. Thank you so much..&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="alper2_3-1674678715697.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79816iABBC2C4605C84CDF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alper2_3-1674678715697.png" alt="alper2_3-1674678715697.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79815i0AAE9C862A69057B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79814i8914F40B913ACFC7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 20:33:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-GROUP-BY-ERROR-OVERLAY-PLOTS/m-p/855648#M23452</guid>
      <dc:creator>alper2</dc:creator>
      <dc:date>2023-01-25T20:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT GROUP BY ERROR - OVERLAY PLOTS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-GROUP-BY-ERROR-OVERLAY-PLOTS/m-p/855651#M23453</link>
      <description>&lt;P&gt;You could create a value of the mean &amp;amp;COLUMN.binned, such that the value is the same for each value of the GROUP= variable. Then when you use the GROUP= option in the VLINE statement, all the lines plot on top of each other, making it look like one line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or maybe &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130"&gt;@DanH_sas&lt;/a&gt; has a better idea.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 20:49:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-GROUP-BY-ERROR-OVERLAY-PLOTS/m-p/855651#M23453</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-25T20:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT GROUP BY ERROR - OVERLAY PLOTS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-GROUP-BY-ERROR-OVERLAY-PLOTS/m-p/855653#M23454</link>
      <description>&lt;P&gt;Can you clarify what this means (best would be some example data): "I would like to plot the mean for the overall population without partitions".&lt;/P&gt;
&lt;P&gt;As in what is the "overall population"?&lt;/P&gt;
&lt;P&gt;I am having a hard time envisioning what sort of line you envision by taking the Mean of the group variable (the Response=) as your code requests.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 21:05:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-GROUP-BY-ERROR-OVERLAY-PLOTS/m-p/855653#M23454</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-01-25T21:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT GROUP BY ERROR - OVERLAY PLOTS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-GROUP-BY-ERROR-OVERLAY-PLOTS/m-p/855655#M23455</link>
      <description>&lt;P&gt;In this case, you will want to use the following steps:&lt;/P&gt;
&lt;P&gt;1. Use PROC SUMMARY or PROC MEANS to precompute the bar chart data.&lt;/P&gt;
&lt;P&gt;2. Use PROC SUMMARY or PROC MEANS to precompute the line chart data. Be sure to use different variable names from the bar chart data in the output data sset.&lt;/P&gt;
&lt;P&gt;3. Merge the two data sets together.&lt;/P&gt;
&lt;P&gt;4. Instead of using VBAR and VLINE, use the VBARPARM and SERIES statements. Your code will look something like the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgplot data=merged;&lt;/P&gt;
&lt;P&gt;vbarparm category=&amp;amp;TIME_GROUP response=freq_values / group=&amp;amp;COLUMN.binned seglabel ...;&lt;/P&gt;
&lt;P&gt;series x=&amp;amp;TIME_GROUP_2 y=mean_values;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if you have any issues with this approach.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 21:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-GROUP-BY-ERROR-OVERLAY-PLOTS/m-p/855655#M23455</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2023-01-25T21:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPLOT GROUP BY ERROR - OVERLAY PLOTS</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-GROUP-BY-ERROR-OVERLAY-PLOTS/m-p/855693#M23456</link>
      <description>&lt;P&gt;Thank you so much. It worked like magic.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alper2_0-1674719384910.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79821iE4945515FE80007C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="alper2_0-1674719384910.png" alt="alper2_0-1674719384910.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 07:50:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-GROUP-BY-ERROR-OVERLAY-PLOTS/m-p/855693#M23456</guid>
      <dc:creator>alper2</dc:creator>
      <dc:date>2023-01-26T07:50:13Z</dc:date>
    </item>
  </channel>
</rss>

