Multivariate modelling using brms

I’m trying to find the correlation between “boldness” and “aggression” - what is known as a behavioural syndrome. One of the methods is to fit a multivariate mixed model with boldness and aggression as response variables, and see how much of correlation is partitioned among “between-individuals” vs. “within-individuals”. Boldness (continuous response variable) and aggression (ordinal ranks) were repeatedly assayed on 320 animals (ID) from 12 colonies (colonyID). As individual animals are not independent from their colonies, ID has to be nested within colonyID.

The question is if I can fit a multivariate model with two different response distributions? If I understand correctly, the vignette says different families can be specified as a list. However, when I tried the following formula,

mod<-brm(mvbind(Boldness,Aggression)~Trial+(1|ID/colony),family = c(gaussian,sratio),data=mydata,chains=2,cores=2)

I get the following error message " Error: Argument ‘family’ is invalid".

I’m unable to find an example in the internet where two different response variables with different error structures are used. Or maybe I’m missing something, so I might need a fool’s guide…

My second question is if I can use the brms package to partition the co-variances into between-individual and among-individual variances and co-variances? This has often been done using MCMCglmm, but I would like to use brms because I feel this package is easier to use and easier to diagnose the model. Any help would be much appreciated!

Hi

> ?brmsformula

And here’s the example :)

# specify a multivariate model using the '+' operator
bf(y1 ~ x + (1|g)) + 
  gaussian() + cor_ar(~1|g) +
  bf(y2 ~ z) + poisson()
``

Hi @torkar

Thanks for the pointer. I tried running the model as you suggested:

“mod<-brm(bf(Boldness~Trial+(1|uniqueID))+gaussian()+cor_ar(~1|uniqueID)+bf(Aggression~Trial+(1|uniqueID))+categorical(),data=mydata)”

But got the following error message: “Error: ARMA models are not implemented for family ‘categorical’”

My second response variable, namely “Aggression” is in the ordinal scale…

In the github version of brms, you can now specify AR terms inside the formula, that is Boldness~Trial+(1|uniqueID) + ar(gr = uniqueID, p = 1) in your case. Then, the error should no longer appear.

Thanks Paul. This solves the problem.