<?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: Weight in proc tabulate without VAR statment in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Weight-in-proc-tabulate-without-VAR-statment/m-p/598742#M16353</link>
    <description>&lt;P&gt;Here is an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just try FREQ, it look like my N change but not like I want.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I want the N to be weight because I know the real population number and when I weight with proc freq for exemple the N represents all the population not just the sample.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example in the excel file (want but weight) I know that the total N when it is weight, it should be 54 036 (real population number). Unweight it is 38982.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Oct 2019 15:11:56 GMT</pubDate>
    <dc:creator>philippe777</dc:creator>
    <dc:date>2019-10-23T15:11:56Z</dc:date>
    <item>
      <title>Weight in proc tabulate without VAR statment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Weight-in-proc-tabulate-without-VAR-statment/m-p/598724#M16349</link>
      <description>&lt;P&gt;Hi i am trying to weight the pourcentage and the N in a proc tabulate procedure. I try multiple approch but none of them seems to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my syntax ((I need reapet the proc tabulate procedure over 200 times (for 200 differents variables)) all with the same weight variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc tabulate data=SWS1819;&lt;BR /&gt;class SH_LOS01 &amp;amp;SH_GROUP / missing;&lt;BR /&gt;table (SH_LOS01 ALL = 'total'),&amp;nbsp; (&amp;amp;SH_GROUP)*&amp;nbsp; (n='#' colpctn='%');&amp;nbsp;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks if you can help me.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 14:34:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Weight-in-proc-tabulate-without-VAR-statment/m-p/598724#M16349</guid>
      <dc:creator>philippe777</dc:creator>
      <dc:date>2019-10-23T14:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Weight in proc tabulate without VAR statment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Weight-in-proc-tabulate-without-VAR-statment/m-p/598732#M16351</link>
      <description>&lt;P&gt;A small example data set and what you expect for output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your "weight" is a count variable then use FREQ instead of Weight.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider that the N statistic is intended to be a count what would the actual meaning of a non-integer weighted N be?&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>Wed, 23 Oct 2019 14:49:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Weight-in-proc-tabulate-without-VAR-statment/m-p/598732#M16351</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-23T14:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Weight in proc tabulate without VAR statment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Weight-in-proc-tabulate-without-VAR-statment/m-p/598742#M16353</link>
      <description>&lt;P&gt;Here is an example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just try FREQ, it look like my N change but not like I want.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I want the N to be weight because I know the real population number and when I weight with proc freq for exemple the N represents all the population not just the sample.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example in the excel file (want but weight) I know that the total N when it is weight, it should be 54 036 (real population number). Unweight it is 38982.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 15:11:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Weight-in-proc-tabulate-without-VAR-statment/m-p/598742#M16353</guid>
      <dc:creator>philippe777</dc:creator>
      <dc:date>2019-10-23T15:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Weight in proc tabulate without VAR statment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Weight-in-proc-tabulate-without-VAR-statment/m-p/598752#M16354</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/114484"&gt;@philippe777&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Here is an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just try FREQ, it look like my N change but not like I want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I want the N to be weight because I know the real population number and when I weight with proc freq for exemple the N represents all the population not just the sample.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example in the excel file (want but weight) I know that the total N when it is weight, it should be 54 036 (real population number). Unweight it is 38982.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks for your help.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since you haven't shown any INPUT data or what you expect the output to look like we are &lt;STRONG&gt;guessing&lt;/STRONG&gt; as to your need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I seems like you&amp;nbsp;might want to add a dummy variable with the value of 1 to each record, add that variable as a VAR record, apply the weight value and use SUM and PCTSUM on the dummy variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe something like:&lt;/P&gt;
&lt;PRE&gt;data swstab;
   set sws1819;
   dummy=1;
run;

proc tabulate data=SWStab;
   weight weightvar;
   class SH_LOS01 &amp;amp;SH_GROUP / missing;
   var dummy;
table (SH_LOS01 ALL = 'total'),  (&amp;amp;SH_GROUP)* dummy=''*(sum='#' colpctsum='%'); 
run;
&lt;/PRE&gt;
&lt;P&gt;For readability if the &amp;amp;sh_group has many variables it might be better to use that in the row dimension&amp;nbsp;instead of the column dimension.&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>Wed, 23 Oct 2019 15:24:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Weight-in-proc-tabulate-without-VAR-statment/m-p/598752#M16354</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-23T15:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Weight in proc tabulate without VAR statment</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Weight-in-proc-tabulate-without-VAR-statment/m-p/598766#M16356</link>
      <description>&lt;P&gt;Work perfectly thanks a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 16:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Weight-in-proc-tabulate-without-VAR-statment/m-p/598766#M16356</guid>
      <dc:creator>philippe777</dc:creator>
      <dc:date>2019-10-23T16:09:58Z</dc:date>
    </item>
  </channel>
</rss>

