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
- /
- Base SAS Programming
- /
- Different N obs between proc means and proc npar1w...

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

01-26-2018 01:19 PM

I am running a 2 sample wilcoxon and also supplementing my p-value with with medians using proc means. However, the number of obs in each are different: proc means reports I have 3 in my class variable whereas npar1way reports I have 2. What can be the reason for this?

proc means data=x median;

where group = "A";

class sub;

var change;

run;

proc npar1way data=x wilcoxon;

where group = "A";

class sub;

var change;

exact;

run;

Accepted Solutions

Solution

01-26-2018
02:00 PM

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

Posted in reply to Melk

01-26-2018 01:56 PM

You can add 'nmiss' to your PROC MEANS statement to try to examine missingness of the continuous variables at the class level.

Or, have you tried running a PROC FREQ to examine the categorical variables and their frequencies. That might help.

Such as

PROC FREQ DATA=X;

TABLES SUB;

TABLES GROUP;

TABLES SUB*GROUP;

RUN;

All Replies

Solution

01-26-2018
02:00 PM

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

Posted in reply to Melk

01-26-2018 01:56 PM

You can add 'nmiss' to your PROC MEANS statement to try to examine missingness of the continuous variables at the class level.

Or, have you tried running a PROC FREQ to examine the categorical variables and their frequencies. That might help.

Such as

PROC FREQ DATA=X;

TABLES SUB;

TABLES GROUP;

TABLES SUB*GROUP;

RUN;

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

Posted in reply to Melk

01-26-2018 02:05 PM

In PROC MEANS, "NObs" is the total number of observations in each group. It includes missing and nonmissing. To see the number of observations that are used in the analysis, put N and NMISS on the PROC MEANS statement:

```
proc means data=x N NMISS median ;
where group = "A";
class sub;
var change;
run;
```

The "N" column should match the "N" column in NPAR1WAy.