-
-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
Describe the bug
When trying to run a mediation analysis with a censored outcome variable in one of the models using brms (2.20.4) and bayestestR (0.13.1), I am getting the following error:
Error in .subset2(x, i, exact = exact) : subscript out of bounds
To Reproduce
f1 <-bf(pa_comp_transformed ~ composite)
f2 <- bf(dscore | cens(dscore>=4) ~ modality*pa_comp_transformed+modality*composite+(1|subject))
m2 <- brm(f1 + f2 + set_rescor(FALSE), data = test_df, refresh = 0)
mediation_result <- bayestestR::mediation(m2)
- if we the model is run without censoring, the mediation() function works fine
Expected behaviour
I expected the mediation() function to handle the models with censored data
Specifiations (please complete the following information):
R Studio Version 2023.09.0+463
R version 4.3.1 (2023-06-16)
brms (2.20.4)
bayestestR (0.13.1)
Metadata
Metadata
Assignees
Labels
No labels