<?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 proc tabulate doesn't mach proc freq with a lot of variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966577#M83986</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to create an easy-to-read output table with 42 variables (rows) and their distribution within gender classes.&lt;/P&gt;&lt;P&gt;I could use proc freq as follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc freq data=mydata;
table (anm_diabete anm_scompenso_cardiaco anm_pacemaker anm_bpco ... )*ang_sex/ norow nopercent;
run;&lt;/PRE&gt;&lt;P&gt;but I would like to unify the results in a single table.&lt;/P&gt;&lt;P&gt;I tryed to use proc tabulate with this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc tabulate data=mydata; 
class anm_diabete anm_scompenso_cardiaco anm_pacemaker anm_bpco ... ang_sex;
table (anm_diabete anm_scompenso_cardiaco anm_pacemaker anm_bpco ...), &lt;BR /&gt;   ang_sex*(n='N'*f=8.0 pctn&amp;lt;anm_diabete anm_scompenso_cardiaco anm_pacemaker anm_bpco ...&amp;gt;='%'*f=8.1) / box=' ';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This procedure works with few variables, but with the entire set of variables (42 variables), frequencies are totally different.&lt;/P&gt;&lt;P&gt;Here is the output with only 4 variables (and correct frequencies/percentages):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Immagine1.png" style="width: 261px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/106941i4BFCA5DFC6DE7CC9/image-dimensions/261x368?v=v2" width="261" height="368" role="button" title="Immagine1.png" alt="Immagine1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the output with all 42 variables inserted in the proc tabulate (only first 8 variables shown):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Immagine2.png" style="width: 506px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/106942iC0785002B45FF2E2/image-dimensions/506x527?v=v2" width="506" height="527" role="button" title="Immagine2.png" alt="Immagine2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any ideas about how to correctly use proc tabulate or any macro to unified results from proc freq?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance!&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;</description>
    <pubDate>Thu, 15 May 2025 13:02:48 GMT</pubDate>
    <dc:creator>Elena173</dc:creator>
    <dc:date>2025-05-15T13:02:48Z</dc:date>
    <item>
      <title>proc tabulate doesn't mach proc freq with a lot of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966577#M83986</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to create an easy-to-read output table with 42 variables (rows) and their distribution within gender classes.&lt;/P&gt;&lt;P&gt;I could use proc freq as follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc freq data=mydata;
table (anm_diabete anm_scompenso_cardiaco anm_pacemaker anm_bpco ... )*ang_sex/ norow nopercent;
run;&lt;/PRE&gt;&lt;P&gt;but I would like to unify the results in a single table.&lt;/P&gt;&lt;P&gt;I tryed to use proc tabulate with this code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc tabulate data=mydata; 
class anm_diabete anm_scompenso_cardiaco anm_pacemaker anm_bpco ... ang_sex;
table (anm_diabete anm_scompenso_cardiaco anm_pacemaker anm_bpco ...), &lt;BR /&gt;   ang_sex*(n='N'*f=8.0 pctn&amp;lt;anm_diabete anm_scompenso_cardiaco anm_pacemaker anm_bpco ...&amp;gt;='%'*f=8.1) / box=' ';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This procedure works with few variables, but with the entire set of variables (42 variables), frequencies are totally different.&lt;/P&gt;&lt;P&gt;Here is the output with only 4 variables (and correct frequencies/percentages):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Immagine1.png" style="width: 261px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/106941i4BFCA5DFC6DE7CC9/image-dimensions/261x368?v=v2" width="261" height="368" role="button" title="Immagine1.png" alt="Immagine1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here is the output with all 42 variables inserted in the proc tabulate (only first 8 variables shown):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Immagine2.png" style="width: 506px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/106942iC0785002B45FF2E2/image-dimensions/506x527?v=v2" width="506" height="527" role="button" title="Immagine2.png" alt="Immagine2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any ideas about how to correctly use proc tabulate or any macro to unified results from proc freq?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance!&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;</description>
      <pubDate>Thu, 15 May 2025 13:02:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966577#M83986</guid>
      <dc:creator>Elena173</dc:creator>
      <dc:date>2025-05-15T13:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate doesn't mach proc freq with a lot of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966579#M83987</link>
      <description>&lt;P&gt;Missing values of CLASS variables.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/p159jq4oiauvtzn1gfqkod7m5qj3.htm#p1whh2sto2w2vwn19v9f4a16gi8t" target="_self"&gt;How PROC TABULATE Treats Missing Values&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 13:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966579#M83987</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-05-15T13:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate doesn't mach proc freq with a lot of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966593#M83988</link>
      <description>&lt;P&gt;Add&amp;nbsp; /missing to the CLASS statement to get a count of the missing values as Proc Freq does by default. BUT Tabulate will then treat the Missing as a class for percentages. Depending on what you want for display any of the report procedures such as Tabulate or Report may require more work than a simple call to the procedure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note, for future reference it is a good idea to place the output of both procedures when discussing differences in output for the code shown. The output you show for Proc Freq will not be generated by the code shown. It would show a separate table for each pair of variables with the percentage on a different row in the cell, a row and column total, and likely for some of the variables a frequency for missing. IF you are sending the output to ODS OUTPUT and manipulating the the output data set created to display the results then show that code, not simple Proc Freq.&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 15:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966593#M83988</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-05-15T15:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate doesn't mach proc freq with a lot of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966668#M83989</link>
      <description>&lt;P&gt;Thank you for suggestions. Unfortunately I do no want percentages calculated on missing values. I am trying to find a solution to display in a sigle table (as proc tabulate), all results from proc freq. Without "missing" statement.&lt;/P&gt;&lt;P&gt;I woul like a table like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Immagine3.png" style="width: 420px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/106980iC3DB49CE2D25A762/image-size/large?v=v2&amp;amp;px=999" role="button" title="Immagine3.png" alt="Immagine3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Labels are in examples.&lt;/P&gt;&lt;P&gt;I suppose I have to manipulate ods output from proc freq with a macro to obtain results as above&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>Fri, 16 May 2025 08:53:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966668#M83989</guid>
      <dc:creator>Elena173</dc:creator>
      <dc:date>2025-05-16T08:53:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate doesn't mach proc freq with a lot of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966669#M83990</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/475315"&gt;@Elena173&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for suggestions. Unfortunately I do no want percentages calculated on missing values.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Perhaps there is a misunderstanding, but if you don't want the missings included, PROC TABULATE will do that (as long as you do NOT use the MISSING option).&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 10:07:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966669#M83990</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-05-16T10:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: proc tabulate doesn't mach proc freq with a lot of variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966672#M83991</link>
      <description>&lt;P&gt;The following Sample shows how to reshape the output data set from multiple TABLES requests in PROC FREQ when using ODS OUTPUT:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/kb/37/782.html" target="_self"&gt;https://support.sas.com/kb/37/782.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 11:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-tabulate-doesn-t-mach-proc-freq-with-a-lot-of-variables/m-p/966672#M83991</guid>
      <dc:creator>Kathryn_SAS</dc:creator>
      <dc:date>2025-05-16T11:09:00Z</dc:date>
    </item>
  </channel>
</rss>

