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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1920 views
  • 0 likes
  • 2 in conversation