x: An object of class margins , as returned by margins.
pos: A numeric vector specifying the x-positions of the estimates (or y-positions, if horizontal = TRUE).
which: A character vector specifying which marginal effect estimate to plot. Default is all.
labels: A character vector specifying the axis labels to use for the marginal effect estimates. Default is the variable names from x.
horizontal: A logical indicating whether to plot the estimates along the x-axis with vertical confidence intervals (the default), or along the y-axis with horizontal confidence intervals.
xlab: A character string specifying the x-axis (or y-axis, if horizontal = TRUE) label.
ylab: A character string specifying the y-axis (or x-axis, if horizontal = TRUE) label.
level: A numeric value between 0 and 1 indicating the confidence level to use when drawing error bars.
pch: The point symbol to use for plotting marginal effect point estimates. See points for details.
points.col: The point color to use for plotting marginal effect point estimates. See points for details.
points.bg: The point color to use for plotting marginal effect point estimates. See points for details.
las: An integer value specifying the orientation of the axis labels. See par for details.
cex: A numerical value giving the amount by which plotting text and symbols should be magnified relative to the default. See par for details.
lwd: A numerical value giving the width of error bars in points.
zeroline: A logical indicating whether to draw a line indicating zero. Default is TRUE.
zero.col: A character string indicating a color to use for the zero line if zeroline = TRUE.
...: Additional arguments passed to plot.default, such as title, etc.
Returns
The original margins object x, invisibly.
Details
This function is invoked for its side effect: a basic dot plot with error bars displaying marginal effects as generated by margins, in the style of Stata's marginsplot command.
Examples
## Not run: require("datasets") x <- lm(mpg ~ cyl * hp + wt, data = mtcars) mar <- margins(x) plot(mar)## End(Not run)