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;
@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 ;
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.
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.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.