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

Dear SAS community,

 

I am having a personal crisis due to PROC LOGISTIC.

I am training my model using a data set scoringsatz, and I want to test it using testsatz, like this:

 

PROC LOGISTIC DATA=&scoringsatz
          outest=work.Model_Parameters
        outmodel=work.model_out
          PLOTS(ONLY)=ALL
          ;
class &varlist_model
;
     MODEL &ziel (Event = '0')=
&varlist_model
     /
          gof
        SELECTION=none SLE=0.05 SLS=0.05
          CORRB
          RSQUARE
          CTABLE
          LINK=LOGIT
          CLPARM=WALD
          ALPHA=&alpha.
          
     ;
     OUTPUT OUT=&scoringsatz._out (LABEL="" DROP=__FLAG) 
          PREDPROBS=INDIVIDUAL;
    score data=&testsatz out=ergebnis_out  ;

But here's the problem: ergebnis_out only shows missing values for P_1 and P_0. And I have been trying to figure out for 2 days now why that is.

 

- Scoringsatz and Testsatz have exactly the same number of columns and column names.

- If I test the model using the trainingset, it works.

- If I split the trainingset using surveyselect and then use 1 of the sets for training and the other for testing it also works.

 

So, it should be due to the testset? But except for different entries it has the exact same structure??

 

I cannot post parts of the datasets as they are sensitive data with personal info.

 

Thanks for any hints,

Miriam

 

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

You say "Scoringsatz and Testsatz have exactly the same number of columns and column names." That's good but not enough. The levels of class variables must also be the same. If a variable is coded as YES or NO in Scoringsatz and Yes or No in Testsatz, the procedure will not calculate the probs.

PG

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

The only reason I know of to get missing values for P_1 and P_0 is because there are missing values in your predictor variables. So you need to look in the data sets involved to see if there are missing values there for the predictor variables.

--
Paige Miller
PGStats
Opal | Level 21

You say "Scoringsatz and Testsatz have exactly the same number of columns and column names." That's good but not enough. The levels of class variables must also be the same. If a variable is coded as YES or NO in Scoringsatz and Yes or No in Testsatz, the procedure will not calculate the probs.

PG

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 912 views
  • 2 likes
  • 3 in conversation