BookmarkSubscribeRSS Feed
EllieBelle
Calcite | Level 5

Hi, does anyone know how to hide or eliminate the line from including the 'missing' in Proc Tabulate?  In my case, it would be the line showing 5,477,903 with no label (see below).  I am trying to generate a single table showing citizenship: (1) Total US citizens, (2) of the US citizens, who are natives and who are naturalized citizens, and (3) Non-citizens.

The class variable citi1 determines where a person is a US citizen or not a US citizen.  Each record (each person) gets assigned a value.

The class variable citi2 determines whether a person who is a US citizen is a native or naturalized citizen.  Non-citizens do not get a value assigned; citi2 is blank.

Here are my code and output.  I am trying to eliminate the line showing 5,477,903 with no label, which is a result of including the missing option in my proc tab code.  However, if I don't include the missing, then it will drop all records that don't have a citi2 value and my table will not have  'Not a US Citizen'.  Any help?  Thanks!

proc tabulate;

class  citi1 state;

class citi2/missing;

var value;

tables citi1='' citi2='', state='Total'*value=''*sum='' / box='Citizenship';

title "Persons by Citizenship";

run;

Persons by Citizenship
CitizenshipTotal
US Citizens31,278,763
Not a U.S. Citizen5,477,903
5,477,903
Naturalized4,378,380
Native26,900,383

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 0 replies
  • 1152 views
  • 0 likes
  • 1 in conversation