Help using Base SAS procedures

proc tabulate

Not applicable
Posts: 0

proc tabulate

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.
Posts: 51

Re: proc tabulate

Posted in reply to deleted_user
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;
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;

This seems to calculate means based on only the non-missing values. Or did you mean something else?
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation