<?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: Calculate weighted proportion, weighted sensitivity, and weighted specificity in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837821#M41497</link>
    <description>&lt;P&gt;calling &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&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;
 set sashelp.heart;
 keep status bp_status sex;
run;

proc freq data=have noprint;
table bp_status*status*sex/out=temp list;
run;

proc freq data=temp;
by bp_status;
table status*sex/senspec ;
weight COUNT;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 11 Oct 2022 11:59:09 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2022-10-11T11:59:09Z</dc:date>
    <item>
      <title>Calculate weighted proportion, weighted sensitivity, and weighted specificity</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837747#M41494</link>
      <description>&lt;P&gt;After data analysis, I have created a table like below. I was asked to calculate&amp;nbsp;weighted proportion, weighted sensitivity, and weighted specificity of each type. I googled a lot but no success. Please help. If not possible in SAS, is there any way to calculate manually, at lease.&lt;/P&gt;
&lt;TABLE border="1" width="99.99847379813511%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="7.8677309007981755%" height="19" style="height: 14.4pt; width: 48pt;"&gt;Type&lt;/TD&gt;
&lt;TD width="15.621436716077536%" style="width: 48pt;"&gt;Count_TotalPop&lt;/TD&gt;
&lt;TD width="23.48916761687571%" style="width: 48pt;"&gt;Count_SurveyPop&lt;/TD&gt;
&lt;TD width="10.718358038768528%" style="width: 48pt;"&gt;Sensitivity&lt;/TD&gt;
&lt;TD width="9.578107183580387%" style="width: 48pt;"&gt;Specificity&lt;/TD&gt;
&lt;TD width="12.770809578107183%" style="width: 48pt;"&gt;Proportion_TotalPop&lt;/TD&gt;
&lt;TD width="19.61231470923603%" style="width: 48pt;"&gt;Proportion_SurveyPop&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="7.8677309007981755%" height="19" style="height: 14.4pt;"&gt;A&lt;/TD&gt;
&lt;TD width="15.621436716077536%" align="right"&gt;4000&lt;/TD&gt;
&lt;TD width="23.48916761687571%" align="right"&gt;20&lt;/TD&gt;
&lt;TD width="10.718358038768528%" align="right"&gt;79&lt;/TD&gt;
&lt;TD width="9.578107183580387%" align="right"&gt;67&lt;/TD&gt;
&lt;TD width="12.770809578107183%" class="lia-align-right"&gt;0.23&lt;/TD&gt;
&lt;TD width="19.61231470923603%" align="right" class="xl63"&gt;0.17&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="7.8677309007981755%" height="19" style="height: 14.4pt;"&gt;B&lt;/TD&gt;
&lt;TD width="15.621436716077536%" align="right"&gt;3500&lt;/TD&gt;
&lt;TD width="23.48916761687571%" align="right"&gt;30&lt;/TD&gt;
&lt;TD width="10.718358038768528%" align="right"&gt;100&lt;/TD&gt;
&lt;TD width="9.578107183580387%" align="right"&gt;69&lt;/TD&gt;
&lt;TD width="12.770809578107183%" class="lia-align-right"&gt;0.20&lt;/TD&gt;
&lt;TD width="19.61231470923603%" align="right" class="xl63"&gt;0.26&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="7.8677309007981755%" height="19" style="height: 14.4pt;"&gt;C&lt;/TD&gt;
&lt;TD width="15.621436716077536%" align="right"&gt;3000&lt;/TD&gt;
&lt;TD width="23.48916761687571%" align="right"&gt;25&lt;/TD&gt;
&lt;TD width="10.718358038768528%" align="right"&gt;90&lt;/TD&gt;
&lt;TD width="9.578107183580387%" align="right"&gt;78&lt;/TD&gt;
&lt;TD width="12.770809578107183%" class="lia-align-right"&gt;0.17&lt;/TD&gt;
&lt;TD width="19.61231470923603%" align="right" class="xl63"&gt;0.21&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="7.8677309007981755%" height="19" style="height: 14.4pt;"&gt;D&lt;/TD&gt;
&lt;TD width="15.621436716077536%" align="right"&gt;2000&lt;/TD&gt;
&lt;TD width="23.48916761687571%" align="right"&gt;20&lt;/TD&gt;
&lt;TD width="10.718358038768528%" align="right"&gt;100&lt;/TD&gt;
&lt;TD width="9.578107183580387%" align="right"&gt;100&lt;/TD&gt;
&lt;TD width="12.770809578107183%" class="lia-align-right"&gt;0.11&lt;/TD&gt;
&lt;TD width="19.61231470923603%" align="right" class="xl63"&gt;0.17&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="7.8677309007981755%" height="19" style="height: 14.4pt;"&gt;E&lt;/TD&gt;
&lt;TD width="15.621436716077536%" align="right"&gt;5000&lt;/TD&gt;
&lt;TD width="23.48916761687571%" align="right"&gt;22&lt;/TD&gt;
&lt;TD width="10.718358038768528%" align="right"&gt;75&lt;/TD&gt;
&lt;TD width="9.578107183580387%" align="right"&gt;55&lt;/TD&gt;
&lt;TD width="12.770809578107183%" class="lia-align-right"&gt;0.29&lt;/TD&gt;
&lt;TD width="19.61231470923603%" align="right" class="xl63"&gt;0.19&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 23:53:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837747#M41494</guid>
      <dc:creator>Barkat</dc:creator>
      <dc:date>2022-10-10T23:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate weighted proportion, weighted sensitivity, and weighted specificity</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837821#M41497</link>
      <description>&lt;P&gt;calling &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13633"&gt;@StatDave&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;
 set sashelp.heart;
 keep status bp_status sex;
