DATA Step, Macro, Functions and more

PROC DISCRIM ERROR

Accepted Solution Solved
Reply
Contributor
Posts: 23
Accepted Solution

PROC DISCRIM ERROR

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
Respected Advisor
Posts: 4,935

Re: PROC DISCRIM ERROR

Posted in reply to mariange8282

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

View solution in original post


All Replies
Solution
‎10-27-2016 02:38 AM
Respected Advisor
Posts: 4,935

Re: PROC DISCRIM ERROR

Posted in reply to mariange8282

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
Contributor
Posts: 23

Re: PROC DISCRIM ERROR

You just safe my thesis.

Thank you so much
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 297 views
  • 0 likes
  • 2 in conversation