<?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: My frequency table is not showing all variable categories in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767020#M30713</link>
    <description>These statements define RACECAT as 8 characters long, the number of characters in "HISPANIC".  Other values get truncated.  To fix this, add just after the SET statement:&lt;BR /&gt;&lt;BR /&gt;LENGTH RACECAT $37;</description>
    <pubDate>Fri, 10 Sep 2021 09:29:52 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2021-09-10T09:29:52Z</dc:date>
    <item>
      <title>My frequency table is not showing all variable categories</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767011#M30711</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to create a frequencyt table for my newly categorized variables. there is no error in log but when i run the proc freq , it doesnt show all the categories i created for the first variable which is race. it showed just 2 instead of 5&lt;/P&gt;&lt;P&gt;here is my syntax&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA MEPSIS.RACEDU;&lt;BR /&gt;SET MEPSIS.TEMP5;&lt;BR /&gt;&lt;BR /&gt;IF RACE = 1 THEN RACECAT = 'HISPANIC';&lt;BR /&gt;IF RACE = 2 THEN RACECAT = 'NON-HISPANIC WHITE ONLY';&lt;BR /&gt;IF RACE = 3 THEN RACECAT = 'NON-HISPANIC BLACK ONLY';&lt;BR /&gt;IF RACE = 4 THEN RACECAT = 'NON-HISPANIC ASIAN ONLY';&lt;BR /&gt;IF RACE = 5 THEN RACECAT = 'NON-HISPANIC OTHER RACE OR MULTI-RACE';&lt;BR /&gt;IF RACE &amp;lt; 1 THEN DELETE;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;IF EDUCATION = 1 THEN EDUCAT = '=&amp;lt;8TH GRADE';&lt;BR /&gt;IF EDUCATION = 2 THEN EDUCAT = '9TH TO 12TH GRADE';&lt;BR /&gt;IF EDUCATION = 13 THEN EDUCAT = 'GED OR HIGH SCHOOL DIPLOMA';&lt;BR /&gt;IF EDUCATION = 14 THEN EDUCAT = '&amp;gt;HIGH SCHOOL BUT WITHOUT 4 YEAR DEGREE';&lt;BR /&gt;IF EDUCATION = 15 THEN EDUCAT = 'COLLEGE OR BACHELORS DEGREE';&lt;BR /&gt;IF EDUCATION = 16 THEN EDUCAT = 'GRADUATE OR PROFESSIONAL DEGREE';&lt;BR /&gt;IF EDUCATION &amp;lt; 1 THEN DELETE;&lt;BR /&gt;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/** PRINTING TO CHECK**/&lt;BR /&gt;PROC PRINT DATA = MEPSIS.RACEDU (OBS = 5);&lt;BR /&gt;VAR RACECAT EDUCAT;&lt;BR /&gt;TITLE "CROSSCHECKING QUESTION 4";&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 08:20:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767011#M30711</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-09-10T08:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: My frequency table is not showing all variable categories</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767012#M30712</link>
      <description>&lt;P&gt;Is it possible that one of the two conditions is true:&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;&lt;SPAN&gt;IF RACE &amp;lt; 1 THEN DELETE;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;-&amp;nbsp;&lt;SPAN&gt;IF EDUCATION &amp;lt; 1 THEN DELETE;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check the missing observations, maybe they satisfies above situation.&lt;/P&gt;
&lt;P&gt;I propose to replace the DELETE with '***';&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 08:44:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767012#M30712</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-09-10T08:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: My frequency table is not showing all variable categories</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767020#M30713</link>
      <description>These statements define RACECAT as 8 characters long, the number of characters in "HISPANIC".  Other values get truncated.  To fix this, add just after the SET statement:&lt;BR /&gt;&lt;BR /&gt;LENGTH RACECAT $37;</description>
      <pubDate>Fri, 10 Sep 2021 09:29:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767020#M30713</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-09-10T09:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: My frequency table is not showing all variable categories</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767051#M30716</link>
      <description>&lt;OL&gt;
&lt;LI&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA MEPSIS.RACEDU;
SET MEPSIS.TEMP5;

length RACECAT EDUCAT $50.;

IF RACE = 1 THEN RACECAT = 'HISPANIC';
ELSE IF RACE = 2 THEN RACECAT = 'NON-HISPANIC WHITE ONLY';
ELSE IF RACE = 3 THEN RACECAT = 'NON-HISPANIC BLACK ONLY';
ELSE IF RACE = 4 THEN RACECAT = 'NON-HISPANIC ASIAN ONLY';
ELSE IF RACE = 5 THEN RACECAT = 'NON-HISPANIC OTHER RACE OR MULTI-RACE';
*ELSE IF RACE &amp;lt; 1 THEN DELETE;
ELSE RACECAT="CHECKME";


IF EDUCATION = 1 THEN EDUCAT = '=&amp;lt;8TH GRADE';
ELSE IF EDUCATION = 2 THEN EDUCAT = '9TH TO 12TH GRADE';
ELSE IF EDUCATION = 13 THEN EDUCAT = 'GED OR HIGH SCHOOL DIPLOMA';
ELSE IF EDUCATION = 14 THEN EDUCAT = '&amp;gt;HIGH SCHOOL BUT WITHOUT 4 YEAR DEGREE';
ELSE IF EDUCATION = 15 THEN EDUCAT = 'COLLEGE OR BACHELORS DEGREE';
ELSE IF EDUCATION = 16 THEN EDUCAT = 'GRADUATE OR PROFESSIONAL DEGREE';
ELSE IF EDUCATION &amp;lt; 1 THEN DELETE;
ELSE EDUCAT = "CHECKME";