run;

proc freq data=have noprint;
table bp_status*status*sex/out=temp list;
run;

proc freq data=temp;
by bp_status;
table status*sex/senspec ;
weight COUNT;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Oct 2022 11:59:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837821#M41497</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-10-11T11:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate weighted proportion, weighted sensitivity, and weighted specificity</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837829#M41499</link>
      <description>&lt;P&gt;One easy way to do this would be to use Proc SURVEYFREQ with the WEIGHT statement and the SENSPEC option on the TABLES statement.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 12:24:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837829#M41499</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2022-10-11T12:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate weighted proportion, weighted sensitivity, and weighted specificity</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837842#M41501</link>
      <description>I like your idea, but I was wondering, WEIGHT of which variable? Would you please give me an example?</description>
      <pubDate>Tue, 11 Oct 2022 12:56:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837842#M41501</guid>
      <dc:creator>Barkat</dc:creator>
      <dc:date>2022-10-11T12:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate weighted proportion, weighted sensitivity, and weighted specificity</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837853#M41502</link>
      <description>&lt;P&gt;I am not sure I understand what you mean when you ask "weight of which variable?"&amp;nbsp; Typically the weight is part of the sample design.&amp;nbsp; I would suggest going back to the person who asked for the weighted statistics and ask them what they want you to weight the analysis by.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as an example you could look at the Getting Started example in the SURVEYFREQ statement.&amp;nbsp; Note how the data has a variable in it called SamplingWeight which was part of the design.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_surveyfreq_gettingstarted.htm" target="_blank"&gt;SAS Help Center: Getting Started: SURVEYFREQ Procedure&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your case since you only have weights and not a complex survey design, you would remove the CLUSTER and STRATA statements.&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token step keyword"&gt;proc surveyfreq&lt;/SPAN&gt; &lt;SPAN class="token proc-args"&gt;&lt;SPAN class="token arg keyword"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token arg-value"&gt;SIS&lt;/SPAN&gt;_&lt;SPAN class="token arg keyword"&gt;Survey&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;tables SchoolType &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;*&lt;/SPAN&gt;&lt;SPAN&gt; Response &lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;senspec;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;weight SamplingWeight&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token step keyword"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 13:30:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837853#M41502</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2022-10-11T13:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate weighted proportion, weighted sensitivity, and weighted specificity</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837871#M41503</link>
      <description>&lt;P&gt;Weighted how? What weight is to be applied where?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/335985"&gt;@Barkat&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;After data analysis, I have created a table like below. I was asked to calculate&amp;nbsp;weighted proportion, weighted sensitivity, and weighted specificity of each type. I googled a lot but no success. Please help. If not possible in SAS, is there any way to calculate manually, at lease.&lt;/P&gt;
