plotreg(l, file = NA, custom.model.names = NULL,
custom.coef.names = NULL, custom.note = NULL,
override.coef = 0, override.se = 0, override.pval = 0,
omit.coef = NA, reorder.coef = NULL, ci.level = 0.95,
use.se = FALSE, mfrow = TRUE, vertical.lines = TRUE,
cex = 2.5, lwd.inner = 7, lwd.outer = 5,
signif.light = "#fbc9b9", signif.medium = "#f7523a",
signif.dark = "#bd0017", insignif.light = "#c5dbe9",
insignif.medium = "#5a9ecc", insignif.dark = "#1c5ba6",
...)coefplot(labels, estimates, lower.inner = NULL,
upper.inner = NULL, lower.outer = NULL,
upper.outer = NULL, signif.outer = TRUE,
xlab = "Coefficients and confidence intervals",
main = "Coefficient plot", vertical.lines = TRUE,
cex = 2.5, lwd.inner = 7, lwd.outer = 5,
signif.light = "#fbc9b9", signif.medium = "#f7523a",
signif.dark = "#bd0017", insignif.light = "#c5dbe9",
insignif.medium = "#5a9ecc", insignif.dark = "#1c5ba6",
...)
l = list(model.1, model.2, ...)
. Different object types can also be mixed.pdf
, ps
, png
, bmp
model.names = c("My name 1", "My name 2")
etc. overrides the default behavior.plotreg
uses the coefficient names which are stored in the models. The custom.coef.names
argument can be used to replace them by other character strings in the order of appearance. For example, if a model shows a totaxlab
note below the diagram can be provided. If an empty character object is provided (custom.note = ""
), the note will be omitted completely.omit.coef = "group"
deletes all coefficient rows from the diagram where the name of the coefficient contains the character sequenreorder.coef = c(3, 2, 1)
will put t0.95
is used (i.e., an alpha value of 0.05).
l
argument, several plots are produced. If mfrow = TRUE
is set, multiple diagrams are aligned on the same page. If mfrow = FALSE
is set, each diagram per model comes out as asignif.outer = TRUE
, the outer CIs are used to evaluate significance, otherwise the inner CIs are used.coefplot
function produces coefficient plots (i.e., forest plots applied to point estimates and confidence intervals). It accepts raw data (the lower and upper bounds of inner and outer confidence intervals as well as the point estimates and their names) as input data. Significant coefficients and intervals can be plotted in a different color.The plotreg
function is a wrapper for the coefplot
function and works much like the
screenreg
, texreg
, and htmlreg
functions. It accepts a single or multiple statistical models as input and internally extracts the relevant data from the models. If confidence intervals are not defined in the extract method of a statistical model (see extract and extract-methods), the default standard errors are converted to confidence intervals. Most of the arguments work either like in the screenreg
, texreg
, and htmlreg
functions, or they work like in the coefplot
function.
texreg-package extract extract-methods texreg
#example from the 'lm' help file:
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2,10,20, labels = c("Ctl","Trt"))
weight <- c(ctl, trt)
lm.D9 <- lm(weight ~ group)
screenreg(lm.D9) # print model output to the R console
plotreg(lm.D9) # plot model output as a diagram
Run the code above in your browser using DataLab