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

add_epred_draws does not show error when re_formula = includes non-existent terms #317

Open
mz555 opened this issue Nov 15, 2023 · 1 comment

Comments

@mz555
Copy link

mz555 commented Nov 15, 2023

I was using tidybayes to plot some data from a brms model, and realised the figure looked off, but could not tell why, until I realised the term I provided in add_epred_draws for re_formula= was misspelt.

It would be good if the package threw an error message to alert the user to this issue.

Wrong code:
add_epred_draws(m1, re_formula = ~ (1 | item)) I used "item" with no capital. It showed no error when running the code, and only realised because my plot estimates were off.

Correct code:
add_epred_draws(m1, re_formula = ~ (1 | Item))

Wrong plot
image
Correct plot
image

@mjskay
Copy link
Owner

mjskay commented Nov 15, 2023

Yeah an error/warning here would be good. Can you check and see if you call the underlying brms function (brms::posterior_epred) no error/warning is generated? If that isn't generating a warning either then this is an issue for brms.

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

2 participants