<?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: Density scale for the histogram in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Density-scale-for-the-histogram/m-p/783189#M38460</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To my knowledge, nor PROC UNIVARIATE, nor PROC SGPLOT have a SCALE=DENSITY on the HISTOGRAM statement.&lt;/P&gt;
&lt;P&gt;At least not in SAS 9.4 M7 (maybe in VIYA?).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But PROC TEMPLATE can be used :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
  define statgraph histogram;
    begingraph;
      entrytitle "Histogram of Vehicle Weights";
      layout overlay /
        xaxisopts=(label="Vehicle Weight (LBS)")
        yaxisopts=(griddisplay=on);
        histogram weight / SCALE=DENSITY ;
      endlayout;	   
    endgraph;
  end;
run;

proc sgrender data=sashelp.cars template=histogram;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
    <pubDate>Tue, 30 Nov 2021 15:45:08 GMT</pubDate>
    <dc:creator>sbxkoenk</dc:creator>
    <dc:date>2021-11-30T15:45:08Z</dc:date>
    <item>
      <title>Density scale for the histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Density-scale-for-the-histogram/m-p/783104#M38455</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;How can I get y scale as density for a histogram?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The histogram statement with proc univariate and proc sgplot support count, proportion and percentage but not density. It seems scale=density is available with proc sgplot, but it does not work with SAS On Demand for Academics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried following codes in the PRoC Step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc univariate;&lt;BR /&gt;var y;&lt;BR /&gt;histogram y/yscale=density;&amp;nbsp;&lt;BR /&gt;run;&lt;BR /&gt;proc sgplot;&lt;BR /&gt;histogram y/ scale=density;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate an answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;S_pera&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 11:49:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Density-scale-for-the-histogram/m-p/783104#M38455</guid>
      <dc:creator>S_pera</dc:creator>
      <dc:date>2021-11-30T11:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Density scale for the histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Density-scale-for-the-histogram/m-p/783109#M38456</link>
      <description>I don't understand you want COUNT or PERCENT ?&lt;BR /&gt;&lt;BR /&gt;proc univariate data=sashelp.heart;&lt;BR /&gt;var weight;&lt;BR /&gt;histogram weight/vscale=count;&lt;BR /&gt;histogram weight/vscale=percent;&lt;BR /&gt;run;</description>
      <pubDate>Tue, 30 Nov 2021 12:25:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Density-scale-for-the-histogram/m-p/783109#M38456</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-11-30T12:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Density scale for the histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Density-scale-for-the-histogram/m-p/783112#M38457</link>
      <description>I want the density.</description>
      <pubDate>Tue, 30 Nov 2021 12:34:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Density-scale-for-the-histogram/m-p/783112#M38457</guid>
      <dc:creator>S_pera</dc:creator>
      <dc:date>2021-11-30T12:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: Density scale for the histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Density-scale-for-the-histogram/m-p/783189#M38460</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To my knowledge, nor PROC UNIVARIATE, nor PROC SGPLOT have a SCALE=DENSITY on the HISTOGRAM statement.&lt;/P&gt;
&lt;P&gt;At least not in SAS 9.4 M7 (maybe in VIYA?).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But PROC TEMPLATE can be used :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
  define statgraph histogram;
    begingraph;
      entrytitle "Histogram of Vehicle Weights";
      layout overlay /
        xaxisopts=(label="Vehicle Weight (LBS)")
        yaxisopts=(griddisplay=on);
        histogram weight / SCALE=DENSITY ;
      endlayout;	   
    endgraph;
  end;
run;

proc sgrender data=sashelp.cars template=histogram;
run;
/* end of program */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 15:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Density-scale-for-the-histogram/m-p/783189#M38460</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2021-11-30T15:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: Density scale for the histogram</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Density-scale-for-the-histogram/m-p/783208#M38464</link>
      <description>&lt;P&gt;Dear Koen&lt;/P&gt;&lt;P&gt;Thank you very much for the solution. But I thought we could think of an easier code. Hope we will have the density option added to the histogram statement of PROC Univariate and/or PROC SGPLOT. In fact R is giving this with just&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;nbsp;hist(x,freq=F)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, the solution is highly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;S_pera&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Nov 2021 17:04:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Density-scale-for-the-histogram/m-p/783208#M38464</guid>
      <dc:creator>S_pera</dc:creator>
      <dc:date>2021-11-30T17:04:59Z</dc:date>
    </item>
  </channel>
</rss>

