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
- /
- Data Mining
- /
- Adjusting Predicted probabilities in SAS Base

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

05-06-2014 09:21 AM

Hi all,

I have the following situation, I have created a training and validation sample in which both the analogy of events/nonevents is the same thus 50-50.

I have fitted the training sample and tested my model on the validation sample (using proc logistic) with good results and i want to score now the initial population as a final test from which i made the two samples.

The initial population consists of 80% nonevents (0) and 20% events (1), if am not mistaken this means that i will have to adjust my predicted probabilities on the population to the true event rate since my model was build on a 50-50 analogy is that correct?

How could i do that in SAS Base? I mean which output from the logistic regression must I investigate and apply this alteration? Any ideas? If i could know how the predicted probability in the first case is calculated maybe i could adjust within that calculation.

Thank you in advance

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

Posted in reply to chemicalab

05-06-2014 09:43 AM

I think you oversampled the population to make event/non-event in 50-50 proportions in your training/validation samples. Check offset option in logistic regression to adjust predicted probabilities.

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

Posted in reply to stat_sas

05-06-2014 09:59 AM

Exactly that's what I did, would you happen to have any example on the offset option syntax wise so i could understand it better?

Thanks

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

Posted in reply to chemicalab

05-06-2014 10:08 AM

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

Posted in reply to stat_sas

05-06-2014 10:39 AM

Thnx

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

Posted in reply to stat_sas

05-06-2014 11:10 AM

Thanks @stat@sas !

An awesome read... I stopped doing what I was doing just to read this even if I don't use base SAS (I use EM). Still, very nice article... Thanks!

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

Posted in reply to stat_sas

05-06-2014 11:33 AM

One more question though, by using either prior or offset will i be adjusting the probabilities in the population data that i want to score or the already predicted probabilities in the training and validation set?

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

Posted in reply to chemicalab

05-06-2014 12:40 PM

Offset just aligns intercept it does not effect beta coefficients. Use offset in proc logistic using your training data set and get the parameter estimates. Score validation dataset using estimates obtained through training dataset. If you see results are almost similar then you can use this model for population dataset as well.

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

Posted in reply to stat_sas

05-06-2014 12:46 PM

Ok , I was just under the impression that since the intercept gets "inflated" that would mean that the predicted probabilities would get inflated too ,thus they would need adjustment too, am I wrong?

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

Posted in reply to chemicalab

05-06-2014 12:49 PM

Aha ok i misread since i am adjusting intercept I am good to go, so for scoring the validation which is also of a 50-50 analogy i dont need to adjust, that would be only for the population scoring where the true rates of events and non events is depicted

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

Posted in reply to chemicalab

05-06-2014 12:54 PM

That is correct. If the objective is to see significance of predictors only then you don't need to use offset.

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

Posted in reply to stat_sas

05-06-2014 03:21 PM

Thank you for your clarifications

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

Posted in reply to stat_sas

05-07-2014 03:35 AM

I have tried the following :

proc freq data=OUTPUT.POPULATION (THE SET WITH 95% nonevents and 5% events) noprint;

table TARGET / out=priors(drop=percent rename=(count=_prior_));

run;

and i try to score it with the parameters based on the training set:

PROC LOGISTIC INMODEL=MODELPARAMETERSTRAINING (the 50-50 sample) ;

SCORE DATA=OUTPUT.POPULATION PRIOR=PRIORS

OUTROC=ROC

OUT=SCORESPOP PREDICTED=ESTPROB

;

RUN;

Would that be the correct syntax? I am wondering cause when i compare the estimated probabilities of scoring with or without the priors i see a huge difference in p_1