<?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 for weighted values in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/385749#M65765</link>
    <description>&lt;P&gt;Depending on numbers of levels you want you might try Proc Freq and request a FreqPlot. Heres a crude and somewhat nonsensical in real terms but generates bars using weights.&lt;/P&gt;
&lt;PRE&gt;ods graphics on;

proc freq data=sashelp.class;
   weight age;
   tables weight/plots=freqplot;
run;
ods graphics off;&lt;/PRE&gt;
&lt;P&gt;If you have a continuous variable with many levels you might use a custom format to create bins.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or Proc SGPlot and a histogram plot.&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=sashelp.class;
   histogram height / weight = age;

run;&lt;/PRE&gt;</description>
    <pubDate>Fri, 04 Aug 2017 19:18:38 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-08-04T19:18:38Z</dc:date>
    <item>
      <title>Histogram for weighted values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/385747#M65763</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Proc univariate does not support weight statement to build a histogram. Is there any other procedure that can be used to build a histogram for weighed values? Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 19:01:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/385747#M65763</guid>
      <dc:creator>Lida</dc:creator>
      <dc:date>2017-08-04T19:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram for weighted values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/385748#M65764</link>
      <description>&lt;P&gt;Interestingly, while it doesn't support the weight statement, it does appear to support the freq statement. e.g.,&lt;/P&gt;
&lt;PRE&gt;data have;
  input score weight;
cards;
1 2
2 3
3 4
4 5
5 6
6 5
7 4
8 3
9 2
;

proc univariate data=have noprint;
   histogram score;
   freq weight;
run;&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 19:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/385748#M65764</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-08-04T19:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram for weighted values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/385749#M65765</link>
      <description>&lt;P&gt;Depending on numbers of levels you want you might try Proc Freq and request a FreqPlot. Heres a crude and somewhat nonsensical in real terms but generates bars using weights.&lt;/P&gt;
&lt;PRE&gt;ods graphics on;

proc freq data=sashelp.class;
   weight age;
   tables weight/plots=freqplot;
run;
ods graphics off;&lt;/PRE&gt;
&lt;P&gt;If you have a continuous variable with many levels you might use a custom format to create bins.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or Proc SGPlot and a histogram plot.&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=sashelp.class;
   histogram height / weight = age;

run;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Aug 2017 19:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/385749#M65765</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-04T19:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram for weighted values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/385754#M65768</link>
      <description>&lt;P&gt;that was quick and easy... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; thank you very much art297.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 19:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/385754#M65768</guid>
      <dc:creator>Lida</dc:creator>
      <dc:date>2017-08-04T19:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram for weighted values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/386025#M65792</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://blogs.sas.com/content/iml/2013/09/13/frequencies-vs-weights-in-regression.html" target="_self"&gt;A weight variable is not the same as a frequency variable.&amp;nbsp;&lt;/A&gt;&amp;nbsp;A data set that has 10 observations and a frequency variable might represent 100s of observations.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;A data set that has 10 observations and a weight variable&amp;nbsp;represents 10 data points where each observation has different influence in the analysis.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You accepted Art's answer, so should we assume that you meant "frequency-replicated observations" instead of weighted observations? &amp;nbsp;If so, please consider changing the title.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 14:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/386025#M65792</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-08-07T14:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram for weighted values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/386034#M65793</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;: Is there any difference with respect to producing a histogram (other than the freq variable has to be integers?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 14:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/386034#M65793</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-08-07T14:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Histogram for weighted values</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/386091#M65794</link>
      <description>&lt;P&gt;That's a good question, Art. &lt;STRONG&gt;If&lt;/STRONG&gt; the weights are positive integers and if you specify the bandwidth, then I think the histograms will be the same on the density scale. However, most histogram algorithms use an automated binning algorithm that chooses bins based on the number of observations, N. Since N for the frequency case isn't the same as N for the weighted case, you might get different bin widths from the&amp;nbsp;automated binning algorithm. Theoretically, a frequency variable will result in smaller bin widths&amp;nbsp;because there are more observations.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Aug 2017 17:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Histogram-for-weighted-values/m-p/386091#M65794</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-08-07T17:26:32Z</dc:date>
    </item>
  </channel>
</rss>

