CIplot: Plot confidence intervals (NEEDS DOCUMENTATION)

View source: R/CIplot.R

CIplotR Documentation

Plot confidence intervals (NEEDS DOCUMENTATION)

Description

"Forest plot"-style plotting of confidence intervals from a regression model. Basic input is a matrix with columns of estimate/lower/upper, along with an optional 4th column for the p-value. Also works with a variety of models (lm/glm/coxph/etc.)

Usage

CIplot(obj, ...)

## S3 method for class 'matrix'
CIplot(
  obj,
  labels = rownames(B),
  sort = TRUE,
  pxlim,
  xlim,
  ylim,
  sub,
  diff = (ncol(B) == 4),
  null = 0,
  n.ticks = 6,
  mar,
  axis = !add,
  trans,
  p.label = FALSE,
  xlab = "",
  ylab = "",
  add = FALSE,
  setupOnly = FALSE,
  lwd = 2,
  replaceUnderscore = TRUE,
  ...
)

Arguments

obj

The object to be plotted; can be a matrix of raw values or a model object

...

Additional arguments to plot()

labels

Paramater labels

sort

Sort parameters by estimate? (default: true)

xlim, pxlim

x axis limits and breakpoints; see pretty()

ylim

y axis limits (default: c(0.5, n+0.5), where n is number of params)

sub

Text to be written at top of plot

diff

Include tests of difference / p-values?

null

Draw a line representing no effect at this value (default: 0)

n.ticks

Number of ticks on x-axis

mar

As in par()

axis

Create an x axis?

trans

Function to transform parameter space

p.label

Label p-values (p=0.02 instead of just 0.02)? (default: FALSE)

xlab, ylab

As in plot()

add

Add to existing plot?

setupOnly

Create a new window for plot, but don't actually plot anything yet

lwd

As in lines()

replaceUnderscore

Replace underscore with space in plotting label

Examples

# Supplying a matrix
B <- cbind(1:3, 0:2, 2:4)
rownames(B) <- LETTERS[1:3]
CIplot(B)

# Supplying a fitted model object
fit <- lm(Ozone ~ Solar.R + Wind + Temp, airquality)
CIplot(fit)

# Options


pbreheny/hdrm documentation built on Jan. 17, 2024, 8:53 p.m.