# NOT RUN {
library(modelbased)
# Linear Models
model <- lm(mpg ~ wt, data = mtcars)
estimate_response(model)
estimate_relation(model)
# Logistic Models
model <- glm(vs ~ wt, data = mtcars, family = "binomial")
estimate_response(model)
estimate_relation(model)
# Mixed models
if (require("lme4")) {
model <- lmer(mpg ~ wt + (1 | gear), data = mtcars)
estimate_response(model)
estimate_relation(model)
}
# Bayesian models
if (require("rstanarm")) {
model <- rstanarm::stan_glm(mpg ~ wt, data = mtcars, refresh = 0, iter = 200)
estimate_response(model)
estimate_relation(model)
}
# }
Run the code above in your browser using DataLab