Help using Base SAS procedures

Proc tabulate class variables and missing data

Reply
N/A
Posts: 0

Proc tabulate class variables and missing data

I know that has been asked before, but I can't find a good workaround and was hoping someone could help me.

I have built a table with many class variables, but the n's are not correct unless I use the 'missing' option. I prefer to not include the missing records, but when I omit them proc tabulate only includes the nonmissing values for *all* of the class variables.

Is there any way I can keep my table format - which is perfect - but overcome this problem?
Super Contributor
Super Contributor
Posts: 3,174

Re: Proc tabulate class variables and missing data

Posted in reply to deleted_user
Please be a bit more specific -- show some INPUT data condition and (desired) OUTPUT summarized data condition with both CLASS and VAR variables. And it would be most useful to show both "data observations" and also SAS code (better yet, the SAS-generated log) output for accuracy.

Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: Proc tabulate class variables and missing data

I'll pull that together, thanks.

In the meantime, from googling I found the "problem" (apparently it's by design) explained well here (by Lauren Haworth, to give her credit):

"PROC TABULATE drops all observations that have missing data on any of the CLASS variables in your table. This means that if you have one classification with a lot of missing data, you’ll lose these observations for all of the other classification variables as well. Even if the other classifications have valid data, these observations will be dropped from the entire table."

I don't want to resort to using either of the options she offers as solutions - to using 'missing' and live with it, or to break apart the bigger table into multiple smaller tables.
Super Contributor
Super Contributor
Posts: 3,174

Re: Proc tabulate class variables and missing data

Posted in reply to deleted_user
Consider the data manipulation option to set a blanks/missing "high value" conditions before input to PROC SUMMARY/MEANS, and the reset the variable values on the post-processing side, before further analysis.

Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: Proc tabulate class variables and missing data

Do you mean recode the blanks to a much higher value than the rest of the data (so they are easily identified in the output) and then subtract them after, where they show up? (Sorry if I'm totally missing your meaning; it's been a long day.)

Thanks again for your time and help.
Super Contributor
Super Contributor
Posts: 3,174

Re: Proc tabulate class variables and missing data

Posted in reply to deleted_user
Yes - that's exactly the technique to consider.

Scott Barry
Ask a Question
Discussion stats
  • 5 replies
  • 105 views
  • 0 likes
  • 2 in conversation