<?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 can I overlay two density plots? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/how-can-I-overlay-two-density-plots/m-p/72355#M2600</link>
    <description>The Density statement does not support GROUP role.  In cases where you have a known number of group values, you could transpose your data into multiple columns and overlay the needed plots as shown below.  You don't need the BY statement.&lt;BR /&gt;
&lt;BR /&gt;
data density;&lt;BR /&gt;
  drop i;&lt;BR /&gt;
  do i=1 to 100;&lt;BR /&gt;
    A = 20+20*ranuni(2);&lt;BR /&gt;
	B = 20+30*ranuni(3);&lt;BR /&gt;
	output;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
/*proc print;run;*/&lt;BR /&gt;
&lt;BR /&gt;
proc sgplot data=density;&lt;BR /&gt;
  density a / legendlabel='A';&lt;BR /&gt;
  density b / legendlabel='B';&lt;BR /&gt;
  run;</description>
    <pubDate>Fri, 03 Jun 2011 00:59:29 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2011-06-03T00:59:29Z</dc:date>
    <item>
      <title>how can I overlay two density plots?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-can-I-overlay-two-density-plots/m-p/72354#M2599</link>
      <description>I wanna creat one plot with 2 density lines for group A and B.&lt;BR /&gt;
The data are like:&lt;BR /&gt;
Age group&lt;BR /&gt;
40   A&lt;BR /&gt;
45  B&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
&lt;BR /&gt;
I used the codes:&lt;BR /&gt;
proc sgplot data=emphysema ;&lt;BR /&gt;
density age ;&lt;BR /&gt;
by emphysema;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The above codes gave me 2 seperate density plots. How can I combine them into one plot?&lt;BR /&gt;
Thanks.</description>
      <pubDate>Thu, 02 Jun 2011 22:07:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-can-I-overlay-two-density-plots/m-p/72354#M2599</guid>
      <dc:creator>siyi</dc:creator>
      <dc:date>2011-06-02T22:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: how can I overlay two density plots?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-can-I-overlay-two-density-plots/m-p/72355#M2600</link>
      <description>The Density statement does not support GROUP role.  In cases where you have a known number of group values, you could transpose your data into multiple columns and overlay the needed plots as shown below.  You don't need the BY statement.&lt;BR /&gt;
&lt;BR /&gt;
data density;&lt;BR /&gt;
  drop i;&lt;BR /&gt;
  do i=1 to 100;&lt;BR /&gt;
    A = 20+20*ranuni(2);&lt;BR /&gt;
	B = 20+30*ranuni(3);&lt;BR /&gt;
	output;&lt;BR /&gt;
  end;&lt;BR /&gt;
run;&lt;BR /&gt;
/*proc print;run;*/&lt;BR /&gt;
&lt;BR /&gt;
proc sgplot data=density;&lt;BR /&gt;
  density a / legendlabel='A';&lt;BR /&gt;
  density b / legendlabel='B';&lt;BR /&gt;
  run;</description>
      <pubDate>Fri, 03 Jun 2011 00:59:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-can-I-overlay-two-density-plots/m-p/72355#M2600</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2011-06-03T00:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: how can I overlay two density plots?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-can-I-overlay-two-density-plots/m-p/72356#M2601</link>
      <description>Attempting to attach the output graph.</description>
      <pubDate>Fri, 03 Jun 2011 01:03:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-can-I-overlay-two-density-plots/m-p/72356#M2601</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2011-06-03T01:03:31Z</dc:date>
    </item>
  </channel>
</rss>

