<?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: &amp;quot;Subclass&amp;quot; with proc tabulate in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/quot-Subclass-quot-with-proc-tabulate/m-p/492305#M72221</link>
    <description>Ok, thanks!&lt;BR /&gt;</description>
    <pubDate>Tue, 04 Sep 2018 14:09:31 GMT</pubDate>
    <dc:creator>dariatri</dc:creator>
    <dc:date>2018-09-04T14:09:31Z</dc:date>
    <item>
      <title>"Subclass" with proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/quot-Subclass-quot-with-proc-tabulate/m-p/492064#M72201</link>
      <description>Using proc tabulate, I want to create a frequency distribution table (n, %) of a char variable "var1" (which gets 'A' or 'B'). However, 'B' value can be further subdivided by another variable, let's say "var2" (which gets 'b1' or 'b2'). How can I get a table that shows the frequency distribution of 'A' (with no subdivisions) and 'B' (subdivided by var2) all in one table.&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Mon, 03 Sep 2018 14:47:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/quot-Subclass-quot-with-proc-tabulate/m-p/492064#M72201</guid>
      <dc:creator>dariatri</dc:creator>
      <dc:date>2018-09-03T14:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: "Subclass" with proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/quot-Subclass-quot-with-proc-tabulate/m-p/492068#M72202</link>
      <description>&lt;P&gt;You can only do this partially.&amp;nbsp; You would have to use both VAR1 and VAR2 as class variables, and nest them:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var1 * var2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The values of VAR2 would need to be constant for all VAR1=A observations.&amp;nbsp; That constant value would be the only subcategory available when VAR1=A.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Sep 2018 14:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/quot-Subclass-quot-with-proc-tabulate/m-p/492068#M72202</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-09-03T14:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: "Subclass" with proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/quot-Subclass-quot-with-proc-tabulate/m-p/492095#M72204</link>
      <description>&lt;P&gt;If you do it by VAR2 as the sub variable, you can keep it constant for group A and then it'll show as desired, though you'll still have an entry. I set it to missing and added a format to have it show up as a space. If this doesn't meet your expectations please post details&amp;nbsp;of what you're looking for and what you're started with.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*sort data;

proc sort data=sashelp.class out=class;
    by sex age;
run;

*create sublevels with age missing for female;

data class_demo;
    set class;

    if sex='F' then
        age=.;
run;

*format to display missing as a space;

proc format;
    value age_fmt low-high=[8.] .=' ';
run;

*Tabulate example;

proc tabulate data=class_demo;
    class sex age / missing;
    table sex*age, N=Count / misstext='';
    format age age_fmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/230263"&gt;@dariatri&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Using proc tabulate, I want to create a frequency distribution table (n, %) of a char variable "var1" (which gets 'A' or 'B'). However, 'B' value can be further subdivided by another variable, let's say "var2" (which gets 'b1' or 'b2'). How can I get a table that shows the frequency distribution of 'A' (with no subdivisions) and 'B' (subdivided by var2) all in one table.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Sep 2018 18:43:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/quot-Subclass-quot-with-proc-tabulate/m-p/492095#M72204</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-03T18:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: "Subclass" with proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/quot-Subclass-quot-with-proc-tabulate/m-p/492305#M72221</link>
      <description>Ok, thanks!&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Sep 2018 14:09:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/quot-Subclass-quot-with-proc-tabulate/m-p/492305#M72221</guid>
      <dc:creator>dariatri</dc:creator>
      <dc:date>2018-09-04T14:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: "Subclass" with proc tabulate</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/quot-Subclass-quot-with-proc-tabulate/m-p/492307#M72222</link>
      <description>Thank you! Very close to what I was looking for.&lt;BR /&gt;</description>
      <pubDate>Tue, 04 Sep 2018 14:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/quot-Subclass-quot-with-proc-tabulate/m-p/492307#M72222</guid>
      <dc:creator>dariatri</dc:creator>
      <dc:date>2018-09-04T14:10:31Z</dc:date>
    </item>
  </channel>
</rss>

