rstanarm icon indicating copy to clipboard operation
rstanarm copied to clipboard

models with constant outcomes

Open bgoodri opened this issue 9 years ago • 6 comments

Summary:

A rstanarm model will fail if any of the variables (including the outcome) are constant. But I'm not sure what we really want to do in this case.

Description:

Because of check_constant_vars

Reproducible Steps:

http://stackoverflow.com/questions/41354745/rstanarm-updating-priors-with-binary-data-without-any-events

RStanARM Version:

2.14.1

R Version:

3.3

Operating System:

Debian

bgoodri avatar Dec 30 '16 23:12 bgoodri

Yeah I'm not sure what we want do to either

jgabry avatar Dec 30 '16 23:12 jgabry

With improper priors, it would be an improper posterior. With proper priors, you could learn your priors were wrong.

On Fri, Dec 30, 2016 at 6:30 PM, Jonah Gabry [email protected] wrote:

Yeah I'm not sure what we want do to either

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstanarm/issues/149#issuecomment-269834782, or mute the thread https://github.com/notifications/unsubscribe-auth/ADOrqpFDKsbeswmTEe9SFYj9M3LcluBaks5rNZQTgaJpZM4LYblI .

bgoodri avatar Dec 30 '16 23:12 bgoodri

The bernoulli.stan file would fail anyway because N is declared with a lower bound of 1 but that is somewhat minor compared to the question of whether we want to estimate the model.

bgoodri avatar Dec 30 '16 23:12 bgoodri

This might be something to hold off on settling until the next release.

jgabry avatar Dec 30 '16 23:12 jgabry

yeah

On Fri, Dec 30, 2016 at 6:46 PM, Jonah Gabry [email protected] wrote:

This might be something to hold off on settling until the next release.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstanarm/issues/149#issuecomment-269835791, or mute the thread https://github.com/notifications/unsubscribe-auth/ADOrqpdVZ7EbgheSqqIWAhOyeo7HZledks5rNZfPgaJpZM4LYblI .

bgoodri avatar Dec 30 '16 23:12 bgoodri

I think the following should work, but fails due to constant y error

d_bin <- data.frame(N = c(674, 674), y = c(39,39), grp2 = c(0,1))
fit_bin <- stan_glm(y/N ~ grp2, family = binomial(), data = d_bin,
                     weights = N, refresh=0)

avehtari avatar Nov 28 '19 11:11 avehtari