<?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: Weighted frequencies, proc surveyfreq vs proc surveymeans in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Weighted-frequencies-proc-surveyfreq-vs-proc-surveymeans/m-p/758795#M36944</link>
    <description>&lt;P&gt;I have posted my code below. I included the SUMWGT suggested by Watts. I think Watts answered my question. If you have any other suggestions for options I should, or should not, be using. I would appreciate the input! Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*VARIABLE 1*/
PROC SURVEYFREQ DATA=data1 NOMCAR;
STRATA strata;
CLUSTER cluster;
WEIGHT weight;
TABLES  var1 / ROW CL;
RUN;

VS
 
PROC SURVEYMEANS DATA=data1;
STRATA strata;
CLUSTER cluster;
WEIGHT weight;
VAR var1; 
CLASS var1;
RUN;      &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 02 Aug 2021 14:12:10 GMT</pubDate>
    <dc:creator>MillerEL</dc:creator>
    <dc:date>2021-08-02T14:12:10Z</dc:date>
    <item>
      <title>Weighted frequencies, proc surveyfreq vs proc surveymeans</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weighted-frequencies-proc-surveyfreq-vs-proc-surveymeans/m-p/758505#M36929</link>
      <description>&lt;P&gt;I have a question about the weighted frequencies between proc surveyfreq and proc surveymeans. I'm sure this seems super simple to you all out there, but I'm stuck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm doing an analysis of a categorical variable from a complex survey. Someone has requested the weighted numerator and denominator. The problem is that I don't know which of the methods below is correct, or if I'm fundamentally misunderstanding something about the procedures and the &lt;EM&gt;Sum of Weights.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Proc SurveyMeans&lt;/P&gt;&lt;P&gt;The output for proc surveymeans does &lt;U&gt;not&lt;/U&gt; provide weighted frequencies. One recommendation was to use&amp;nbsp;&lt;EM&gt;Sum of Weights&amp;nbsp;&lt;/EM&gt;as the weighted denominator, and the&amp;nbsp;&lt;EM&gt;Mean&lt;/EM&gt;&amp;nbsp;multiplied by the &lt;EM&gt;Sum of Weights&lt;/EM&gt;&amp;nbsp;as the weighted numerator. In the example below (for indicator=1):&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Weighted numerator = .226788 *&amp;nbsp;1,060,305 =&amp;nbsp;240,464&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Weighted denominator = 1,060,305&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Prevalence = 22.68%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MillerEL_2-1627675711637.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62154iC2CE015D27EE0FFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MillerEL_2-1627675711637.png" alt="MillerEL_2-1627675711637.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, Proc SurveyFreq is the recommended procedure for categorical variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Proc SurveyFreq&lt;/P&gt;&lt;P&gt;The output for proc surveyfreq provides a&amp;nbsp;&lt;EM&gt;Weighted Frequency,&amp;nbsp;&lt;/EM&gt;which does &lt;U&gt;not&lt;/U&gt; match the numerator above (227,043 vs 240,464).&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Proc SurveyFreq (indicator=1), it would seem like the weight numerator should be 227,043 and the weighted denominator is1,001,125 (do I include the missings?).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the&amp;nbsp;&lt;EM&gt;Sum of Weights&amp;nbsp;&lt;/EM&gt;is the same as with Proc SurveyMeans. How can the weighted denominator be the&amp;nbsp;&lt;EM&gt;Sum of Weights&amp;nbsp;&lt;/EM&gt;in one and not the other?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MillerEL_1-1627674439881.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62153iCE10DA621B704B35/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MillerEL_1-1627674439881.png" alt="MillerEL_1-1627674439881.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've read that both procs handle missing data differently. However, I haven't seen a clear explanation of how those differences impact the interpretation or use of the procedures. Can anyone recommend a good reference that explains the differences (something at the beginner level)? Is that what I'm missing here?&amp;nbsp;Can anyone help me understand what the weighted numerator and denominator should be, and why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 20:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weighted-frequencies-proc-surveyfreq-vs-proc-surveymeans/m-p/758505#M36929</guid>
      <dc:creator>MillerEL</dc:creator>
      <dc:date>2021-07-30T20:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted frequencies, proc surveyfreq vs proc surveymeans</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weighted-frequencies-proc-surveyfreq-vs-proc-surveymeans/m-p/758529#M36932</link>
      <description>&lt;P&gt;Please show the code you are using to generate the output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may need to add options to request the values you want and the actual code used provides information about which approaches may be best for your code.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jul 2021 20:59:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weighted-frequencies-proc-surveyfreq-vs-proc-surveymeans/m-p/758529#M36932</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-30T20:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted frequencies, proc surveyfreq vs proc surveymeans</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weighted-frequencies-proc-surveyfreq-vs-proc-surveymeans/m-p/758602#M36935</link>
      <description>&lt;P&gt;In PROC SURVEYMEANS, you can use the SUM option to display the weighted sum of the analysis variable in the "Statistics" table. And you can use the SUMWGT option to display the sum of the weights in the "Statistics" table. (Documentation is &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_015/statug/statug_surveymeans_syntax01.htm?homeOnFail" target="_self"&gt;here&lt;/A&gt;.)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The difference you see is probably due to missing values in the analysis variable.&amp;nbsp;&lt;SPAN&gt;The "Data Summary" table provides information about the entire input data set -- and doesn't exclude observations that have missing values for the analysis variable(s). But "Statistics" tables are computed separately for each analysis variable that you specify -- and each "Statistics" table excludes observations that have missing values for the analysis variable (unless you specify the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_015/statug/statug_surveymeans_syntax01.htm#statug.surveymeans.missingopt" target="_self"&gt;MISSING&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;option).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PROC SURVEYFREQ handles missing values in the same way. The frequency, crosstabulation, and statistics tables exclude observations that have missing values for the analysis variables (unless you specify the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_015/statug/statug_surveyfreq_syntax01.htm#statug.surveyfreq.sfreqmissing" target="_self"&gt;MISSING&lt;/A&gt;&amp;nbsp;option). For details, see the documentation sections&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_015/statug/statug_surveyfreq_details07.htm" target="_self"&gt;Missing Values&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(SURVEYFREQ) and&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_015/statug/statug_surveymeans_details01.htm" target="_self"&gt;Missing Values&lt;/A&gt;&amp;nbsp;(SURVEYMEANS).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Jul 2021 16:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weighted-frequencies-proc-surveyfreq-vs-proc-surveymeans/m-p/758602#M36935</guid>
      <dc:creator>Watts</dc:creator>
      <dc:date>2021-07-31T16:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Weighted frequencies, proc surveyfreq vs proc surveymeans</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Weighted-frequencies-proc-surveyfreq-vs-proc-surveymeans/m-p/758795#M36944</link>
      <description>&lt;P&gt;I have posted my code below. I included the SUMWGT suggested by Watts. I think Watts answered my question. If you have any other suggestions for options I should, or should not, be using. I would appreciate the input! Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*VARIABLE 1*/
PROC SURVEYFREQ DATA=data1 NOMCAR;
STRATA strata;
CLUSTER cluster;
WEIGHT weight;
TABLES  var1 / ROW CL;
RUN;

VS
 
PROC SURVEYMEANS DATA=data1;
STRATA strata;
CLUSTER cluster;
WEIGHT weight;
VAR var1; 
CLASS var1;
RUN;      &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Aug 2021 14:12:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Weighted-frequencies-proc-surveyfreq-vs-proc-surveymeans/m-p/758795#M36944</guid>
      <dc:creator>MillerEL</dc:creator>
      <dc:date>2021-08-02T14:12:10Z</dc:date>
    </item>
  </channel>
</rss>

