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
- /
- PROC DISCRIM ERROR

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

10-26-2016 09:48 PM

Hi, I'm processing data. I have some specials sets that SAS consider as a currupt and then it ignored.

I have clusters, in some cases SAS ignore all the information on an specific cluster, then I try to run PROC DISCRIM the error appear:

CODE:

proc discrim data=clust method=normal pool=test crossvalidate;

priors proportional;

class cluster;

var &vars;

This code generally work good for others datasets. So, thats not the problem.

ERROR:

WARNING: 5876 observations in DATA= data set or BY group will not be included in the analysis due to missing values.

WARNING: The following classes were excluded from the analysis due to missing or invalid values in VAR, FREQ or WEIGHT variables:

4

2

3

.

WARNING: A total of 5876 of the 7357 observations in the DATA= data set were excluded (frequency sum = 1481).

ERROR: At least 2 complete classes are required in DATA= data set or BY group.

I just would like to ignore that dataset, but I dont know what is the condition to do it.

Thanks

Accepted Solutions

Solution

10-27-2016
02:38 AM

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

10-26-2016 11:27 PM

I would try counting the non empty classes with something like this:

```
proc sql;
select count(distinct cluster) into :nClass
from clust
where nmiss(%sysfunc(translate(&var,%str(,),%str( ))))=0;
%if &nClass > 1 %then %do;
proc discrim...
%end;
```

(untested)

PG

All Replies

Solution

10-27-2016
02:38 AM

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

10-26-2016 11:27 PM

I would try counting the non empty classes with something like this:

```
proc sql;
select count(distinct cluster) into :nClass
from clust
where nmiss(%sysfunc(translate(&var,%str(,),%str( ))))=0;
%if &nClass > 1 %then %do;
proc discrim...
%end;
```

(untested)

PG

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

10-27-2016 02:38 AM

You just safe my thesis.

Thank you so much

Thank you so much