<?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 Group data on a plot by multiple grouping variables in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175541#M6455</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wonder if it's possible in GTL to group values by several variables using different attributes for them. For example, I want to plot a scatter plot for sashelp.class where x=Weight and y=Height and where points will be color-coded by Age (11=red, 12=blue etc) and symbol-coded for different Sexes (male=X, female=Circle).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 15 Feb 2014 01:10:37 GMT</pubDate>
    <dc:creator>Dmitry</dc:creator>
    <dc:date>2014-02-15T01:10:37Z</dc:date>
    <item>
      <title>Group data on a plot by multiple grouping variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175541#M6455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wonder if it's possible in GTL to group values by several variables using different attributes for them. For example, I want to plot a scatter plot for sashelp.class where x=Weight and y=Height and where points will be color-coded by Age (11=red, 12=blue etc) and symbol-coded for different Sexes (male=X, female=Circle).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Feb 2014 01:10:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175541#M6455</guid>
      <dc:creator>Dmitry</dc:creator>
      <dc:date>2014-02-15T01:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Group data on a plot by multiple grouping variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175542#M6456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think you can group by more than one variable. If you don't need a graph legend, you can do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data sClass / view=sClass;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set sashelp.class;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if sex="M" &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; then mHeight = height;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else fHeight = height;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;label mHeight="Height" fHeight="Height";&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sgPlot data=sClass noautolegend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;scatter x=weight y=mHeight / group=age markerAttrs=(symbol="X");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;scatter x=weight y=fHeight / group=age markerAttrs=(symbol="Circle");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Feb 2014 02:58:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175542#M6456</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-02-15T02:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Group data on a plot by multiple grouping variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175543#M6457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A simpler, decent alternative is :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sgPlot data=sashelp.Class;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;scatter x=weight y=height / group=age grouporder=ascending markerchar=sex;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Feb 2014 03:19:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175543#M6457</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-02-15T03:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Group data on a plot by multiple grouping variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175544#M6458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And if one of your variables is discrete and you want clustered groups (side by side) you can use GROUPDISPLAY=cluster.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Feb 2014 03:56:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175544#M6458</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2014-02-15T03:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Group data on a plot by multiple grouping variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175545#M6459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, PGStats. Looks like it's the only way to do what I want so far. So I'll need to create legend in some other way (as an additional text element, e.g.). I also found MERGEDLEGEND statement that seems to be a step towards creating multigrouped plots, but it only works for two plots and of certain types (line and marker). Would be great if SAS had the ability to group data by multiple variables or at least to customize legend (so that I could display legend for one of the plots and then change legend's markers from X's or circles to, e.g., squares, emphasizing by this that &lt;SPAN style="text-decoration: underline;"&gt;color&lt;/SPAN&gt; matters, not shape).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 18:21:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175545#M6459</guid>
      <dc:creator>Dmitry</dc:creator>
      <dc:date>2014-02-18T18:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: Group data on a plot by multiple grouping variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175546#M6460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good luck. You may also get some level of control by combining your group variables (i.e. sexAge = cats(sex,age); ) and using SG Attribute Maps. &lt;A href="http://support.sas.com/documentation/cdl/en/grstatproc/65235/HTML/default/viewer.htm#p0at05lwzbged1n1wifa1qydkccc.htm" title="http://support.sas.com/documentation/cdl/en/grstatproc/65235/HTML/default/viewer.htm#p0at05lwzbged1n1wifa1qydkccc.htm"&gt;SAS(R) 9.3 ODS Graphics: Procedures Guide, Third Edition &lt;/A&gt; - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 20:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175546#M6460</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-02-18T20:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Group data on a plot by multiple grouping variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175547#M6461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As PG says, combine your groups into a single variable (you can use PROC FREQ for this). Then use data attributes, as shown in this blog post &lt;A href="http://blogs.sas.com/content/iml/2012/10/17/specify-the-colors-of-groups-in-sas-statistical-graphics/" title="http://blogs.sas.com/content/iml/2012/10/17/specify-the-colors-of-groups-in-sas-statistical-graphics/"&gt; Specify the colors of groups in SAS statistical graphics - The DO Loop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 15:04:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175547#M6461</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-02-19T15:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: Group data on a plot by multiple grouping variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175548#M6462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2014/04/27/multi-group-series-plots/" title="http://blogs.sas.com/content/graphicallyspeaking/2014/04/27/multi-group-series-plots/"&gt; FYI...Multi-Group Series Plots - Graphically Speaking&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 18:52:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Group-data-on-a-plot-by-multiple-grouping-variables/m-p/175548#M6462</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2014-04-28T18:52:07Z</dc:date>
    </item>
  </channel>
</rss>

