# Interpreting logit regression with both continuous and categorical variables

I have a logistic regression like this:

Y = a1 + b1*(number positive scores) + b2*(number negative scores) + b3*Z
+ b4*Z*(number positive scores) + b5*Z*(number negative scores)


Y is the probability of an outcome that takes on binary values (0,1). Z is a continuous variable; I am trying to determine if it is significant Number of positive and negative scores take on integer values between (0,5)

When I run the regression using glm in matlab, I find that all coefficients are significant except for b3; b1 and b4 are positive whereas b2 and b5 are negative. I would like to draw conclusions about whether Z is in fact a significant factor in the outcome variable via interactions b4 and b5, but I understand that in a logistic regression all coefficients and particularly interactions need to be evaluated in the context of specific values of the independent variable x. So this is what I have done so far:

Let's say bhat is the estimated vector of coefficients b=(a1,b1,b2,b3,b4,b5...) and xhat is the sample mean of x=(num pos scores, num neg scores,Z,Z*num pos scores, Z*num neg scores). Also say that bi_sigma is the estimated standard error on the ith element of bhat and xi_sigma is the sample standard deviation of the ith element of x. Let's say L(bx) is the logistic cdf evaluated at bx.

Am I right to evaluate the odds ratios exp(bhat*xhat-bi_sigma*xi_hat) and exp(bhat*xhat+bi_sigma*xi_hat), then determine whether each element bi_hat is significant based on whether the range of these odds ratios is strictly greater than or less than one? In other words, my thinking is that if the odds ratios don't include one then they significantly improve or decrease the odds. For instance an odds ratio range of (1.3,2) reflects a bi that improves the odds for mean levels of x. Yes?

Secondly, am I correct to evaluate the first differences, L(bhat*xhat)-L(bhat*xhat-bi*xi_sigma) and L(bhat*xhat+bi*xi_sigma)-L(b*xhat) as two measures of the size of the impact of each xi. Can I do this for the interaction also?

Thanks very much for any advice or help. If there are references that you would suggest for this, I would appreciate that too. All the examples I've found online involve binary or categorical variables only, and no continuous variables.

I'm reluctant to post because I don't quite understand what you're looking for here. Maybe this will jumpstart someone else to respond that has a better grasp of what you want.

"I would like to draw conclusions about whether Z is in fact a significant factor in the outcome variable via interactions b4 and b5, but I understand that in a logistic regression all coefficients and particularly interactions need to be evaluated in the context of specific values of the independent variable x."

The statement above isn't quite correct. Z is significant, the p-value for the interaction term is significant so Z is significant. You don't need to go much further (unless you tested an unreasonable number of interactions/data size small). It does not make a difference that Z is not significant if the higher order interactions are significant.

To estimate the effect of Z on the outcome, this needs to be done in the context of specific values of the independent variable x. This is often best done graphically.

I would like to draw conclusions about whether Z is in fact a significant factor in the outcome variable via interactions b4 and b5, but I understand that in a logistic regression all coefficients and particularly interactions need to be evaluated in the context of specific values of the independent variable x.

That is not quite correct, as long as you remain in the odds ratio metric the dependence on other variables is only limited to the variables with which Z is interacted in a similar way as in simple linear regression. The difference is that with odds ratios you need to think in multiplicative terms rather than additive additive terms, as the ratio part in odds ratio already suggests. The whole interpretation becomes problematic when you want to interpret the outcome in terms of marginal effects.

For examples on how to deal with interactions in terms of odds ratios see here, and for an interpretation in terms of marginal effects see here.