Can a coupled model setup be constructed in which the random intercepts are conditioned to an exogenous continuous variable in BRMS or other Bayesian approaches?

Short summary of the problem
*I am just starting to get into Bayesian stuff, so I apologize for any sacrilegious terminology or pure misunderstandings on my part.

I ran a random intercept model (Fitcon) that captured most of the variation in my data beautifully. Nevertheless, most of the observed variation is conditional on the random effect of the subject (in this case, the site).

Conditional R2: 0.871 (95% CI [0.848, 0.888])
Marginal R2: 0.344 (95% CI [0.227, 0.472])

In spite of being a very effective model explaining within subject variation, the random effect has not much scientific value to me. For example, when random effects are not specified, the fitscale model (below) is the top-ranked model. This model (Fitscale) is poor at explaining the variation within subjects, but it’s effective at explaining the variation between subjects. I was wondering if there is a modelling setup that I can run these two models together: one that accounts for within subjects variation and the other between subjects.
Will BRMS allow me to run a model where my random intercepts are conditional on the continuous variable (X3) in the same modelling scope?



*I simulated some data from my data to help you folks understand.

fitcon <- brm((PC)~(X1)+(X2)+(1|site))
fitscale  <- brm((PC)~X3)

simulation.csv (6.4 KB)

If possible, add also code to simulate data or attach a (subset of) the dataset you work with.

Please also provide the following information in addition to your question:

  • Operating System: Windows 10
  • brms Version: brms_2.16.1

Morning and welcome. Sorry about the delay. Can you post your model call and output? Also if you have a plot of your data or a plot of the simulated data that can help too.