Multivariate model with different DV length in brms

Dear brms and stan experts,

I am trying to use brms to fit a multivariate model with two DV, however the length of these two DV is different.

I have two behavioral task data(rt data), both of them are done by the same people. And i want to measure people’s performance on these two task has some correlation or not by using the multivariate model, the problem is the trial number of each task is different.

How should i organize the data structure? If i put 0 into the open slots of the shorter DV, certainly it would influence the estimation of intercept parameter. Or can i leave the short DV’s open slots with NA value? Looking forward to your topic! Thanks a lot.

Hi @zaizibai

You can use the resp_subset() (Additional Response Information — addition-terms • brms) addition term on the formula left hand side to include different subsets of the data in the two outcomes.

So you can create a variable like y2_exists in the data which is TRUE when the second outcome exists, and FALSE when it doesn’t then use that in the second outcome’s formula y2 | resp_subset(y2_exists) ~ ...

Does that help? If you still have problems can you post a reproducible example and we can try to make the code work.

2 Likes

Hi matti,
Thanks for your reply and help. Using ‘resp_subset()’ indeed solve my problem. However, i have a more general question about the comparison between Univariate model and multivariate model. For individual difference study, separate fit DV with univariate model and compare the random effect parameter of each model or using a multivariate model, which one is better? Does multivariate model decrease the Type one error? But fitting multivariate model is more difficult? Cause there are much more parameters in multivariate model. Thanks in advance.

Glad I was able to help :)

The multivariate model is better generally, but you want to carefully consider the assumptions and parameterization of each approach. Pooling across more dimensions (multivariate) is generally better.

If you’d like to have a broader discussion about this I’d recommend opening another discussion.

1 Like