<?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: Histogram overlay in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Histogram-overlay/m-p/635062#M188526</link>
    <description>&lt;P&gt;Sounds like the blue distribution has a higher mean value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Univariate histogram plots will combine the curve colors when an X is in both distributions.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you not want that visual indicator ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;I used generated data with four classes to emphasize what the procedures do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
call streaminit(123);
do class = 0, 1;
  do _n_ = 1 to 100+100*class;
    x = rand('normal', 45 + 10*class, 4);
    output;
  end;
end;
run;

ods html file='univariate-normal.html';

proc univariate data=have;
  class class;
  var x;
  histogram x / normal overlay;
run;

ods html close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="univariate-normal.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37397iA386610689C641D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="univariate-normal.png" alt="univariate-normal.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SGPLOT can also produce histogram plots, and overlay via the GROUP= option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Review of produced images indicates the order of the histogram drawing is group mean descending (this is similar to the -mean being a z-index in CSS), so there is no way to force a higher mean distribution plot to be rendered wholly above of a lower mean distribution plot.&amp;nbsp; The documentation does &lt;STRONG&gt;NOT&lt;/STRONG&gt; discuss this situation, and there are no options for changing the group render order.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sgplot-normal.png" style="width: 654px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37399i208BAD2F316F8134/image-size/large?v=v2&amp;amp;px=999" role="button" title="sgplot-normal.png" alt="sgplot-normal.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You&amp;nbsp;&lt;EM&gt;might&amp;nbsp;&lt;/EM&gt;be able to roll your own plot by writing some custom code in GTL (graphics template language)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Mar 2020 15:37:25 GMT</pubDate>
    <dc:creator>RichardDeVen</dc:creator>
    <dc:date>2020-03-26T15:37:25Z</dc:date>
    <item>
      <title>Histogram overlay</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-overlay/m-p/635042#M188520</link>
      <description>&lt;P&gt;Hi. Overlay histogram works but i would like to have certain color appear on top of another.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc univariate data=work.data;&lt;BR /&gt;WHERE var1 between 0 and 100;&lt;BR /&gt;class class2;&lt;BR /&gt;var var1;&lt;BR /&gt;histogram var1 / &lt;BR /&gt;endpoints = 0 to 100 by 10&lt;BR /&gt;normal overlay &lt;BR /&gt;VAXISLABEL = "Percentage of patients" ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: class1 = 0 is blue color and class1 = 1 is red color.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want the blue to appear on top of red. how do i do that?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 13:26:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-overlay/m-p/635042#M188520</guid>
      <dc:creator>monday89</dc:creator>
      <dc:date>2020-03-26T13:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram overlay</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-overlay/m-p/635062#M188526</link>
      <description>&lt;P&gt;Sounds like the blue distribution has a higher mean value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Univariate histogram plots will combine the curve colors when an X is in both distributions.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you not want that visual indicator ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;I used generated data with four classes to emphasize what the procedures do:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
call streaminit(123);
do class = 0, 1;
  do _n_ = 1 to 100+100*class;
    x = rand('normal', 45 + 10*class, 4);
    output;
  end;
end;
run;

ods html file='univariate-normal.html';

proc univariate data=have;
  class class;
  var x;
  histogram x / normal overlay;
run;

ods html close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="univariate-normal.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37397iA386610689C641D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="univariate-normal.png" alt="univariate-normal.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SGPLOT can also produce histogram plots, and overlay via the GROUP= option.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Review of produced images indicates the order of the histogram drawing is group mean descending (this is similar to the -mean being a z-index in CSS), so there is no way to force a higher mean distribution plot to be rendered wholly above of a lower mean distribution plot.&amp;nbsp; The documentation does &lt;STRONG&gt;NOT&lt;/STRONG&gt; discuss this situation, and there are no options for changing the group render order.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sgplot-normal.png" style="width: 654px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/37399i208BAD2F316F8134/image-size/large?v=v2&amp;amp;px=999" role="button" title="sgplot-normal.png" alt="sgplot-normal.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You&amp;nbsp;&lt;EM&gt;might&amp;nbsp;&lt;/EM&gt;be able to roll your own plot by writing some custom code in GTL (graphics template language)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 15:37:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-overlay/m-p/635062#M188526</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-03-26T15:37:25Z</dc:date>
    </item>
  </channel>
</rss>

