<?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: How do I add a total column to a proc tabulate table? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-add-a-total-column-to-a-proc-tabulate-table/m-p/565063#M158570</link>
    <description>&lt;P&gt;To avoid crossing statistics place them all in one dimension such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;PROC TABULATE DATA = CHSS2017_s1 f=10.2 S=[just=c cellwidth=75]; 

CLASS AGE SEX Q21;

CLASSLEV AGE      / style=[font_weight=medium];
CLASSLEV SEX      / style=[font_weight=medium];
CLASSLEV Q21;
*FREQ REGIONWT;

TABLE ALL  	  = 'Greater Cincinnati Residents'
	   AGE 	  = 'Age'   		 
      SEX     		    		 
	  , Q21* (rowpctn=' '*f=Pctf. all=' '*n);

RUN;&lt;/PRE&gt;</description>
    <pubDate>Mon, 10 Jun 2019 21:18:09 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2019-06-10T21:18:09Z</dc:date>
    <item>
      <title>How do I add a total column to a proc tabulate table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-add-a-total-column-to-a-proc-tabulate-table/m-p/564993#M158534</link>
      <description>&lt;P&gt;In SAS 9.4, I have a proc tabulate data block that produces a table of row percentages. I need a new column at the end that displays the total count of the row in the table. I'm getting an error about mixed/multiple statistics:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ERROR: There are multiple statistics associated with a single table cell in the following nesting: All * RowPctN * f * All * Sum."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC TABULATE DATA = CHSS2017_s1 f=10.2 S=[just=c cellwidth=75]; 

CLASS AGE SEX Q21;

CLASSLEV AGE      / style=[font_weight=medium];
CLASSLEV SEX      / style=[font_weight=medium];
CLASSLEV Q21;
*FREQ REGIONWT;

TABLE ALL  	  = 'Greater Cincinnati Residents' * (ROWPCTN='	'*f=PCTF.)
	  AGE 	  = 'Age'   		 * (ROWPCTN='	'*f=PCTF.)
      SEX     		    		 * (ROWPCTN='	'*f=PCTF.)
	  , Q21 all=' '*sum;

RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How can I replicate the table shown in this ticket? All three variables (age, sex, and q21) are categorical variables; the values for age and sex by q21 should be row pct, but each group within age and sex should have its own row count at the end of the table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/30169i383BD47631B27886/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2019 18:06:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-add-a-total-column-to-a-proc-tabulate-table/m-p/564993#M158534</guid>
      <dc:creator>dgrolling</dc:creator>
      <dc:date>2019-06-10T18:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I add a total column to a proc tabulate table?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-add-a-total-column-to-a-proc-tabulate-table/m-p/565063#M158570</link>
      <description>&lt;P&gt;To avoid crossing statistics place them all in one dimension such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;PROC TABULATE DATA = CHSS2017_s1 f=10.2 S=[just=c cellwidth=75]; 

CLASS AGE SEX Q21;

CLASSLEV AGE      / style=[font_weight=medium];
CLASSLEV SEX      / style=[font_weight=medium];
CLASSLEV Q21;
*FREQ REGIONWT;

TABLE ALL  	  = 'Greater Cincinnati Residents'
	   AGE 	  = 'Age'   		 
      SEX     		    		 
	  , Q21* (rowpctn=' '*f=Pctf. all=' '*n);

RUN;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Jun 2019 21:18:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-add-a-total-column-to-a-proc-tabulate-table/m-p/565063#M158570</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-10T21:18:09Z</dc:date>
    </item>
  </channel>
</rss>

