model <- lm(mpg ~ 0 + gear, data = mtcars)
has_intercept(model)
model <- lm(mpg ~ gear, data = mtcars)
has_intercept(model)
if (require("lme4")) {
model <- lmer(Reaction ~ 0 + Days + (Days | Subject), data = sleepstudy)
has_intercept(model)
model <- lmer(Reaction ~ Days + (Days | Subject), data = sleepstudy)
has_intercept(model)
}
Run the code above in your browser using DataLab