Skip to content

Instantly share code, notes, and snippets.

@andrewheiss
Created December 9, 2025 15:24
Show Gist options
  • Select an option

  • Save andrewheiss/629939295382e63f6168fb1e49a20bdb to your computer and use it in GitHub Desktop.

Select an option

Save andrewheiss/629939295382e63f6168fb1e49a20bdb to your computer and use it in GitHub Desktop.
library(tidyverse)
library(parameters)
library(ggdist)

# :(
lm(body_mass ~ 0 + species, data = penguins) |>
  model_parameters() |>
  ggplot(aes(x = Coefficient, y = Parameter, color = Parameter)) +
  geom_pointrange(
    aes(xmin = CI_low, xmax = CI_high, fill = Parameter),
    shape = 21,
    color = "white"
  ) +
  guides(color = "none")

# :)
lm(body_mass ~ 0 + species, data = penguins) |>
  model_parameters() |>
  ggplot(aes(x = Coefficient, y = Parameter)) +
  geom_linerange(aes(xmin = CI_low, xmax = CI_high, color = Parameter)) +
  geom_point(aes(fill = Parameter), size = 3, shape = 21, color = "white") +
  guides(color = "none", fill = "none")

# :)
lm(body_mass ~ 0 + species, data = penguins) |>
  model_parameters() |>
  ggplot(aes(x = Coefficient, y = Parameter)) +
  geom_pointinterval(
    aes(
      xmin = CI_low,
      xmax = CI_high,
      interval_color = Parameter,
      point_fill = Parameter
    ),
    shape = 21,
    point_color = "white",
    point_size = 3
  ) +
  guides(interval_color = "none", point_fill = "none")

Created on 2025-12-09 with reprex v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment