Programming the statistical procedures from SAS

Proc logistic error while dealing with class variables

Reply
Contributor
Posts: 41

Proc logistic error while dealing with class variables

I have a variable age_band in my data & when I try to run a proc logistic using the same as a predictor it generates a note :

NOTE: Some observations in the WORK.score_file data set are not scored because they have class levels that are missing or are not present .

The variable values looks like this :

Age
18-29
30-39
40-49
50-59
 999
>=80

Following is the code that I have used:

proc logistic data = train_new desc plots(only)=roc;
class age /missing ;
model Target =  age/ pevent=.08 rsquare lackfit ;

score data = score_file out = predict_score_file ;
run;

Can some one help out in rectifying this? Thanks in advance!!

Grand Advisor
Posts: 16,858

Re: Proc logistic error while dealing with class variables

 

 

  1. Check the distribution of your age variable across the test and modelling data. Note levels in one but not the other.
  2. How is your model developed/scored, is there a way to modify the data?

 

Grand Advisor
Posts: 10,029

Re: Proc logistic error while dealing with class variables

In your previous post https://communities.sas.com/t5/SAS-Statistical-Procedures/Missing-option-in-class-statement-proc-log... Rick provided the answer: Your data does not match the SCORE data set. If you have combinations of variables that were not used in creating the SCORE data set then the score option does not know what to do with them at all.

 

Run Proc freq on the variable in both datasets and you will likely see that the number of levels does not match.

 

 

Ask a Question
Discussion stats
  • 2 replies
  • 79 views
  • 0 likes
  • 3 in conversation