&lt;TABLE border="1" width="99.99847379813511%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="7.8677309007981755%" height="19" style="height: 14.4pt; width: 48pt;"&gt;Type&lt;/TD&gt;
&lt;TD width="15.621436716077536%" style="width: 48pt;"&gt;Count_TotalPop&lt;/TD&gt;
&lt;TD width="23.48916761687571%" style="width: 48pt;"&gt;Count_SurveyPop&lt;/TD&gt;
&lt;TD width="10.718358038768528%" style="width: 48pt;"&gt;Sensitivity&lt;/TD&gt;
&lt;TD width="9.578107183580387%" style="width: 48pt;"&gt;Specificity&lt;/TD&gt;
&lt;TD width="12.770809578107183%" style="width: 48pt;"&gt;Proportion_TotalPop&lt;/TD&gt;
&lt;TD width="19.61231470923603%" style="width: 48pt;"&gt;Proportion_SurveyPop&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="7.8677309007981755%" height="19" style="height: 14.4pt;"&gt;A&lt;/TD&gt;
&lt;TD width="15.621436716077536%" align="right"&gt;4000&lt;/TD&gt;
&lt;TD width="23.48916761687571%" align="right"&gt;20&lt;/TD&gt;
&lt;TD width="10.718358038768528%" align="right"&gt;79&lt;/TD&gt;
&lt;TD width="9.578107183580387%" align="right"&gt;67&lt;/TD&gt;
&lt;TD width="12.770809578107183%" class="lia-align-right"&gt;0.23&lt;/TD&gt;
&lt;TD width="19.61231470923603%" align="right" class="xl63"&gt;0.17&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="7.8677309007981755%" height="19" style="height: 14.4pt;"&gt;B&lt;/TD&gt;
&lt;TD width="15.621436716077536%" align="right"&gt;3500&lt;/TD&gt;
&lt;TD width="23.48916761687571%" align="right"&gt;30&lt;/TD&gt;
&lt;TD width="10.718358038768528%" align="right"&gt;100&lt;/TD&gt;
&lt;TD width="9.578107183580387%" align="right"&gt;69&lt;/TD&gt;
&lt;TD width="12.770809578107183%" class="lia-align-right"&gt;0.20&lt;/TD&gt;
&lt;TD width="19.61231470923603%" align="right" class="xl63"&gt;0.26&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="7.8677309007981755%" height="19" style="height: 14.4pt;"&gt;C&lt;/TD&gt;
&lt;TD width="15.621436716077536%" align="right"&gt;3000&lt;/TD&gt;
&lt;TD width="23.48916761687571%" align="right"&gt;25&lt;/TD&gt;
&lt;TD width="10.718358038768528%" align="right"&gt;90&lt;/TD&gt;
&lt;TD width="9.578107183580387%" align="right"&gt;78&lt;/TD&gt;
&lt;TD width="12.770809578107183%" class="lia-align-right"&gt;0.17&lt;/TD&gt;
&lt;TD width="19.61231470923603%" align="right" class="xl63"&gt;0.21&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="7.8677309007981755%" height="19" style="height: 14.4pt;"&gt;D&lt;/TD&gt;
&lt;TD width="15.621436716077536%" align="right"&gt;2000&lt;/TD&gt;
&lt;TD width="23.48916761687571%" align="right"&gt;20&lt;/TD&gt;
&lt;TD width="10.718358038768528%" align="right"&gt;100&lt;/TD&gt;
&lt;TD width="9.578107183580387%" align="right"&gt;100&lt;/TD&gt;
&lt;TD width="12.770809578107183%" class="lia-align-right"&gt;0.11&lt;/TD&gt;
&lt;TD width="19.61231470923603%" align="right" class="xl63"&gt;0.17&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 14.4pt;"&gt;
&lt;TD width="7.8677309007981755%" height="19" style="height: 14.4pt;"&gt;E&lt;/TD&gt;
&lt;TD width="15.621436716077536%" align="right"&gt;5000&lt;/TD&gt;
&lt;TD width="23.48916761687571%" align="right"&gt;22&lt;/TD&gt;
&lt;TD width="10.718358038768528%" align="right"&gt;75&lt;/TD&gt;
&lt;TD width="9.578107183580387%" align="right"&gt;55&lt;/TD&gt;
&lt;TD width="12.770809578107183%" class="lia-align-right"&gt;0.29&lt;/TD&gt;
&lt;TD width="19.61231470923603%" align="right" class="xl63"&gt;0.19&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 15:27:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Calculate-weighted-proportion-weighted-sensitivity-and-weighted/m-p/837871#M41503</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-11T15:27:37Z</dc:date>
    </item>
  </channel>
</rss>

