<?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: Proc freq vs proc tabulate, different results for colpctn? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-freq-vs-proc-tabulate-different-results-for-colpctn/m-p/157698#M41307</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! Looked at the documentation, and apparently weight statements for each procedure has slightly different use. In proc freq weight statement it is used for multiplication of observations for counts, whereas in proc tabulate it is used for computation of weighted statistics like mean, variance etc. For the same use as in proc freq, you have to use freq statement in proc tabulate, that will get the same results. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 07 Feb 2015 21:16:33 GMT</pubDate>
    <dc:creator>gabon</dc:creator>
    <dc:date>2015-02-07T21:16:33Z</dc:date>
    <item>
      <title>Proc freq vs proc tabulate, different results for colpctn?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-freq-vs-proc-tabulate-different-results-for-colpctn/m-p/157696#M41305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to compute column percentages and total percentages for my data. The problem is, proc freq gets correct results, but not the desired table layout, with proc tabulate I can get desired layout but slightly different column percentages results, how is this possible? Can someone advise me how to adjust my proc tabulate to get the same column percentages and total percentages as my proc freq?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data step is the same for both procedures:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data work.subset1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set library.database&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; where HS01 between 1 and 5;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; keep pid AGE sex WGT HS01;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My proc freq step and output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=work.subset1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; tables HS01*(sex AGE)/nofreq norow;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; weight WGT;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; format HS01 sbjzdravie. sex pohlavie. AGE vek.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="9084" alt="output7.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/9084_output7.jpg" width="450" /&gt;&lt;/P&gt;&lt;P&gt;My proc tabulate step with the same data step.. and output:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc tabulate data=work.subset1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; class HS01 sex AGE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; table (HS01 all)*f=5.1, (all sex)*(colpctn)*f=5.1 AGE*colpctn*f=5.1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; weight WGT;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format HS01 sbjzdravie. sex pohlavie. AGE vek.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="9085" alt="output8.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/9085_output8.jpg" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Feb 2015 19:43:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-freq-vs-proc-tabulate-different-results-for-colpctn/m-p/157696#M41305</guid>
      <dc:creator>gabon</dc:creator>
      <dc:date>2015-02-07T19:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq vs proc tabulate, different results for colpctn?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-freq-vs-proc-tabulate-different-results-for-colpctn/m-p/157697#M41306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look at the documentation of the WEIGHT statement for each proc - specifically the defaults. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Feb 2015 19:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-freq-vs-proc-tabulate-different-results-for-colpctn/m-p/157697#M41306</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-02-07T19:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq vs proc tabulate, different results for colpctn?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-freq-vs-proc-tabulate-different-results-for-colpctn/m-p/157698#M41307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! Looked at the documentation, and apparently weight statements for each procedure has slightly different use. In proc freq weight statement it is used for multiplication of observations for counts, whereas in proc tabulate it is used for computation of weighted statistics like mean, variance etc. For the same use as in proc freq, you have to use freq statement in proc tabulate, that will get the same results. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Feb 2015 21:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-freq-vs-proc-tabulate-different-results-for-colpctn/m-p/157698#M41307</guid>
      <dc:creator>gabon</dc:creator>
      <dc:date>2015-02-07T21:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc freq vs proc tabulate, different results for colpctn?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-freq-vs-proc-tabulate-different-results-for-colpctn/m-p/226485#M54043</link>
      <description>&lt;P&gt;Hi Gabon,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please show how you specified FREQ freq statement in proc tabulate? I am stuggling with exact same problem here. My proc tabulate reqult is diff from that of proc freq.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2015 03:20:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-freq-vs-proc-tabulate-different-results-for-colpctn/m-p/226485#M54043</guid>
      <dc:creator>Maggie</dc:creator>
      <dc:date>2015-09-21T03:20:11Z</dc:date>
    </item>
  </channel>
</rss>

