plot.sreg: Plot Method for 'sreg' Objects

View source: R/output.r

plot.sregR Documentation

Plot Method for 'sreg' Objects

Description

Visualize estimated ATEs and confidence intervals for objects of class sreg.

Usage

## S3 method for class 'sreg'
plot(
  x,
  treatment_labels = NULL,
  title = "Estimated ATEs with Confidence Intervals",
  bar_fill = NULL,
  point_shape = 23,
  point_size = 3,
  point_fill = "white",
  point_stroke = 1.2,
  point_color = "black",
  label_color = "black",
  label_size = 4,
  bg_color = NULL,
  grid = TRUE,
  zero_line = TRUE,
  y_axis_title = NULL,
  x_axis_title = NULL,
  ...
)

Arguments

x

An object of class sreg.

treatment_labels

Optional vector of treatment labels to display on the y-axis. If NULL, default labels like "Treatment 1", "Treatment 2", etc., are used.

title

Optional plot title. Defaults to "Estimated ATEs with Confidence Intervals".

bar_fill

Optional fill color(s) for the confidence interval bars. Can be NULL (default viridis scale), a single color, or a vector of two colors for a gradient.

point_shape

Optional shape of the point used to mark the estimated ATE. Default is 23 (a diamond).

point_size

Optional size of the point marking the ATE.

point_fill

Optional fill color of the ATE point shape.

point_stroke

Optional stroke (border) thickness of the ATE point shape.

point_color

Optional outline color of the ATE point.

label_color

Optional color of the text label displaying the estimate and standard error.

label_size

Optional size of the text label displaying the estimate and standard error.

bg_color

Optional background color of the plot panel. If NULL, the default theme background is used.

grid

Optional logical flag. If TRUE (default), grid lines are shown; if FALSE, they are removed.

zero_line

Optional logical flag. If TRUE (default), a vertical dashed line at 0 is added for reference.

y_axis_title

Optional title of the y-axis. If NULL, no y-axis label is added.

x_axis_title

Optional title of the x-axis. If NULL, no x-axis label is added.

...

Additional arguments passed to other methods.

Value

Invisibly returns the ggplot object. Called for its side effects (i.e., generating a plot).


sreg documentation built on Aug. 25, 2025, 5:14 p.m.