<?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: SAS overlay histogram in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/648257#M31116</link>
    <description>&lt;P&gt;&lt;EM&gt;&amp;gt; I added "freq y_axis" not working.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What does "not working" mean? Is there an error? Do you get a graph but it isn't what you want? The following example creates a graph with two overlayed histograms:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;For an overview of how to create comparative histograms in SAS, see&amp;nbsp; &lt;A href="https://blogs.sas.com/content/iml/2016/03/09/comparative-panel-overlay-histograms-sas.html" target="_self"&gt;"Comparative histograms: Panel and overlay histograms in SAS."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
input Sex $ Height Freq;
datalines;
M 69.0 3
F 56.5 7
F 65.3 4
F 62.8 5
M 63.5 2
M 57.3 1
F 59.8 8
F 62.5 2
M 62.5 1
M 59.0 2
F 51.3 4
F 64.3 3
F 56.3 7
F 66.5 5
M 72.0 6
M 64.8 2
M 67.0 1
M 57.5 8
M 66.5 4
;

proc univariate data=Have;
class Sex;
histogram Height / overlay;
ods select histogram;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please post more data. Five observations is not sufficient.&lt;/P&gt;
&lt;P&gt;In your program, you are using the label "Volume Trend," so maybe you really want a line plot or a set of bar charts?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 May 2020 09:59:19 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2020-05-16T09:59:19Z</dc:date>
    <item>
      <title>SAS overlay histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/647483#M31106</link>
      <description>&lt;P&gt;Hello i have the following dataset. What i would like to do is create two overlay histograms by label_category with x_axis being x axis and use y_axis as y axis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;patientID&lt;/TD&gt;&lt;TD&gt;y_axis&lt;/TD&gt;&lt;TD&gt;x_axis&lt;/TD&gt;&lt;TD&gt;label_category&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;51&lt;/TD&gt;&lt;TD&gt;5.2&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;30&lt;/TD&gt;&lt;TD&gt;5.4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;98&lt;/TD&gt;&lt;TD&gt;1.2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;93&lt;/TD&gt;&lt;TD&gt;1.7&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;17&lt;/TD&gt;&lt;TD&gt;14.1&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is what I have so far but i am not sure where to add y_axis&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc univariate data=work.data;&lt;BR /&gt;class label_category;&lt;BR /&gt;var x_axis;&lt;BR /&gt;histogram x_axis/&lt;BR /&gt;normal overlay&lt;BR /&gt;VAXISLABEL = "Volume trend" ;&lt;BR /&gt;&lt;BR /&gt;label label_category= 'Label Category, 1 = yes, 0 = no";&lt;BR /&gt;label x_axis= 'Volume trend';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 14:44:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/647483#M31106</guid>
      <dc:creator>radhikaa4</dc:creator>
      <dc:date>2020-05-13T14:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS overlay histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/648165#M31110</link>
      <description>&lt;P&gt;Traditionally, a histogram is a 1-D display. It displays the number of observations for a variable in a set of bins.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not clear what the second variable represents. Is it a frequency? That is, does the first observation represent 51 observations, all with X=5.2 and label_category=0?&amp;nbsp; If so, you can add&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FREQ y_axis;&lt;/P&gt;
&lt;P&gt;to the PROC UNIVARIATE statement.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 20:57:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/648165#M31110</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-05-15T20:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS overlay histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/648170#M31111</link>
      <description>&lt;P&gt;yes, i need frequency&amp;nbsp;by y_axis and then # of patients who were in that bin.&amp;nbsp; i added 'freq y_axis" not working&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc univariate data=work.data;&lt;BR /&gt;class label_category;&lt;BR /&gt;var x_axis; &lt;STRONG&gt;freq y_axis&lt;/STRONG&gt;;&lt;BR /&gt;histogram x_axis/&lt;BR /&gt;normal overlay&lt;BR /&gt;VAXISLABEL = "Volume trend" ;&lt;/P&gt;&lt;P&gt;label label_category= 'Label Category, 1 = yes, 0 = no";&lt;BR /&gt;label x_axis= 'Volume trend';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 21:19:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/648170#M31111</guid>
      <dc:creator>radhikaa4</dc:creator>
      <dc:date>2020-05-15T21:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS overlay histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/648257#M31116</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; I added "freq y_axis" not working.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What does "not working" mean? Is there an error? Do you get a graph but it isn't what you want? The following example creates a graph with two overlayed histograms:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;For an overview of how to create comparative histograms in SAS, see&amp;nbsp; &lt;A href="https://blogs.sas.com/content/iml/2016/03/09/comparative-panel-overlay-histograms-sas.html" target="_self"&gt;"Comparative histograms: Panel and overlay histograms in SAS."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Have;
input Sex $ Height Freq;
datalines;
M 69.0 3
F 56.5 7
F 65.3 4
F 62.8 5
M 63.5 2
M 57.3 1
F 59.8 8
F 62.5 2
M 62.5 1
M 59.0 2
F 51.3 4
F 64.3 3
F 56.3 7
F 66.5 5
M 72.0 6
M 64.8 2
M 67.0 1
M 57.5 8
M 66.5 4
;

proc univariate data=Have;
class Sex;
histogram Height / overlay;
ods select histogram;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Please post more data. Five observations is not sufficient.&lt;/P&gt;
&lt;P&gt;In your program, you are using the label "Volume Trend," so maybe you really want a line plot or a set of bar charts?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 May 2020 09:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/648257#M31116</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-05-16T09:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS overlay histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/648623#M31129</link>
      <description>&lt;P&gt;Hello, I believe you are on the right path and a few modifications can help you.&lt;BR /&gt;Here is a suggestion for you to continue your work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics on / width=10in;&lt;BR /&gt;ods select HISTOGRAM;&lt;BR /&gt;Proc univariate data=work.data ;&lt;BR /&gt;var x_axis;&lt;BR /&gt;class label_category;&lt;BR /&gt;histogram x_axis / overlay normal kernel ;&lt;BR /&gt;Label x_axis = 'Volume trend';&lt;BR /&gt;Label label_category= 'Label Category, 1 = yes, 0 = no';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 16:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/648623#M31129</guid>
      <dc:creator>Rodolfo_Mingoti</dc:creator>
      <dc:date>2020-05-18T16:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS overlay histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/648630#M31130</link>
      <description>Thank you. Yes that works but I know it typically in histogram, built in frequency % is generated based on the x_axis.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;However, I want to choose my own y_axis by x_axis frequency broken down by yes/no colors.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 18 May 2020 17:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/SAS-overlay-histogram/m-p/648630#M31130</guid>
      <dc:creator>radhikaa4</dc:creator>
      <dc:date>2020-05-18T17:10:26Z</dc:date>
    </item>
  </channel>
</rss>

