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
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.
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.
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.