BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Say you want to make a table of a bunch of variables in proc tabulate. The variables have different numbers of missing values for each variable. It seems like proc tabulate will only include records which have nonmissing values for ALL the variables. Or if you use the 'missing' option, it will include all values for all variables, including missing values (which I don't want displayed). Does anyone know of a way to display ONLY the nonmissing values for each variable? In other words, the n for each variable may vary from variable to variable.
Thanks.
1 REPLY 1
mftuchman
Quartz | Level 8
Are you asking how to get proc tabulate to compute means based only on the non-missing values?

data example;
infile datalines;
input a1-a6;
datalines;
1 . . 1 1 1
1 1 0 0 1 1
. 0 1 1 . 1
. 0 1 . 1 1
. . 1 . 1 1
;

proc tabulate;
var a1 a2 a3 a4 a5 a6;
table (sum mean n nmiss), a1 a2 a3 a4 a5 a6;
run;

This seems to calculate means based on only the non-missing values. Or did you mean something else?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 671 views
  • 0 likes
  • 2 in conversation