turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- proc tabulate

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-21-2008 06:19 PM

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.

Thanks.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

07-28-2008 03:25 PM

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?

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?