Priors on proportion mediated

Im just curious if there is an existing way we could put a prior on the proportion mediated in a model.

Here is the general setup to get proportion mediated (pretty simple to implement with posterior_samples()).

y ~ a*m + c*x
m ~ b*x

directEffect ~ c
indirectEffect ~ a * b

proportionMediated ~ indirectEffect / (directEffect + indirectEffect)

So I want to set a prior on proportionMediated, Im guessing you cant do it at the moment and the next best thing would be to get the Stan code and add it directly ?

As another option, how hard would it be for a pleb like me to fork the brms repo and add it ?

  • Operating System: Windows 10
  • brms Version: 2.7.3

The problem is that, currently, parameters cannot be shared across univariate models within a multivariate model in brms, but this is necessary for what you have in mind. I plan to make this possible in brms 3.0

As another option, how hard would it be for a pleb like me to fork the brms repo and add it ?

It would not be worth the effort. I would suggest writing the model in Stan directly, possibly building on some Stan code written by brms.

1 Like