RUN;



proc freq data=mepsis.racedu;
table race*racecat education*educat racecat*educat;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;LI&gt;You only printed 5 observations, how do you know that all categories weren't created?&lt;/LI&gt;
&lt;LI&gt;You say PROC FREQ but are showing a PROC PRINT, did you forget to include some of your code? You should check recoding with PROC FREQ not PROC PRINT.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;I would recommend coding the categories to something else, instead of deleting, checking your output and then once you were satisfied, deleting the records. &lt;STRONG&gt;Delete only after your selection is verified.&amp;nbsp;&lt;/STRONG&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/394970"&gt;@Banke&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i want to create a frequencyt table for my newly categorized variables. there is no error in log but when i run the proc freq , it doesnt show all the categories i created for the first variable which is race. it showed just 2 instead of 5&lt;/P&gt;
&lt;P&gt;here is my syntax&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA MEPSIS.RACEDU;&lt;BR /&gt;SET MEPSIS.TEMP5;&lt;BR /&gt;&lt;BR /&gt;IF RACE = 1 THEN RACECAT = 'HISPANIC';&lt;BR /&gt;IF RACE = 2 THEN RACECAT = 'NON-HISPANIC WHITE ONLY';&lt;BR /&gt;IF RACE = 3 THEN RACECAT = 'NON-HISPANIC BLACK ONLY';&lt;BR /&gt;IF RACE = 4 THEN RACECAT = 'NON-HISPANIC ASIAN ONLY';&lt;BR /&gt;IF RACE = 5 THEN RACECAT = 'NON-HISPANIC OTHER RACE OR MULTI-RACE';&lt;BR /&gt;IF RACE &amp;lt; 1 THEN DELETE;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;IF EDUCATION = 1 THEN EDUCAT = '=&amp;lt;8TH GRADE';&lt;BR /&gt;IF EDUCATION = 2 THEN EDUCAT = '9TH TO 12TH GRADE';&lt;BR /&gt;IF EDUCATION = 13 THEN EDUCAT = 'GED OR HIGH SCHOOL DIPLOMA';&lt;BR /&gt;IF EDUCATION = 14 THEN EDUCAT = '&amp;gt;HIGH SCHOOL BUT WITHOUT 4 YEAR DEGREE';&lt;BR /&gt;IF EDUCATION = 15 THEN EDUCAT = 'COLLEGE OR BACHELORS DEGREE';&lt;BR /&gt;IF EDUCATION = 16 THEN EDUCAT = 'GRADUATE OR PROFESSIONAL DEGREE';&lt;BR /&gt;IF EDUCATION &amp;lt; 1 THEN DELETE;&lt;BR /&gt;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;/** PRINTING TO CHECK**/&lt;BR /&gt;PROC PRINT DATA = MEPSIS.RACEDU (OBS = 5);&lt;BR /&gt;VAR RACECAT EDUCAT;&lt;BR /&gt;TITLE "CROSSCHECKING QUESTION 4";&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 15:17:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767051#M30716</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-10T15:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: My frequency table is not showing all variable categories</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767147#M30720</link>
      <description>&lt;P&gt;ok. thank you. i uploaded the wrong picture, sorry about that. It actually created all the categories i wanted, i scanned through the dataset. i just observed that it grouped the categories into 2 instead of 5 in the frequency table whereas there are 5 categories in the created dataset. what does the "CHECKME" mean please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Sep 2021 22:10:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767147#M30720</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-09-10T22:10:16Z</dc:date>
    </item>
    <item>
      <title>Re: My frequency table is not showing all variable categories</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767194#M30726</link>
      <description>She recoded instead of deleting. Also I think you should use if else if instead of just a bunch of if statements.</description>
      <pubDate>Sat, 11 Sep 2021 10:52:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767194#M30726</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-09-11T10:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: My frequency table is not showing all variable categories</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767196#M30727</link>
      <description>&lt;P&gt;The proper way to check this variable derivation is like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc freq data=mepsis.racedu;
tables race*racecat / list missing;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Sep 2021 11:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767196#M30727</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-09-11T11:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: My frequency table is not showing all variable categories</title>
      <link>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767433#M30758</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/394970"&gt;@Banke&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;ok. thank you. i uploaded the wrong picture, sorry about that. It actually created all the categories i wanted, i scanned through the dataset. i just observed that it grouped the categories into 2 instead of 5 in the frequency table whereas there are 5 categories in the created dataset. &lt;STRONG&gt;what does the "CHECKME" mean please?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;It literally means go check those records.&lt;/STRONG&gt; That is because they're falling out of your IF/ELSE conditions which means you're not accounting for some conditions or deletions. Coding it to a value rather than delete allows you to verify the logic before you delete it. This style of programming helps you to find errors in your code before they propogate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Sep 2021 14:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/My-frequency-table-is-not-showing-all-variable-categories/m-p/767433#M30758</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-09-13T14:55:49Z</dc:date>
    </item>
  </channel>
</rss>

