BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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?
5 REPLIES 5
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
deleted_user
Not applicable
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.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.
deleted_user
Not applicable
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.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Yes - that's exactly the technique to consider.

Scott Barry

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
  • 5 replies
  • 674 views
  • 0 likes
  • 2 in conversation