2
$\begingroup$

I have a Bayesian model of the form:

$$ \begin{align} y & \sim logNormal(\mu, \sigma)\\ \mu_n & = \alpha + \beta_0 c_n + \beta_1 d_n + \beta_2 c_n d_n \end{align} $$ Where:

  • $y$ is a variable measured in ms
  • $c$ is a sum-contrast coded variable equal to 1 or -1.
  • $d$ is a scaled and centered continuous variable

This omits assumed prior distributions, and slope and intercept adjustments, I believe they are not important with respect to the main point. Since the likelihood is logNormal the results are on the log scale.

I want to back-transform the estimates from the model and compute the effect sizes of different variables. I think I know how to do this for $c$:

$$ \mu|_{c=1} - \mu|_{c=-1} = \exp (\alpha + \beta_0 + \beta_1 d_n + \beta_2 d_n ) - \exp (\alpha - \beta_0 + \beta_1 d_n - \beta_2 d_n ) $$

For interaction this is slightly more complicated. Let the interaction effect be: $IE = \frac{\partial \mu}{\partial d}|_{c = 1} - \frac{\partial \mu}{\partial d}|_{c = -1}$. I remove the log by exponentiation and then I take the derivative which results in:

$$ \frac{\partial \mu}{\partial d} = \exp (\alpha + \beta_0 c_n + \beta_1 d_n + \beta_2 c_n d_n ) (\beta_1 + \beta_2 c_n) $$

So the interaction effect is the difference of these two terms:

$$ \begin{align} \frac{\partial \mu}{\partial d}|_{c = 1} = & \exp (\alpha + \beta_0 + \beta_1 d_n + \beta_2 d_n ) (\beta_1 + \beta_2) \\ \frac{\partial \mu}{\partial d}|_{c = -1} = & \exp (\alpha - \beta_0 + \beta_1 d_n - \beta_2 d_n ) (\beta_1 - \beta_2) \\ \end{align} $$

My questions are:

  1. Are the derivations for the interaction effect and the effect of $c$ correct? If yes, this means that these effects are functions of $d$, but fitting the model returns the effects (on the log scale) as constants. Where does this difference come from?
  2. How do I derive and interpret the effect for $d$? Ie. what are the meaningful points at which to evaluate the function $\mu$? Or maybe is there a better way of doing this?
$\endgroup$
2
  • 1
    $\begingroup$ Small nitpick on notation. Shouldn't it be (for example) $\partial \mu / \partial d$ instead of $\partial y / \partial d$? $y$ is a random variable, so it does not immediately make sense to take its derivative. Similarly, should $y |_{c=1}$ instead be $\mu |_{c = 1}$? $\endgroup$ Commented Mar 10, 2021 at 18:52
  • $\begingroup$ @stats_model Yes, I think you're right. Thanks, I'll correct it. $\endgroup$
    – jjj
    Commented Mar 10, 2021 at 21:21

1 Answer 1

3
+50
$\begingroup$

The effect size of a log-normal model has not a univoque value on the same scale of y, because of the log-relation between $\mu$ and the position of the log-normal distribution (its median, its mean). When changing a covariate, the model predictions move linearly with the covariate on the log scale, not on the original scale, so on the log scale there is a constant effect size, while on the original scale there is not, it varies.

The effect sizes you already have are good as they are, you can't "back-transform" them without making a mess of them. Although you may make a simple exponentiation of the betas. This is called "time ratio" in AFT models, and expresses the proportion between the predicted value for two observations with unit variation in the corresponding covariate (the proportion, because the difference varies!).

$\endgroup$
4
  • $\begingroup$ Thanks for answering this is helpful. One question/remark though: is this correct to call the likelihood here a "link function"? I thought the link would be eg. $f$ if the model was specified like $f(\mu) = \ldots$. Even more in the brms package it's explicitly stated that the link for lognormal is "identity". $\endgroup$
    – jjj
    Commented Mar 16, 2021 at 15:26
  • 1
    $\begingroup$ likelihood and link functions are not the same thing, link functions really apply only to GLMs, and this is not a GLM, but I used the term hoping it would make things clearer. You are also right about the fact that $\mu$ here is equal to the linear predictor, not a transformation (so we may say link function is identity). What I intended is that the position of the predictive distribution (its median, its expected value) vary with the exponential of the linear predictor. $\endgroup$
    – carlo
    Commented Mar 16, 2021 at 16:18
  • $\begingroup$ I edited the answer $\endgroup$
    – carlo
    Commented Mar 16, 2021 at 16:22
  • 1
    $\begingroup$ Thanks, I think I understood what you meant but wanted to be sure. I'll accept (and award you the bounty) if no other answers appear in the next few days. $\endgroup$
    – jjj
    Commented Mar 16, 2021 at 17:32

Your Answer

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