Creates a coefficient plot with estimates and confidence intervals using ggplot2.

coef_plot(
  estimate,
  lwr1,
  upr1,
  labels = NULL,
  lwr2 = NULL,
  upr2 = NULL,
  text = TRUE,
  text.size = 3,
  round = 2,
  coord.flip = FALSE,
  title = NULL,
  legends = c("Estimate", "Bounds", "Conf. Bounds"),
  h0 = 0,
  h0.color = "darkorange",
  bar.type = c("error_bar", "linerange"),
  err.width = 0.1,
  xlab = "Parameter",
  ylab = "Value",
  lwd = c(0.625, 1.25),
  colors = c("black", "blue", "red")
)

Arguments

estimate

numeric vector of point estimates.

lwr1

numeric vector of lower bounds for the first interval.

upr1

numeric vector of upper bounds for the first interval.

labels

optional character vector of labels for each coefficient.

lwr2

optional numeric vector of lower bounds for the second interval.

upr2

optional numeric vector of upper bounds for the second interval.

text

logical. Should text labels be added? Default is TRUE.

text.size

numeric. Size of text labels. Default is 3.

round

integer. Number of digits to round displayed values. Default is 2.

coord.flip

logical. Should the plot coordinates be flipped? Default is FALSE.

title

optional character string for the plot title.

legends

character vector of legend labels. Default is c("Estimate", "Bounds", "Conf. Bounds").

h0

numeric. Value for the null hypothesis line. Default is 0. Set to NULL to suppress.

h0.color

character. Color of the null hypothesis line. Default is "darkorange".

bar.type

character. Type of interval display: "error_bar" or "linerange".

err.width

numeric. Width of error bars. Default is 0.1.

xlab

character. X-axis label. Default is "Parameter".

ylab

character. Y-axis label. Default is "Value".

lwd

numeric vector of line widths.

colors

character vector of colors.

Value

A ggplot object.