Hello, I am setting up a multivariate model in brms. The data consists of subjects who received treatment at 4 different time points. Due to the nature of the data, the resp_subset function was used to subset out the different time periods resulting in 4 response variables (Group1_response_value, Group2_response_value, etc), two predictor variables (our time variable, TimeVar and another, var2) and a group level effect for the subject intercept (1|p|study_participant).
The generic model code used was:
bform_1 <- bf(Group1_response_value | resp_subset(sub1) ~ TimeVar_group1 + var2 + (1|p|study participant)) + bf(Group2_response_value | resp_subset(sub2) ~ TimeVar_group2 + var2 + (1|p|study participant)) + bf(Group3_response_value | resp_subset(sub3) ~ TimeVar_group3 + var2 + (1|p|study participant)) + bf(Group4_response_value | resp_subset(sub4) ~ TimeVar_group4 + var2 + (1|p|study participant))) Model <- brm(bform_1, df)
This code produced an expected outcome but -due to the nature of our data, we would like to model the parameters on each TimeVar (between each univariate model, so TimeVar_group1, TimeVar_group2, etc) as correlated. I’ve read through the vignettes and the updated documentation from Nov 2020 and can’t find a function that will do this. I’ve seen in the brms formula vignette that we can indicate correlation between group level terms by “using || instead of |. All group-level terms sharing the same ID will be modeled as correlated”. Is there a way to do something similar to this for our population level regression parameter- and also indicate it would be for just one of the predictor terms?
Operating System: Windows 10, 64-bit
R version 4.0.3, brms version 2.14.4