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

Not specifying trials in logistic regression with y = 0 has trials set to 0 #1501

Closed
lauken13 opened this issue May 23, 2023 · 2 comments
Closed
Labels
Milestone

Comments

@lauken13
Copy link
Contributor

Bit of an edge case (and this is depreciated) but if you don't set the trials and have all 0s in your outcome, the trial number is set to 0 and the model returns the prior.

Probably doesn't require a fix (perhaps a warning), but I thought I should add an issue in case! :)

mod2 <- brm(y |trials(1) ~ 1, family = binomial(link = "logit"), data = data.frame(y = rep(0,1000)), backend = "cmdstanr")

vs

mod2b <- brm(y ~ 1, family = binomial(link = "logit"), data = data.frame(y = rep(0,1000)), backend = "cmdstanr")

@paul-buerkner
Copy link
Owner

Thanks! I think it is just about time to disallow not specifying trials() in binomial families altogether. It has been deprecated long enough.

@paul-buerkner paul-buerkner added this to the 2.20.0 milestone May 23, 2023
paul-buerkner added a commit that referenced this issue Jul 12, 2023
@paul-buerkner
Copy link
Owner

I now no longer allow not specifying trial in binomial models to avoid this and similar issues.

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

No branches or pull requests

2 participants