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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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