Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mediation with censored data using brm and bayestestR #631

Open
shakhlonematova opened this issue Oct 20, 2023 · 0 comments
Open

mediation with censored data using brm and bayestestR #631

shakhlonematova opened this issue Oct 20, 2023 · 0 comments

Comments

@shakhlonematova
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant