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
- /
- SAS Programming
- /
- SAS Procedures
- /
- Logistic Regression Equation yielding different re...

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

02-02-2011 09:22 AM

Hello,

Using the coefficients obtained through my regression (logit), I am trying to write the equation in Excel so that I can demonstrate the effect of each variable on the probable outcome. However, the probabilities that result do not match the probabilities of my SAS-scored individuals.

In Excel, I'm doing it in two steps. The first step is:

= (intercept) + (b1 * x1) + (b2 * x2) .... (b9 * x9)

Then in the neighboring cell, I take that result and use it in this equation:

= 1/(1+(EXP((-1)*(result from above))))

The resulting probability is not equal to what SAS generates when the dataset is scored.

I'm not sure if this is related to my problem or not, but my dichotomous coefficients (levels are 0 or 1) that have negative estimates (for the 0 level) have a positive effect on probability. When I manipulate these in my equation, I'm observing the opposite.

Thank you for your advice!

- Phoebe

Using the coefficients obtained through my regression (logit), I am trying to write the equation in Excel so that I can demonstrate the effect of each variable on the probable outcome. However, the probabilities that result do not match the probabilities of my SAS-scored individuals.

In Excel, I'm doing it in two steps. The first step is:

= (intercept) + (b1 * x1) + (b2 * x2) .... (b9 * x9)

Then in the neighboring cell, I take that result and use it in this equation:

= 1/(1+(EXP((-1)*(result from above))))

The resulting probability is not equal to what SAS generates when the dataset is scored.

I'm not sure if this is related to my problem or not, but my dichotomous coefficients (levels are 0 or 1) that have negative estimates (for the 0 level) have a positive effect on probability. When I manipulate these in my equation, I'm observing the opposite.

Thank you for your advice!

- Phoebe

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

Posted in reply to deleted_user

02-02-2011 10:28 AM

Phoebe,

SAS may be estimating the probabilty for the other outcome, i.e., SAS is estimating the probabilty of outcome 1, while your excel formula may be estimating the prob for outcome 0. This would explain your opposite coefficients, as well.

Mark

SAS may be estimating the probabilty for the other outcome, i.e., SAS is estimating the probabilty of outcome 1, while your excel formula may be estimating the prob for outcome 0. This would explain your opposite coefficients, as well.

Mark

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

Posted in reply to mfisher

02-02-2011 10:34 AM

Thanks for the reply, Mark.

Does it look to you that my Excel formula is estimating the prob for outcome 0? I tried changing the negative estimates to positive, and this did not help.

I'm pretty sure that the Excel formula is estimating outcome 1, because the resulting probability is fairly close to what SAS is estimating. But it's still wrong.

I'm just not sure where the difference is...

edit: I should clarify that the intercept and coefficients that I'm using are the ones generated by the SAS procedure. Message was edited by: Phoebe

Does it look to you that my Excel formula is estimating the prob for outcome 0? I tried changing the negative estimates to positive, and this did not help.

I'm pretty sure that the Excel formula is estimating outcome 1, because the resulting probability is fairly close to what SAS is estimating. But it's still wrong.

I'm just not sure where the difference is...

edit: I should clarify that the intercept and coefficients that I'm using are the ones generated by the SAS procedure. Message was edited by: Phoebe

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

Posted in reply to mfisher

02-02-2011 12:21 PM

I figured it out

Thanks Mark for setting me down the right path...

I needed to include the parameter option with my class variables: param=ref ref=first

Now I'm getting the same probabilities when I solve "longhand" as what SAS has output.

Thanks Mark for setting me down the right path...

I needed to include the parameter option with my class variables: param=ref ref=first

Now I'm getting the same probabilities when I solve "longhand" as what SAS has output.