turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Use regression parameters to predict values in ano...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-02-2017 10:54 AM

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?

Accepted Solutions

Solution

03-03-2017
07:05 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-02-2017 11:03 AM

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.

All Replies

Solution

03-03-2017
07:05 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-02-2017 11:03 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-03-2017 04:56 AM

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?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-03-2017 05:36 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-03-2017 06:06 AM

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 |

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

03-03-2017 07:04 AM - edited 03-03-2017 07:05 AM

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

Now it works. Thank you.