Multiple-outcome causal model in brms

I would like to fit a multivariate causal model in brms, according to the following hypothesized DAG:

dag

Through the model, I want to understand the total effect of the treatment a on both outcomes y1 and y2, while taking into account a mediator m and another covariate b. I further want to understand the correlation between the outcomes y1 and y2.

This was my attempt so far:

model <- brm(
  data = data,
  bf(y1 ~ 1 + a + b + m) +
    bf(y2 ~ 1 + a + b + m) +
    bf(m ~ 1 + a) +
    set_rescor(TRUE)
)

This estimates the residual correlation between y1 and y2, but also between y1 and m and y2 and me, which I am not interested in. Is it possible to exclude those correlations somehow from the covariance matrix?

I am not an expert in causal modelling, so my problem may be ill-posed. Any thoughts on how to approach this problem are greatly appreciated.

  • Operating System: Windows 10
  • brms Version: 2.17.0

Hello @tester, any luck with this? I have a similar research question.

I think it’s not possible to get surgical like this in a var-covar matrix in brms, but there seems to be a plan to include more SEM-like flexibility of covariance matrixes in general in brms 3.0. See this issue and the others it links to.

2 Likes

It is possible to fit this type of model in blavaan, which uses Stan for estimation and which allows for control over covariances. For the example at the top of this post, the code might look like

library(blavaan)

m1 <- ' y1 ~ a + b + m
        y2 ~ a + b + m
        m ~ a '

fit <- bsem(m1, data = mydata, meanstructure = TRUE)

This only includes the y1-y2 correlation by default, but it is also possible to add lines to the model syntax like

y1 ~~ 0 * m

which explicitly fixes the y1-m correlation to 0.

3 Likes