Learn R Programming

api2lm (version 0.2)

plot.confint_adjust: Plot confint_adjust x

Description

Plot a confint_adjust x produced by the confint_adjust function. See Examples.

Usage

# S3 method for confint_adjust
plot(x, parm, mar = c(5.1, 7.1, 4.1, 2.1), line = mar[2] - 1, ...)

Value

None.

Arguments

x

An confint_adjust x produced by the confint_adjust function.

parm

a specification of which parameters are to be given confidence intervals, either a vector of numbers or a vector of names. If missing, all parameters are considered.

mar

A numerical vector of the form c(bottom, left, top, right) which gives the number of lines of margin to be specified on the four sides of the plot. The default is c(5, 7, 4, 2) + 0.1.

line

The MARgin line, starting at 0 counting outwards, to draw the y-axis label. The default is 1 unit less than mar[2].

...

Additional arguments passed to plot.

Author

Joshua P. French

Details

The plot function doesn't automatically adjust the margins to account for the label names. If you need more space for your labels, then increase the second element of mar from 7.1 upward and line upward. Alternatively, if you need less space, then you can decrease both of these values. Or you could use the autoplot function that automatically controls the spacing.

Examples

Run this code
fit <- lm(100/mpg ~ disp + hp + wt + am, data = mtcars)
# standard intervals
cia <- confint_adjust(fit)
plot(cia)
# plot subset of intervals
plot(cia, parm = c("hp", "disp"))
# adjust margin and line for better formatting
plot(cia, parm = 2:3, mar = c(5.1, 4.1, 4.1, 2.1))

Run the code above in your browser using DataLab