0
$\begingroup$

I have a log-level model and I have trouble with the interpretation when I have an interaction term of two continuous variables.

I came across this when I tried to get the grips of the difference when the covariates are standardized or just centered. So usually in a log level model I would interpret a one unit increase in x as follows:

A 1 unit increase in x1 leads to a (exp(b1)-1)*100 per cent increase in y.

My issue now is how to apply the exponential when I have an interaction term. Say I have a model that is defined as follows:

log(y) = b1*x1 + b2*x2 + b3(x1*x2)

How do I know get to the correct interpretation of a one unit increase in x?

is it

a) (exp(b1)-1)*100 + (exp(b3)-1)*100 or b) (exp(b1+b3)-1)*100

Sorry if this is stupid. I just came across this when I worked on a model where I initially had centered continuous variables and later changed them to standardized variables because the interpretation of a 1 standard deviation increase seemed more convenient. However when I did that, I realized that the interpretation doesnt add up.

So I wanted to check if everything is right and compare the two models where the first used centered and the second model used standardised variables.

My assumption was that sd*(exp(b1)-1)*100 in the centered model was equivalent to (exp(b1)-1)*100 in the standardised model

which turned out to be true and I was happy. This was basically a double check for me to understand the difference between the two approaches. However, now when I add the interaction term, it did not work out, and I realised that this is probably because I dont fully understand how the approximation with exp() exactly works.

Any help would be very much appreciated. Below is some example code I generated. I hope this was more or less understandable.

set.seed(42)

# Create variables
v1 <- rnorm(n = 1000, mean = 50, sd = 15)
v2 <- rnorm(n = 1000, mean = 50, sd = 15) + 0.3*v1
y <- 0.2*x1+0.4*v2+10

# Center variables
x1 <- scale(v1, scale = F)
x2 <- scale(v2, scale = F)

model1 <- lm(log(y)~x1*x2)
coefs1 <- coef(model1)
#-------------

# Standardise variables 
z1 <- scale(v1, scale = T)
z2 <- scale(v2, scale = T)

model2 <- lm(log(y)~z1*z2)
coefs2 <- coef(model2)
#------------

# Those two should be approximately equal
(exp(sd(x1)*coefs1[2])-1)*100 
(exp(coefs2[2])-1)*100
# is TRUE

# Interpretation with interaction term does not work out
(exp(sd(x1)*coefs1[2])-1)*100 + (exp(sd(x1)*coefs1[4])-1)*100
(exp(coefs2[2])-1)*100 + (exp(coefs2[4])-1)*100
$\endgroup$

1 Answer 1

2
$\begingroup$

The interaction coefficient is the association of the product of the two predictors with outcome, beyond what you would predict based on their individual coefficients. You can't interpret the interaction coefficient without considering both interacting predictors. With interactions, the values of coefficients for one predictor are affected by how its interacting predictors are coded: centering/scaling of continuous predictors, or changing the reference level of a categorical predictor.

Your problem would occur even in a simple linear model without the log/exponentiation issue. Say that $x_1$ and $x_2$ are both centered, and you simply had

$$y=\beta_1 x_1 x_2, $$

with $\beta_1$ the interaction coefficient. Now scale $x_2$ so that $z_2 = x_2/s_2$ and leave $x_1$ alone. Plug in to the above:

$$y=\beta_1 x_1 s_2 z_2= (\beta_1 s_2)x_1 z_2 .$$

The value of the interaction coefficient necessarily changes when you scale $x_2$, from $\beta_1$ to $\beta_1 s_2$. Your approach didn't take that into account.

With an interaction, if you want to estimate the association of a predictor with outcome you must specify values for all predictors with which it interacts. You didn't do that. If you had specified a value for x2 in the centered-only model and the corresponding value for z2 in the second (centered and scaled) model, then your estimated associations of x1 with outcome should agree.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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