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
- /
- exclude observations from reslults in proc tabulat...

Topic Options

- 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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-16-2017 08:51 AM

Hi!

I'm trying to make a PROC TABULATE for a big amount of observations (60 000), and there are few missing values for some variables... I want to exclude these missing values from the stats I calculate, but I don't want to delete de rows! Some observations can be used for one variable and not the other... (n=6500 instead of 6480 (there are 20 missing values))

Code:

proc tabulate data=Recyc.aqhc_cc;

class groupe_enrobe Calibre R;

var ecart_Ta_5 ecart_Ta_080 ecart_TG ecart_PourBitume;

table (groupe_enrobe)*(calibre),(R All)*(n) (R All)*(ecart_Ta_5 ecart_Ta_080 ecart_TG ecart_PourBitume)*(std);

run;

I want n to be counted without missing values of variables... Same for std...

Thanks for your help!!!

Marie-Christine

Accepted Solutions

Solution

08-16-2017
09:28 AM

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

Posted in reply to PaigeMiller

08-16-2017 08:59 AM

Hi! thanks for the quick answer!

I thought the same, but when I did the proc capability statement, I found different n ans std... So I investigated, and I found 17 missing values (with proc means) for a particular variable and class... the "n" was not the right one in proc tabulate... :\

All Replies

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

Posted in reply to bemariec

08-16-2017 08:55 AM

As far as I know, PROC TABULATE does not include missings in its statistics, and furthermore the missing are not included in the calculation of N.

So as far as I can see, you don't need to do anything different.

--

Paige Miller

Paige Miller

Solution

08-16-2017
09:28 AM

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

Posted in reply to PaigeMiller

08-16-2017 08:59 AM

Hi! thanks for the quick answer!

I thought the same, but when I did the proc capability statement, I found different n ans std... So I investigated, and I found 17 missing values (with proc means) for a particular variable and class... the "n" was not the right one in proc tabulate... :\

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

Posted in reply to bemariec

08-16-2017 09:28 AM

I found it! N is excluded EXCEPT for n and nmiss in proc tabulate! thank you!

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

Posted in reply to bemariec

08-16-2017 09:45 AM

bemariec wrote:

I found it! N is excluded EXCEPT for n and nmiss in proc tabulate! thank you!

I'm sorry but I don't understand this statement.

Do you mean that missing values are excluded?

--

Paige Miller

Paige Miller

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

Posted in reply to PaigeMiller

08-16-2017 09:50 AM

Sorry! yess! Missing values are excluded Except for n ans nmiss, where missing values are included

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

Posted in reply to bemariec

08-16-2017 10:43 AM - edited 08-17-2017 01:15 PM

bemariec wrote:

Sorry! yess! Missing values are excluded Except for n ans nmiss, where missing values are included

I think you need to say something about which specific variables you are discussing as CLASS variables with missing values are excluded:

data junk; input x; datalines; . 1 1 1 . 3 3 3 3 2 ; run; proc tabulate data=junk; class x; table x all,n; run;

10 obs in, 8 reported on.

Tabulate by default will exclude all rows with ANY of the class variables missing.

So when you look at individual variables such as with proc means or freq the class variables values will ALL show.

data junk; input x y; datalines; . 1 1 2 1 3 1 . . 5 3 1 3 1 3 . 3 1 2 1 ; run; proc tabulate data=junk; class x Y; table x *y,n; run; proc means data=junk n; var x y; run;

Tabulate: 6 records, Means 8 values for each of x and y.

So you might want to consider providing some example data and what the desired result is.