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