<?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 with density using SAS SGPLOT in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Histogram-with-density-using-SAS-SGPLOT/m-p/945036#M370265</link>
    <description>&lt;P&gt;Thanks a lot for the resolution. I'll go through the documentation.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Sep 2024 13:10:22 GMT</pubDate>
    <dc:creator>mahi263</dc:creator>
    <dc:date>2024-09-24T13:10:22Z</dc:date>
    <item>
      <title>Histogram with density using SAS SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-with-density-using-SAS-SGPLOT/m-p/944878#M370206</link>
      <description>&lt;P&gt;Hi, I am trying to get the histogram with density overlayed for the counts on Y axis and time on X-axis. However somehow, I am not able to get the density curve close to the histogram. Is density by default take the percent into consideration to plot the curve? Can you please help me on this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;x&lt;/TD&gt;&lt;TD&gt;Y&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;830&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;155&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;65&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;52&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;35&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;15&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 23 Sep 2024 10:50:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-with-density-using-SAS-SGPLOT/m-p/944878#M370206</guid>
      <dc:creator>mahi263</dc:creator>
      <dc:date>2024-09-23T10:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram with density using SAS SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-with-density-using-SAS-SGPLOT/m-p/944883#M370210</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/469785"&gt;@mahi263&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need to specify the count variable in the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n18r9s9vxpuewqn0zeo8p1oekbmn.htm#n1iqtbrzkqx6y6n1ee6zxmqu1bwm" target="_blank" rel="noopener"&gt;FREQ= option&lt;/A&gt; of the DENSITY statement, as it wouldn't be used by default.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x y;
cards;
 1 830
 2 155
 3  65
 4  45
 5  52
 6  35
 7  20
 8  15
 9  10
10   5
;

proc sgplot data=have;
histogram x / freq=y scale=count binwidth=1;
density x / freq=y type=kernel(c=1.7);
xaxis values=(1 to 10) offsetmin=0.06 offsetmax=0.06;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 23 Sep 2024 12:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-with-density-using-SAS-SGPLOT/m-p/944883#M370210</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-09-23T12:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram with density using SAS SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-with-density-using-SAS-SGPLOT/m-p/945014#M370258</link>
      <description>&lt;P&gt;Thanks a lot,&amp;nbsp;&lt;SPAN&gt;FreelanceReinh, really helps. Can you please confirm how do we define the kernel (&lt;STRONG&gt;1.7&lt;/STRONG&gt;) option? Can you guide on this?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 10:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-with-density-using-SAS-SGPLOT/m-p/945014#M370258</guid>
      <dc:creator>mahi263</dc:creator>
      <dc:date>2024-09-24T10:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram with density using SAS SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-with-density-using-SAS-SGPLOT/m-p/945019#M370261</link>
      <description>&lt;P&gt;If you try a few different values for that bandwidth, some greater than 1.7, some less&amp;nbsp;than 1.7, you'll get the impression that some are too small (e.g., produce peaks around the integer values 1, 2, 3, ..., as if x were a discrete variable) and some are too large (i.e., deviate considerably from parts of the histogram). That's how I ended up with 1.7. But your knowledge of the data, the subject matter and the scientific literature may suggest a different bandwidth. Or even a different type of density: With a bit more programming effort you can overlay an arbitrary density curve (e.g., exponential, gamma, etc.) on a histogram. See Rick Wicklin's blog post "&lt;A href="https://blogs.sas.com/content/iml/2013/04/24/overlay-density-curve-on-a-histogram.html" target="_blank" rel="noopener"&gt;How to overlay a custom density curve on a histogram in SAS&lt;/A&gt;" for details.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 11:31:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-with-density-using-SAS-SGPLOT/m-p/945019#M370261</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-09-24T11:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram with density using SAS SGPLOT</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Histogram-with-density-using-SAS-SGPLOT/m-p/945036#M370265</link>
      <description>&lt;P&gt;Thanks a lot for the resolution. I'll go through the documentation.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2024 13:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Histogram-with-density-using-SAS-SGPLOT/m-p/945036#M370265</guid>
      <dc:creator>mahi263</dc:creator>
      <dc:date>2024-09-24T13:10:22Z</dc:date>
    </item>
  </channel>
</rss>

