I can’t find any examples, but brms has so many (awesome!) features that I may have missed it.
I want to model protein concentrations for many different proteins measured on the same samples. I would prefer a multivariate model because many protein types are correlated. A not-trivial number of concentrations are left censored (below the detectable limit), but in principle they may also be right censored (i.e. any measurements outside the region of the standard curve). The censoring limits vary by protein, and by batch (batch random effects are ignored for simplicity in the example below).
I can fit a censored model for a single protein ok:
brm_cens <- brm(
bf(conc_log | cens(cens) ~ Treatment),
data = datas %>% filter(response_name %in% “protein1”)
)
I can fit a multivariate model to all the proteins with no censoring ok:
brm_mv <- brm(
bf(mvbind(protein1, protein2) ~ Treatment),
data = datas %>% spread(response_name, conc_log)
)
But I can’t figure out how to fit a multivariate model with censoring. This is what I have tried:
brm_mv_cens <- brm(
bf(mvbind(protein1_conc_log, protein2_conc_log) |
cens(mvbind(protein1_cens, protein2_cens)) ~
Treatment),
data = datas %>% spread(response_name, conc_log)
)
Resulting in an error message:
“Setting ‘rescor’ to TRUE by default for this model
Error: Only ‘se’, ‘weights’, ‘mi’ are supported addition arguments when ‘rescor’ is estimated.”
- Operating System: Windows 10
- brms Version: 2.9.0