I'm running logistic regressions in Python using statsmodels logit and, downstream, am calculating odds ratios for each independent variable.

I know that, conventionally, an odds ratio is interpreted per "one unit" increase in the value of the variable. I think my ultimate question is how can I determine with certainty what "one unit" really is for each variable, and if it depends upon the precision of the data for the relevant column.

One parameter, respiratory_rate, has values in integers (22, 26, 30, 12, etc.). So I think I can assume a one unit increase in respiratory_rate would be one whole number.

However, a second parameter, temperature, has values with decimal points to the tenths place (97.8, 98.4, 99.5, 100.3, etc.). Here, for the odds ratio for temperature, would the "one unit increase" be an increase in tenths, i.e., an increase of 0.1?

  • $\begingroup$ I'm not familiar with Python, but in everything else (SAS, R, Stata) a one-unit difference literally means a "difference of 1.0" on the predictor space. So for temperature the odds ratio should be for a one-degree difference. $\endgroup$ Jul 15, 2021 at 0:33
  • $\begingroup$ You can rescale either before or after analysis too -- for example, OR for a one-degree difference is less interpretable (not really an important difference) and might be better re-framed as an OR for a five-degree or ten-degree difference in temperature. $\endgroup$ Jul 15, 2021 at 0:34
  • $\begingroup$ Ratios have no units. The ratio is interpreted as what the value of the numerator is when the denominator is set to 1. $\endgroup$
    – LDBerriz
    Jul 15, 2021 at 11:34
  • $\begingroup$ @LDBerriz Can you elaborate? Not sure I understand. What ratio? What numerator, and what denominator? $\endgroup$ Jul 15, 2021 at 15:47
  • 1
    $\begingroup$ @LDBerriz The question is about a one-unit increase in the predictor variable, not in the odds ratio response. $\endgroup$
    – Dave
    Jul 15, 2021 at 21:46

2 Answers 2


In the simplest terms, an odds ratio (OR) is the relationship between the probability P of the occurrence of an event A and the probability 1 - P(A) of event A not occuring. The mathematical expression is P(A)/(1-P(A)). OR > 1 imply that A has a greater probability of happening than not happening, OR < 1 is the opposite. The numerator is the probability between 0 and 1.0 of the event occurring. The denominator is the probability between 0 and 1.0 of the event not occurring. The sum of both probabilities equals 1.0 which explains the subtraction from 1.0 to obtain the probability of the event not occurring after you know the probability of the event occurring. Here is a good explanation https://en.wikipedia.org/wiki/Odds_ratio.


It's literally the derivative.

$$ odds\_ratio = \beta_0 + \beta_1x$$ $$\dfrac{\partial odds\_ratio}{\partial x} = \beta_1 $$

Then $x$ increases by one, the odds ratio increases by $\beta_1$.

Let's do a concrete example with numbers.

$$ odds\_ratio = 1 + 2x\\ \beta_0 = 1\\ \beta_1 = 2 $$

When $x=0$, $odds\_ratio = 1$.

When $x$ increases by $1$ to give $x=1$, $odds\_ratio = 3$.

When $x$ increases by $1$ again to give $x=2$, $odds\_ratio = 5$.

As an exercise, what is the odds ratio for $x = 1.5$, and how does that compare to when $x=1$ or when $x=2?$

  • $\begingroup$ Variables can be categorical ($0=$ off (not dog), $1=$ on (dog)), and there is a similar argument for the discrete analogues of derivatives, differences. (There's probably a way to do in in general with something like a Radon-Nikodym derivative, but that goes far beyond where most people are thinking about regression.) $\endgroup$
    – Dave
    Jul 15, 2021 at 21:45
  • $\begingroup$ This answer is correct only for variables that appear linearly in one term alone. For instance, in a model where $\text{odds ratio}=\beta_0+\beta_1x+\beta_2xz,$ it is no longer the case that any of the coefficients is a derivative with respect to $x.$ BTW, a logistic regression models the log odds directly in this form--it doesn't directly model the odds ratio. $\endgroup$
    – whuber
    Jul 15, 2021 at 22:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.