Help using Base SAS procedures

Logistic Regression Equation yielding different results

Reply
N/A
Posts: 0

Logistic Regression Equation yielding different results

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
Contributor
Posts: 58

Re: Logistic Regression Equation yielding different results

Posted in reply to deleted_user
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
N/A
Posts: 0

Re: Logistic Regression Equation yielding different results

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
N/A
Posts: 0

Re: Logistic Regression Equation yielding different results

I figured it out Smiley Happy

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.
Ask a Question
Discussion stats
  • 3 replies
  • 456 views
  • 0 likes
  • 2 in conversation