BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
3 REPLIES 3
mfisher
Fluorite | Level 6
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
deleted_user
Not applicable
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
deleted_user
Not applicable
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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1146 views
  • 0 likes
  • 2 in conversation