22

I have the following probability function:

$$\text{Prob} = \frac{1}{1 + e^{-z}}$$

where

$$z = B_0 + B_1X_1 + \dots + B_nX_n.$$

My model looks like

$$\Pr(Y=1) = \frac{1}{1 + \exp\left(-[-3.92 + 0.014\times(\text{gender})]\right)}$$

I understand what the intercept (3.92) means, but I'm now sure how to interpret 0.014. Are these still log odds, odd ratios, or can I now assert that for each incremental odds change is gender, females are 0.014 more likely to win than men. Basically, how am I to interpret the 0.014?

Basically, I want to take the probability function and actually implement it in Java for a specific program that I'm writing, but I'm just not sure if I'm understanding the function correctly to implement it in Java.

Java code example:

double p = 1d / (1d + Math.pow(2.718d, -1d * (-3.92d + 0.014d * bid)));
chl
  • 50,972
  • 18
  • 205
  • 364
ATMathew
  • 2,165
  • 11
  • 28
  • 42
  • 2
    This might help: http://en.wikipedia.org/wiki/Odds_ratio#Role_in_logistic_regression – Fred Foo Jan 13 '12 at 14:59
  • 2
    Here is a [related question](http://stats.stackexchange.com/questions/8661/logistic-regression-in-r-odds-ratio). There are several others as well, e.g., [this one](http://stats.stackexchange.com/questions/14634/reporting-results-of-a-logistic-regression). – cardinal Jan 13 '12 at 15:00

2 Answers2

20

If you're fitting a binomial GLM with a logit link (i.e. a logistic regression model), then your regression equation is the log odds that the response value is a '1' (or a 'success'), conditioned on the predictor values.

Exponentiating the log odds gives you the odds ratio for a one-unit increase in your variable. So for example, with "gender", if Female = 0 and Male = 1 and a logistic regression coefficient of 0.014, then you can assert that the odds of your outcome for men are exp(0.014) = 1.01 times that of the odds of your outcome in women.

Fomite
  • 21,264
  • 10
  • 78
  • 137
  • 5
    Shouldn't it be "the odds of your outcome for men are exp(0.014) = 1.01 times that of the odds of your outcome in women", since female is 0 and male is 1? – Bustic01 Jan 07 '19 at 05:39
4

the odds ratio of women should be 1 / exp(0.014)

explanation:

since the event for male is '1' and female is '0' that means the reference level is female.

the equation ln(s) = B0 + B1*(gender)

odds(female) = exp(B0)
odds(male)   = exp(B0 + B1 * 1)

odds ratio(male) = odds(male) / odds(female) = exp(0.014) = 1.01

therefore, odds ratio(female) = 1 / 1.01 = 0.99

sparkstars
  • 99
  • 1
  • 2