Help using Base SAS procedures

proc tabulate

Reply
N/A
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.
Thanks.
Contributor
Posts: 42

Re: proc tabulate

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?
Ask a Question
Discussion stats
  • 1 reply
  • 104 views
  • 0 likes
  • 2 in conversation