and thanks in advance for your help!
I would like to test the correlation between random slopes by running a model comparison.
model<-brm(Y ~ Phase + (1+Phase|subject) + (1|item),
data=Con, sample_prior = TRUE, save_all_pars = TRUE, iter=10000)
- Y is a continous variable
- Phase is a categorical variable (factor) with three levels (0, 1, 2)
With the default contrast coding, I get estimates for the following fixed effects:
- Intercept (estimate at Phase = 0)
- Slope 1 (difference between 0 and 1)
- Slope 2 (difference between 0 and 2).
I also get estimates for the following random effects
- Correlation between random intercepts and random slopes 1
- Correlation between random intercepts and random slopes 2
- Correlation between random slopes 1 and random slopes 2
I would like to test the hypothesis that the correlation between random slopes 1 and random slopes 2 is different from 0. I’d like to run a model comparison (e.g., by using bayes_factor), in which I compare a model with all three correlations to a model where the third correlation is set to 0.
Is that possible?
From the brms documentation I learned that it is possible to set parameters to constants in the prior specification. Is that also possible for (parts of the) variance-covariance matrix?