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

Hi,

 

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

 

Thanks in advance !!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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

4 REPLIES 4
Rick_SAS
SAS Super FREQ

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;

 

Lopa2016
Fluorite | Level 6

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?

Rick_SAS
SAS Super FREQ

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;

ballardw
Super User

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;

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

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