Visualizes confidence intervals returned by simultaneous_ci() using base R graphics.
Estimates are shown as points with corresponding CI segments, grouped and labeled by
model and coefficient name. Supports customization for log scale, character sizes,
label trimming, and reference lines.
# S3 method for simultaneous_ci_result
plot(
x,
y = NULL,
subset_pars = NULL,
log.scale = FALSE,
cex = 0.8,
cex.labels = 0.8,
las.labels = 1,
pch = 16,
col.estimate = "blue",
col.ci = "darkgray",
col.ref = "red",
ref.line.pos = 0,
lty.ref = 2,
main = "Simultaneous Confidence Intervals",
xlab = NULL,
label.trim = NULL,
...
)Invisibly returns a list:
ycoords: Named vector of y-axis positions for each label
xlim: Range of x-axis limits used
ylim: Range of y-axis limits used
If no valid intervals are available for plotting, returns invisible(NULL).
An object of class simultaneous_ci_result, typically returned by simultaneous_ci().
Ignored.
Optional character vector. Coefficient names to subset the plot. Default: all.
Logical. Plot on logarithmic scale. Intervals crossing 0 or with nonpositive bounds are excluded.
Point size for estimates. Default = 0.8.
Label size for y-axis. Default = 0.8.
Orientation of y-axis labels (0, 1, 2, or 3). Default = 1.
Plot character for point estimates. Default = 16.
Color of point estimates. Default = "blue".
Color of confidence interval lines. Default = "darkgray".
Color of reference line(s). Default = "red".
Position(s) for vertical reference line(s). Default = 0. Set to NULL to omit.
Line type for reference lines. Default = 2 (dashed).
Plot title. Default = "Simultaneous Confidence Intervals".
X-axis label. If NULL and log.scale = TRUE, label defaults to "Log Estimate".
Integer. Trims long coefficient labels to this width (adds "..."). Optional.
Additional arguments passed for future use (currently ignored).
set.seed(1)
X <- matrix(rnorm(100*2), 100, 2, dimnames = list(NULL, c("X1", "X2")))
y <- 1 + X[,1] - X[,2] + rnorm(100)
res <- simultaneous_ci(X, y, list(mod = 1:3), B = 100, add_intercept = TRUE)
plot(res)
Run the code above in your browser using DataLab