# NOT RUN {
library(modelbased)
model <- lm(Petal.Length ~ Sepal.Width * Species, data = iris)
estimate_means(model)
estimate_means(model, fixed = "Sepal.Width")
estimate_means(model, levels = c("Species", "Sepal.Width"), length = 2)
estimate_means(model, levels = "Species=c('versicolor', 'setosa')")
estimate_means(model, levels = "Sepal.Width=c(2, 4)")
estimate_means(model, levels = c("Species", "Sepal.Width=0"))
estimate_means(model, modulate = "Sepal.Width", length = 5)
estimate_means(model, modulate = "Sepal.Width=c(2, 4)")
# }
# NOT RUN {
if (require("lme4")) {
data <- iris
data$Petal.Length_factor <- ifelse(data$Petal.Length < 4.2, "A", "B")
model <- lmer(Petal.Length ~ Sepal.Width + Species + (1 | Petal.Length_factor), data = data)
estimate_means(model)
estimate_means(model, modulate = "Sepal.Width", length = 3)
}
# }
# 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")
}
# }
# NOT RUN {
# }
# NOT RUN {
if (require("brms")) {
model <- brm(mpg ~ cyl * am, data = data, refresh = 0)
estimate_means(model)
}
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab