<?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 Add categories for frequency in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Add-categories-for-frequency/m-p/798786#M314019</link>
    <description>&lt;P&gt;How to add multiple numeric categories to report the number of observations and percentage of&lt;BR /&gt;individuals in each category ?&lt;/P&gt;</description>
    <pubDate>Sat, 26 Feb 2022 00:58:15 GMT</pubDate>
    <dc:creator>ccherrub</dc:creator>
    <dc:date>2022-02-26T00:58:15Z</dc:date>
    <item>
      <title>Add categories for frequency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-categories-for-frequency/m-p/798786#M314019</link>
      <description>&lt;P&gt;How to add multiple numeric categories to report the number of observations and percentage of&lt;BR /&gt;individuals in each category ?&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 00:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-categories-for-frequency/m-p/798786#M314019</guid>
      <dc:creator>ccherrub</dc:creator>
      <dc:date>2022-02-26T00:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Add categories for frequency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-categories-for-frequency/m-p/798794#M314022</link>
      <description>&lt;P&gt;PROC FREQ and apply a format to your variable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or are you asking about when categories overlap?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*This program shows how an multilabel format works and that the summary statistics can be done at a unique level but also aggregated at a higher level included in the data.*/

/*sample data*/
data have;
input Year    Area $    Profit;
cards;
2001    A   1
2002    A   2
2001    B   1
2001    C   3
2002    C   1
2001    E   4
2002    E   2
2001    F   3
2002    F   4
;;;;
run;

*format - groups A/B/C into D and E/F into G as well;
proc format;
value $ area_fmt (multilabel)
'A' = 'A'
'B' = 'B'
'C' = 'C'
'A', 'B', 'C' = 'D'
'E' = 'E'
'F' = 'F'
'E', 'F' = 'G';
run;

*summary statistics - not CLASS and FORMAT statements;
proc means data=have noprint nway;
class year area / mlf;
format area $area_fmt.;
var profit;
output out=want sum(profit)=profit;
run;

*show results;
proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or something like this I'm guessing:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value age_fmt
10-12 = 'Pre-Teen'
13 - high = 'Teenager';
run;

proc freq data=sashelp.class;
table age;
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/413835"&gt;@ccherrub&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;How to add multiple numeric categories to report the number of observations and percentage of&lt;BR /&gt;individuals in each category ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 02:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-categories-for-frequency/m-p/798794#M314022</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-02-26T02:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Add categories for frequency</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Add-categories-for-frequency/m-p/798799#M314025</link>
      <description>More so like variables (frequency etc) overlapping so just one big chart overall</description>
      <pubDate>Sat, 26 Feb 2022 04:15:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Add-categories-for-frequency/m-p/798799#M314025</guid>
      <dc:creator>ccherrub</dc:creator>
      <dc:date>2022-02-26T04:15:41Z</dc:date>
    </item>
  </channel>
</rss>

