How to interpret id-level beta parameters in lognormal model?

I’m trying to interpret the results of my lognormal regression model fitted with brms. I’ve looked at the excellent notes that folks have referred to in similar threads (e.g. [FAQ How do I interpret a regression model when some variables are log transformed?]) and think I understand them, but I just need to be sure that when transforming the axes for my plots I’m using the correct interpretation.
So my call the the model is;

lognorm_multi_elq3 <- brm(formula = sales ~ 1 + 
                            APD + 
                            (1  + APD | ID ), 
                          data = elq3, 
                          family = lognormal(),
                          prior = set_prior("normal(1,10)", class = "b"),
                          iter = 10000)

So I think I understand that the lognormal model is reporting the parameters on the log scale. So for the population-level intercept term, that means exp(Intercept) is roughly the value of sales when all independent variables are at 1 (not 0, because exp(0) = 1).

If I use the following transformation in the call to mcmc_areas()…

# plot the intercepts for a subsample of 10 ids 
mcmc_areas(
  model_object, 
  pars = vars(param_glue("r_ID[{id},{var}]",
                         var = c("Intercept"),
                         id = sample(data$ID, 10))),
  prob = 0.8, # 80% intervals
  prob_outer = 0.95, # 99%
  point_est = "median",
  transformations = function(x) (exp(x)* exp(fixef(model_object)[1]))
  ) + geom_vline(xintercept=exp(fixef(lognorm_multi_elq1)[1]), size=1.5, color="grey") + labs(x = "Sales")

So here exp(fixef(model_object)[1]) will give us the intercept (which is at index [1] in the output of fixef(model_object)) in the original scale (sales in $), and the transformation calculates id-level intercepts as a proportion of that population level intercept.

Now the situation with the beta (slope) parameters are a little more tricky to me. If exp(beta) of the population-level beta is the % increase for every unit increase in APD (or 1 SD increase if I’ve scaled and centered my independent variables), then what are the exp(beta_id) i.e. id-level betas? Are they an additional % increase per unit increase in APD, or are they also a multiplicative? Because of the way I’ve written my model formula above I feel like it’s an additional increase, example if exp(beta) for a population is 1.03 and exp(beta_id) for this ID is 1.03, the total increase in sales for a 1 SD increase in APD would be 6% for this ID. Is that correct?

I haven’t gotten a lot of traction on this thread, despite getting a few folks reading it, so perhaps I should rephrase my question.

For a given individual in my model, I have the population wide constant slope estimate, and an id-level varying slope estimate. I can use fixef and ranef() from brms to extract these estimates from my model object. Now, because my model is using the lognormal family, I need to use exp() to transform the estimates back, and doing so will give me the % increase in y for every 1 standard deviation increase in x.

Now if I wanted to get the TOTAL effect for this individual, would it be exp(fixed) * exp(random) or exp(fixed) + exp(random)?

Hi,
just a few thoughts:

exp(Intercept) is roughly the value of sales when all independent variables are at 0 - because all of those variables act before taking the exponent.

I think the best way to think about those models is to really internalize logarithms/exps. So when you add x on the log scale, it is the same as multiplying by exp(x) on the response scale. So if the population level effect of APD is fixed_APD and the varying effect of APD for ID 1 is beta_APD[i] then one unit increase in APD results in multiplying the outcome for ID 1 by exp(fixed_APD) * exp(beta_APD[i]) = exp( fixed_APD + beta_APD[i]). Does that clarify things?

Hi Martin,

Thanks so much for getting back to me on this. You’re right, thinking about the behavior of logarithms first before applying it to the model helped me a lot, and I see that exp(fixed_APD) * exp(beta_APD[i]) = exp( fixed_APD + beta_APD[i])

This has given me confidence that I’m applying the transformations in the right way, appreciate your help.

2 Likes