Open jgabry opened 2 years ago
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?
stan_lm
stan_lm(mpg ~ 0 + as.factor(cyl), data = mtcars, prior = R2(0.5, "mean"))
lm
stan_glm
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 oflm
andstan_glm
. Is this intentional or a bug?