Is it possible to get a subject-level credible interval for the independent variable (for a given fixed value of the dependent variable)?
For example, the code below fits a model for the average reaction time (as the dependent variable) per day of sleep deprivation (as the independent variable) in the sleep deprivation study. Could I now extract for each subject the credible interval for the number of days of sleep deprivation that would lead to a reaction time of 300 ms?
(I am aware that the model could be fitted the other way around [i.e., reaction time as independent variable and days as dependent variable]. But I was wondering, whether there is a ‘direct’ solution.)
library(brms)
get_prior(Reaction ~ Days + (1 + Days|Subject), sleepstudy)
fit <- brm(
Reaction ~ Days + (1 + Days | Subject),
data = sleepstudy,
family = gaussian(),
prior = prior1,
chains = 4
)