- I’d like to model the group-level variance of a random coefficient as a function of other group-level variables.
- I know I can model
sigmaas a function of other variables. But cannot see how to model the random slope as well.
fit_rent2 example from Bürkner (2018), suppose we have a model:
library(brms) data("rent99", package = "gamlss.data") bform <- bf(rentsqm ~ area + (area | district), sigma ~ area + (1 | district)) m1 <- brm(bform, data = rent99, chains = 4, cores = 4)
What I’d like is something like:
bform <- bf(rentsqm ~ area + (area | district), sigma ~ (1 | district), ---> sigma[area] ~ district) <--- m2 <- brm(bform, data = rent99, chains = 4, cores = 4)
sigma allows modelling of the group-level intercept. In theory,
sigma[area] would allow modelling of the random slope for
Is anything like this possible?
I may be confusing things, so to explain the motivation:
- We have a continuous outcome
ythat we relate to a binary covariate
- We allow a group-level intercept for
yand a group-level coefficient for
- The effect of
yis larger for some individuals than others.
- We want to consider what other variables explain this variation (e.g.
So, the thinking was to model predictors of the group-level coefficient for
x1, as suggested above (
sigma[x1] ~ x2). A positive coefficient for for
sigma[x1]_x2 would mean that the effect of
y is larger for individuals with greater
It’s entirely possible I’m missing something obvious, have the wrong approach and/or question. Any suggestions would be gratefully received.
- Operating System: Arch Linux x86_64
- brms Version: 2.16.1