<?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 How can I overlay two sets of data on one scatterplot? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-can-I-overlay-two-sets-of-data-on-one-scatterplot/m-p/541512#M7381</link>
    <description>&lt;P&gt;I am trying to overlay two sets of data (one for males and one for females) on one scatterplot, but I don't know how to do this. I will greatly appreciate any input you can provide me on this matter. This is the code I have so far, but it plots the two sets of data on separate plots, and I want to fix this. Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CODE:&amp;nbsp;&lt;BR /&gt;DATA female;&lt;BR /&gt;INPUT mass rate;&lt;BR /&gt;cards;&lt;BR /&gt;36.1 995&lt;BR /&gt;54.6 1425&lt;BR /&gt;48.5 1396&lt;BR /&gt;42.0 1418&lt;BR /&gt;40.3 1189&lt;BR /&gt;33.1 913&lt;BR /&gt;42.4 1124&lt;BR /&gt;34.5 1052&lt;BR /&gt;51.1 1347&lt;BR /&gt;41.2 1204&lt;BR /&gt;;&lt;BR /&gt;DATA male;&lt;BR /&gt;INPUT m_mass m_rate;&lt;BR /&gt;cards;&lt;BR /&gt;62.0 1792&lt;BR /&gt;62.9 1666&lt;BR /&gt;47.4 1362&lt;BR /&gt;48.7 1614&lt;BR /&gt;51.9 1460&lt;BR /&gt;51.9 1867&lt;BR /&gt;46.9 1439&lt;BR /&gt;;&lt;BR /&gt;proc sgplot data=female;&lt;BR /&gt;scatter x=mass y=rate;&lt;BR /&gt;proc sgplot data=male;&lt;BR /&gt;scatter x= m_mass y= m_rate;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Mar 2019 18:14:14 GMT</pubDate>
    <dc:creator>Fara_I</dc:creator>
    <dc:date>2019-03-08T18:14:14Z</dc:date>
    <item>
      <title>How can I overlay two sets of data on one scatterplot?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-can-I-overlay-two-sets-of-data-on-one-scatterplot/m-p/541512#M7381</link>
      <description>&lt;P&gt;I am trying to overlay two sets of data (one for males and one for females) on one scatterplot, but I don't know how to do this. I will greatly appreciate any input you can provide me on this matter. This is the code I have so far, but it plots the two sets of data on separate plots, and I want to fix this. Thank you!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CODE:&amp;nbsp;&lt;BR /&gt;DATA female;&lt;BR /&gt;INPUT mass rate;&lt;BR /&gt;cards;&lt;BR /&gt;36.1 995&lt;BR /&gt;54.6 1425&lt;BR /&gt;48.5 1396&lt;BR /&gt;42.0 1418&lt;BR /&gt;40.3 1189&lt;BR /&gt;33.1 913&lt;BR /&gt;42.4 1124&lt;BR /&gt;34.5 1052&lt;BR /&gt;51.1 1347&lt;BR /&gt;41.2 1204&lt;BR /&gt;;&lt;BR /&gt;DATA male;&lt;BR /&gt;INPUT m_mass m_rate;&lt;BR /&gt;cards;&lt;BR /&gt;62.0 1792&lt;BR /&gt;62.9 1666&lt;BR /&gt;47.4 1362&lt;BR /&gt;48.7 1614&lt;BR /&gt;51.9 1460&lt;BR /&gt;51.9 1867&lt;BR /&gt;46.9 1439&lt;BR /&gt;;&lt;BR /&gt;proc sgplot data=female;&lt;BR /&gt;scatter x=mass y=rate;&lt;BR /&gt;proc sgplot data=male;&lt;BR /&gt;scatter x= m_mass y= m_rate;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 18:14:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-can-I-overlay-two-sets-of-data-on-one-scatterplot/m-p/541512#M7381</guid>
      <dc:creator>Fara_I</dc:creator>
      <dc:date>2019-03-08T18:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: How can I overlay two sets of data on one scatterplot?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-can-I-overlay-two-sets-of-data-on-one-scatterplot/m-p/541519#M7382</link>
      <description>&lt;P&gt;MERGE the data sets and add a grouping variable. Then use the GROUP= option on the SCATTER statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data All;
set female(in=f) male(rename=(m_mass=mass m_rate=rate));
if f then 
sex = 'Female';
else 
sex = 'Male  ';
run;

proc sgplot data=All;
scatter x=mass y=rate / group=sex;
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Mar 2019 18:21:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-can-I-overlay-two-sets-of-data-on-one-scatterplot/m-p/541519#M7382</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-03-08T18:21:10Z</dc:date>
    </item>
  </channel>
</rss>

