Help using Base SAS procedures

Allocating percents to missing values

Reply
Contributor
Posts: 24

Allocating percents to missing values

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

Super User
Posts: 11,343

Re: Allocating percents to missing values


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 ;
Contributor
Posts: 24

Re: Allocating percents to missing values

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.

Super User
Posts: 11,343

Re: Allocating percents to missing values

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.

Ask a Question
Discussion stats
  • 3 replies
  • 163 views
  • 0 likes
  • 2 in conversation