see icon indicating copy to clipboard operation
see copied to clipboard

Add plotting method for `estimate_means` objects

Open IndrajeetPatil opened this issue 3 years ago • 0 comments

before

model <- lm(Sepal.Width ~ Species, data = iris)

means <- estimate_means(model)

ggplot(iris, aes(x = Species, y = Sepal.Width)) +
  # Add base data
  geom_violin(aes(fill = Species), color = "white") +
  geom_jitter2(width = 0.05, alpha = 0.5) +

  # Add pointrange and line from means
  geom_line(data = means, aes(y = Mean, group = 1), size = 1) +
  geom_pointrange(
    data = means,
    aes(y = Mean, ymin = CI_low, ymax = CI_high),
    size = 1,
    color = "white"
  ) +
  # Improve colors
  scale_fill_material() +
  theme_modern()

after

model <- lm(Sepal.Width ~ Species, data = iris)

means <- estimate_means(model)

plot(mean)

desired output (approximate)

image

IndrajeetPatil avatar Jun 25 '22 07:06 IndrajeetPatil