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
- /
- Proc logistic out and p statements

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

07-10-2013 01:35 PM

SO I am having trouble knowing why my predicted probabilities do not match up with what I expect it to.

I am comparing this:

proc logistic data=natdata outmodel=test333;

class ioclass;

model bad (event='1') = X Y Z

output out=reg_result p=predprob;

run;

And in reg_result there is a estimated probability variable.

Then I manually create a variable called probability which is:

1/(1+e^0(intercept+ X*B1 +Y*B2 + Z*B3))

with B1-B3 being the regression coefficients.

Ignoring differences due to rounding, shouldnt the two columns be the same?

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

07-10-2013 01:47 PM

Post your full code used, the code above doesn't make sense. You specify a class variable but don't use it and the model statement is missing a semicolon.

And yes, the predicted probability will match the calculated probability if done correctly.

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

07-10-2013 01:52 PM

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

07-10-2013 01:56 PM

It kind of depends on what coding you used for the dependent variable. Do your predicted probabilities look like (1 - expected prob)? Or are they completely mucked about? I wonder about this because of the 0 in your manual equation--I assume that it is a negative sign in your actual calculations. You might want to add XBETA=logitvalue to the OUTPUT statement to check if your difference is, in fact, due to rounding. Logitvalue should be equal to (intercept+ X*B1 +Y*B2 + Z*B3).

Steve Denham