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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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