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

Hello,

I computed multinomial logit regression parameters using proc logistic:

 

proc sort data=edu.educationClean;by EU15 sex;run;
proc logistic data=edu.educationClean;
class cohort2(ref='2') Langue(ref='0') cntr_regr(ref=first) genstat3(ref='0') eduM3(ref='2') religion(ref='0') /param=ref;
model edu3(ref='2')= cntr_regr cohort2 cntr_regr*cohort2 Langue genstat3 religion eduM3  /link=glogit rsquare;
weight pond / norm;
by EU15 sex;
where model=1;
run;

 

I would like to use parameters to predict values of edu3 in another dataset  (donnees.popbase2) which has the same shape, but a different population. Is it possible?

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Yes. This is called "scoring," and you can read about how to do it in the article "Techniques for scoring a regression model in SAS."

 

For your situation, I suggest using the STORE statement and the PLM procedure. To your PROC LOGISTIC code, add the SCORE statement, then use the SCORE statement in PROC PLM.  There is an example in the article.

View solution in original post

5 REPLIES 5
Rick_SAS
SAS Super FREQ

Yes. This is called "scoring," and you can read about how to do it in the article "Techniques for scoring a regression model in SAS."

 

For your situation, I suggest using the STORE statement and the PLM procedure. To your PROC LOGISTIC code, add the SCORE statement, then use the SCORE statement in PROC PLM.  There is an example in the article.

Demographer
Pyrite | Level 9

Thank you. I tried this:

 

proc sort data=edu.educationClean;by EU15 sex;run;
proc logistic data=edu.educationClean;
class cohort2(ref='2') cntr_regr(ref=first) genstat3(ref='0') eduM3(ref='2') religion(ref='0') /param=ref;
model edu3(ref='2')= cntr_regr cohort2 cntr_regr*cohort2 genstat3 religion eduM3  /link=glogit rsquare;
weight pond / norm;
where model=1;
by EU15 sex;
store work.regout;
run;

 

proc plm restore=work.regout;
   score data=edu.missing_countr;

   by EU15 sex;
run;

 

There is an error message saying "At least one variable used in the model is not present or has incompatible type in the EDU.MISSING_COUNTR score data set"

I noted that the dataset regout doesn't appear in the work folder. What I did wrong?

 

Rick_SAS
SAS Super FREQ

REGOUT is not a data set. It is an item store.

 

The error message is reminding you that the data set that you are attempting to score must have every  variable that is in the model. You can use

 

PROC CONTENTS SHORT data=edu.missing_countr; run;

 

to see which variables are in the scoring data and (more importantly) which are not.

Demographer
Pyrite | Level 9

Right... the label of the weight variable was not the same.

Now I have values in the predicted value column, but I am not totally sure what they mean. I was expecting having probabilities for the 3 modalities of the dependent variable, but I have values such as

 

Ordinal Response Predicted value
0 -1.79479
1 -1.18285
2 0
Demographer
Pyrite | Level 9

Nevermind, I had to add out=testout predicted/ilink;

Now it works. Thank you.

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!

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
  • 5 replies
  • 3004 views
  • 0 likes
  • 2 in conversation