Modeling latent means in brms for multilevel group mean centering

Hi @martinmodrak, thanks for that!

I don’t think that solves the issue however, because wouldn’t that just include the mean of the dependent variable? The “latent mean” that should be modeled in a within-between model is the mean of one or more predictor variables.

So, for instance, something like y ~ (x-mean(x)) + mean(x) + (1 | cluster), where mean(x) is the within-cluster mean of X, for one or more X’s. The “latent mean” here is a recommendation that refers to the SEM framework, where instead of using the calculated sample mean (which is a point estimate), we can model the mean as a latent variable (which incorporates uncertainty).