Solved – Computation and Interpretation of Odds Ratio with continuous variables with interaction, in a binary logistic regression model

logisticoddsodds-ratioregression

Question

A binary logistic regression model has been fitted, with the following output;

    Coefficients

    Term                Coef  SE Coef         95% CI          Z-Value  P-Value 
    Constant           -9.80     3.02    (  -17.00,   -4.19)    -3.12    0.001
    A                   0.756    0.510   (  -0.150,   1.552)     1.58    0.103 
    B                   0.0406   0.0201  ( -0.0046,  0.0798)     1.79    0.069
    A*B                -0.00303  0.00298 (-0.00897, 0.00341)    -0.91    0.341 

    Odds Ratios for Continuous Predictors

            Odds    95%
            Ratio    CI
    A          *   (*, *)
    B          *   (*, *)

Where $A,B$ are both continuous values $> 0$.

How would one give and interpret the odds ratios for one of $A$ or $B$ here?

Typically one would state that (for $A$ here) the odds ratio would be
$\exp(0.756 ) = 2.13$, but given there's interaction this is less clear.

As the variables are continuous it also seems more confusing, if $B$ was been
a binary value then could interpret the model as

$$
\text{log} \left(
\frac{p}{1 – p}
\right)
=
\beta_0 + \beta_1 A + \beta_2 B + \beta_3 A \times B
$$

If $B = 0$ then

$$
\text{log} \left(
\frac{p}{1 – p}
\right)
= \beta_0 + \beta_1 A
$$

If $B = 1$ then

$$
\text{log} \left(
\frac{p}{1 – p}
\right)
= \beta_0 + ( \beta_1 + \beta_3 )A
$$

And state that if $B$ is present then an increase of $A$ by one unit increases the odds by a factor of
$\exp(\beta_1 + \beta_3) = \exp(0.756 – 0.00303)$. And
if $B$ is not present then an increase of $A$ by one unit increases the odds by a factor of
$\exp(\beta_1)$

How to go about computation and interpretation of odds ratios in the case of interaction with continuous variables?


Why I don't think this is a duplicate

From exp (coefficients) to Odds Ratio and their interpretation in Logistic Regression with factors
, talks about using categorical variables and has only one factor with three levels (red, orange, blue)

Interaction Test with Odds
Ratio

didn't talk about a similar scenario to my question.

Log odds ratio and unadjusted log odds ratio when we have a continuous
variable

sounds similar, but is really about putting the continuous variables into
buckets rather than the interpretation of them in the context that I have given.

Comparing odds ratios of continuous and discrete
variables

is discussing their design.

Interpretation of continuous by continuous interaction in binary regression
model

doesn't have an answer, in the comments there are links to
this
post
and this
post, neither of which appear to answer the question, or mine.

Odds ratios for continuous independent variables
[duplicate]

has been flagged as a duplicate, although the post that has been linked (
this post
) doesn't appear to answer the problem as it's talking about categorical
variables ( I have mentioned this post already, red, orange, blue).

In the last thread linked above whuber has stated the information is already
there, I feel that it would be a good idea to have an explicit answer in
relation to the example that I have provided as the topic seems to be confusing
to other learners as well as myself.


Best Answer

As others have noted, it is probably easier to interpret this graphically. I will make certain assumptions to demonstrate the thought process for interpreting interactions like this:

  • $A$ is my predictor of interest, so I will interpret the odds ratio of $A$ at varying levels of $B$, and
  • $B$ has a range $[0, 100]$ with mean of 50 and most values falling in $[25, 75]$ such that this is the range of interest.

In the scenario I have set up, the actual log odds of $A$, 0.756, is probably not of interest since it is the log odds of $A$ when $B=0$ and $B=0$ applies to so few people in the data that we do not care for it.

I will calculate the log-odds of $A$ when $B=\{25,50,75\}$. This results in:

\begin{align} \beta_1 + \beta_3 \times \{25, 50, 75\}&{}=\\ 0.756 -0.00303 \times \{25, 50, 75\}&{}=\\ \{0.756 -0.07575, 0.756 -0.15150, 0.756 -0.22725\}&{}=\\ \{0.68025, 0.60450, 0.52875\} \end{align}

The odds ratio of $A$ will then be $1.97\ (e^{0.68025})$, $1.83\ (e^{0.60450})$, $1.70\ (e^{0.52875})$ when $B=\{25, 50, 75\}$ respectively.

So you find that the odds ratio of $A$ drops as the value of $B$ increases. We can also graph the set-up at varying values of B:

enter image description here

To create the graph, I used all integer values of $B$ in $[25, 75]$.