Programming the statistical procedures from SAS

Missing option in class statement proc logistic

Accepted Solution Solved
Reply
Contributor
Posts: 41
Accepted Solution

Missing option in class statement proc logistic

Hi,

 

Can some one tell me how do wew specify missing function in the class statement while running a logistic regression?

 

Thanks in advance !!

 


Accepted Solutions
Solution
‎01-30-2017 05:03 AM
SAS Super FREQ
Posts: 3,319

Re: Missing option in class statement proc logistic

The message says

> 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 in the analysis data set.

 

You need to ensure that all possible levels in the scoring data set are also in the training data.

I suspect that the problem is that the score_file data has nonmissing levels that are not in train_new.

It's easy to check:

 

proc freq data=train_new;

tables &char;

run;

 

proc freq data=score_file;

tables &char;

run;

View solution in original post


All Replies
SAS Super FREQ
Posts: 3,319

Re: Missing option in class statement proc logistic

Do you mean that you want a missing value to be a valid group? If so, use the MISSING option, as stated in the documentation:

class C / missing;

 

Contributor
Posts: 41

Re: Missing option in class statement proc logistic

Yes I am talking about the same I did try using that but still I am not geeting scores for all observations & I get this note:

 

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

score data = score_file out = predict_score_file ;
run;

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 in the analysis data set.

 

Can you help?

Solution
‎01-30-2017 05:03 AM
SAS Super FREQ
Posts: 3,319

Re: Missing option in class statement proc logistic

The message says

> 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 in the analysis data set.

 

You need to ensure that all possible levels in the scoring data set are also in the training data.

I suspect that the problem is that the score_file data has nonmissing levels that are not in train_new.

It's easy to check:

 

proc freq data=train_new;

tables &char;

run;

 

proc freq data=score_file;

tables &char;

run;

Grand Advisor
Posts: 10,073

Re: Missing option in class statement proc logistic

I'm not sure what you mean by "missing function" in this context. If you want to treat missing values of the class variables as valid levels for analysis the add / missing to the class statement after the variables.

 

CLASS var1 var2 var3 / missing;

 

☑ This topic is SOLVED.

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

Discussion stats
  • 4 replies
  • 165 views
  • 0 likes
  • 3 in conversation