Hello!
I’m aware of the usage of gr() to estimate seperate variance-covariance matrices for each level of a between-subject factor as per here. Using the third example there,
fit3 <- brm(count ~ Trt + (1|gr(patient, by = Trt)), data = epilepsy)
What if I have another between-subject variable (say, COND with 2 levels) that I want to include in the ‘by’ argument so that I can estimate four unique variance-covariance matrices (i.e., Trt0+COND1, Trt0+COND2, Trt1+COND1, and Trt1+COND2). Would it just be the below?
fit3 <- brm(count ~ Trt + (1|gr(patient, by = Trt + COND)), data = epilepsy)
Thank you!