BookmarkSubscribeRSS Feed
lady8506
Quartz | Level 8

Hello all,

 

I've got a dataset I'm running PROC TABULATE on. All is going well, except I noticed that ROWPCTN is allocating some of the total percent to missing values. I don't want this. How do I get it to exclude the missing values when calculating percent?

 

Here is my code: 

 

PROC TABULATE DATA = BCanalysis;
CLASS ERstatus Race TumorStage InsuranceStatus / MISSING;
TABLES (ERstatus Race TumorStage) * (N ROWPCTN), InsuranceStatus;
TITLE ;


RUN;tabulate.jpg

3 REPLIES 3
ballardw
Super User

@lady8506 wrote:

 

I've got a dataset I'm running PROC TABULATE on. All is going well, except I noticed that ROWPCTN is allocating some of the total percent to missing values. I don't want this. How do I get it to exclude the missing values when calculating percent?

 


Please describe exactly which row in the results you show is "allocating" of of the total percent to missing values.

 

If you are summing the shown percents and seeing that the total does not equal 100% for a row it is because of rounding for displayed values.

This code will allow you to see more digits if this is your concern:

PROC TABULATE DATA = BCanalysis;
CLASS ERstatus Race TumorStage InsuranceStatus / MISSING;
TABLES (ERstatus Race TumorStage) * (N ROWPCTN*f=F9.5), InsuranceStatus;
run ;
lady8506
Quartz | Level 8

If you look at the pretty picture I included, it will show you that everwhere there is a record with a missing value, part of the total row percent and N was allocated to it. For example, looking at the picture: If ERstatus = . and InsuranceStatus = . a part of the total percent was allocated to the missing value.

ballardw
Super User

If you don't want missing included then do not include MISSING on the class statement. If a value is counted then it is included in the ROWPCTN because that is what ROWPCTN does: report the percentange of the row n total count. So since you had an n=1 for because both variables are missing then it is calculated as part of the row percentage.

 

If you want a different denominator for your percentages then you may need to approach your problem differently such as using a different variable as a VAR variable and requesting an appropriate statistic for that variable.

 

Provide some example input data and what you want for output to get more specific suggestions.

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 Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 755 views
  • 0 likes
  • 2 in conversation