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:
- 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?
- 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?