rstanarm icon indicating copy to clipboard operation
rstanarm copied to clipboard

Why does stan_lm ignore a factor level in a model with no intercept?

Open jgabry opened this issue 3 years ago • 0 comments

Originally pointed out on the forum in https://discourse.mc-stan.org/t/why-does-stan-lm-ignore-a-factor-level-in-a-model-with-no-intercept/24877.

@bgoodri stan_lm still drops a factor level even if the intercept is omitted, e.g. stan_lm(mpg ~ 0 + as.factor(cyl), data = mtcars, prior = R2(0.5, "mean")). This contradicts the behavior of lm and stan_glm. Is this intentional or a bug?

jgabry avatar Nov 12 '21 19:11 jgabry