chest_plot {chest}R Documentation

Plot effect estimate and change-in-estimate values (ggplot type)

Description

Plot effect estimate and change-in-estimate values (ggplot type)

Usage

chest_plot(
  data,
  no_values = FALSE,
  ylab = NULL,
  xlab = NULL,
  change_lab = "Change, %",
  digits = "%.2f",
  digits_change = "%.1f",
  plus = "  + ",
  nudge_y = 0.4,
  nudge_x = NULL,
  hjust = 0.5,
  height = 0.06,
  point_size = 3,
  point_shape = 15,
  vline_type = "dashed",
  vline_color = "grey50",
  ebar_color = "grey50",
  zero = 1,
  value_position = NULL,
  ...
)

Arguments

data

Object from chest_cox, chest_glm, chest_lm, chest_clogit, or chest_nb, including effect estimate values and change-in-estimate values.

no_values

Suppress effect estimate values in plot, default is FALSE.

ylab

Add y label.

xlab

Add x label.

change_lab

Character string for the column name of "Change" in the graph

digits

Set the display format for number in the graph other than the "Change" column. Default: "%.2f"

digits_change

Set the format for the "Change" column. Default: "%.1f"

plus

Change the + sign before variable names.

nudge_y

Adjust vertical distance between values and point marker.

nudge_x

Adjust horizontal distance between values and point marker.

hjust

Adjust horizontal alignment.

height

Change the height of error bars.

point_size

Change point marker size.

point_shape

Change point marker shape.

vline_type

Change vertical line type.

vline_color

Change vertical line color.

ebar_color

Change error bar color.

zero

x-axis coordinate for vertical non-effect line, see forestplot.

value_position

Change the position of value labels.

...

Further optional arguments for forestplot.

Value

a ggplot object.

See Also

'ggplot2'

Examples

vlist <- c("Age", "Sex", "Married", "Education", "Income")
results <- chest_glm(
  crude = "Endpoint ~ Diabetes",
  xlist = vlist, na_omit = TRUE, data = diab_df
)
chest_plot(results)

[Package chest version 0.3.7 Index]