<?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: Get standard deviation of sum using weights in PROC TABULATE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Get-standard-deviation-of-sum-using-weights-in-PROC-TABULATE/m-p/445194#M111529</link>
    <description>&lt;PRE&gt;Total*(gtube)*(Sum='N'*f=comma12.0 ColPctSum='%'*f=pctf.  std) &lt;/PRE&gt;
&lt;P&gt;should give you the standard deviation&amp;nbsp;of gtube using weights.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Mar 2018 15:14:20 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-03-13T15:14:20Z</dc:date>
    <item>
      <title>Get standard deviation of sum using weights in PROC TABULATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-standard-deviation-of-sum-using-weights-in-PROC-TABULATE/m-p/445003#M111466</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if there is a way to add a column with the std dev next to the sum of certain variables in PROC TABULATE. I only seem to get the STD to work when i am calculating the mean value of variables but I use weights to calculate the sum of variables and I want to include the standard deviation of using those weights (basically the same standard deviation number you get when u use surveymeans to calculate the number of occurrences a variable appears).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried putting the WEIGHT statement in various places, I've tried using the vardef=weight but nothing seems to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC TABULATE&lt;BR /&gt;DATA=kid.prs (where=(PRS=1));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;VAR total;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLASS FEMALE /&amp;nbsp;&amp;nbsp; &amp;nbsp;ORDER=UNFORMATTED MISSING;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLASS race /&amp;nbsp;&amp;nbsp; &amp;nbsp;ORDER=UNFORMATTED MISSING;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLASS hosp_division /&amp;nbsp;&amp;nbsp; &amp;nbsp;ORDER=UNFORMATTED MISSING;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLASS zipinc /&amp;nbsp;&amp;nbsp; &amp;nbsp;ORDER=UNFORMATTED MISSING;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLASS dispuniform /&amp;nbsp;&amp;nbsp; &amp;nbsp;ORDER=UNFORMATTED MISSING;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLASS hosp_locteach /&amp;nbsp;&amp;nbsp; &amp;nbsp;ORDER=UNFORMATTED MISSING;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLASS gtube /&amp;nbsp;&amp;nbsp; &amp;nbsp;ORDER=UNFORMATTED MISSING;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLASS MDO /&amp;nbsp;&amp;nbsp; &amp;nbsp;ORDER=UNFORMATTED MISSING;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLASS TLA /&amp;nbsp;&amp;nbsp; &amp;nbsp;ORDER=UNFORMATTED MISSING;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLASS Trach /&amp;nbsp;&amp;nbsp; &amp;nbsp;ORDER=UNFORMATTED MISSING;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CLASS syndromic /&amp;nbsp;&amp;nbsp; &amp;nbsp;ORDER=UNFORMATTED MISSING;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;keyword all sum / style=[fontwidth=wide];&lt;BR /&gt;&amp;nbsp;&amp;nbsp; keylabel all="Total";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;TABLE /* Row Dimension */&lt;BR /&gt;FEMALE RACE hosp_division zipinc dispuniform hosp_locteach,&lt;BR /&gt;/* Column Dimension */&lt;BR /&gt;Total*(gtube)*(Sum='N'*f=comma12.0 ColPctSum='%'*f=pctf.) / nocellmerge;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;WEIGHT DISCWT;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Format race racef.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Format female femalef.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Format hosp_division divisionf.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Format zipinc zipincf.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Format dispuniform dispf.;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;Format hosp_locteach hosp_locteachf.;&lt;BR /&gt;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 03:04:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-standard-deviation-of-sum-using-weights-in-PROC-TABULATE/m-p/445003#M111466</guid>
      <dc:creator>jsimmo02</dc:creator>
      <dc:date>2018-03-13T03:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get standard deviation of sum using weights in PROC TABULATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-standard-deviation-of-sum-using-weights-in-PROC-TABULATE/m-p/445194#M111529</link>
      <description>&lt;PRE&gt;Total*(gtube)*(Sum='N'*f=comma12.0 ColPctSum='%'*f=pctf.  std) &lt;/PRE&gt;
&lt;P&gt;should give you the standard deviation&amp;nbsp;of gtube using weights.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 15:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-standard-deviation-of-sum-using-weights-in-PROC-TABULATE/m-p/445194#M111529</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-13T15:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get standard deviation of sum using weights in PROC TABULATE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-standard-deviation-of-sum-using-weights-in-PROC-TABULATE/m-p/446448#M112010</link>
      <description>&lt;P&gt;That doesn't work. It seems as if the STD only works for means/median calculations not the sum calculation&lt;/P&gt;</description>
      <pubDate>Sat, 17 Mar 2018 14:51:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-standard-deviation-of-sum-using-weights-in-PROC-TABULATE/m-p/446448#M112010</guid>
      <dc:creator>jsimmo02</dc:creator>
      <dc:date>2018-03-17T14:51:44Z</dc:date>
    </item>
  </channel>
</rss>

