CIplot | R Documentation |
"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.)
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,
...
)
obj |
The object to be plotted; can be a matrix of raw values or a model object |
... |
Additional arguments to |
labels |
Paramater labels |
sort |
Sort parameters by estimate? (default: true) |
xlim, pxlim |
x axis limits and breakpoints; see |
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 |
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 |
add |
Add to existing plot? |
setupOnly |
Create a new window for plot, but don't actually plot anything yet |
lwd |
As in |
replaceUnderscore |
Replace underscore with space in plotting label |
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.