BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mariange8282
Obsidian | Level 7

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
1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

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

2 REPLIES 2
PGStats
Opal | Level 21

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
mariange8282
Obsidian | Level 7
You just safe my thesis.

Thank you so much

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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