# NOT RUN {
library(modelbased)
# }
# NOT RUN {
data <- mtcars
data$cyl <- as.factor(data$cyl)
data$am <- as.factor(data$am)
if (require("rstanarm")) {
model <- stan_glm(mpg ~ cyl * am, data = data, refresh = 0)
estimate_means(model)
model <- stan_glm(mpg ~ cyl * wt, data = data, refresh = 0)
estimate_means(model)
estimate_means(model, modulate = "wt")
estimate_means(model, fixed = "wt")
}
if (require("brms")) {
model <- brm(mpg ~ cyl * am, data = data, refresh = 0)
estimate_means(model)
}
# }
Run the code above in your browser using DataLab