R: Coverage plots for binomial confidence intervals
binom.plot
R Documentation
Coverage plots for binomial confidence intervals
Description
Constructs coverage plots for binomial confidence intervals.
Usage
binom.plot(n, method = binom.lrt, np = 500,
conf.level = 0.95, actual = conf.level,
type = c("xyplot", "levelplot"),
tol = .Machine$double.eps^0.5, ...)
Arguments
n
The number of independent trials in the binomial experiment.
conf.level
The level of confidence to be used in the confidence
interval.
np
Number of points to use in the plot.
method
The method used to estimate the confidence interval.
actual
The actual confidence interval used in the confidence
interval. See Details.
type
See Details.
tol
The minimum probability of success to use in the plot.
...
Additional arguments to pass to
panel.xyplot or panel.levelplot.
Details
If type is "xyplot", a line plot is created with
coverage on the y-axis and binomial probability on the x-axis.
A separate panel for every n is provided. If actual is
provided then a horizontal reference line is added to the plot. This
is only useful when actual is different from conf.level,
as is the case when calling binom.optim.
If type is "levelplot", a image plot is created with
x = 0 to n on the vertical axis and binomial
probability on the horizontal axis. Each row in the plot will be the
confidence level for a given x. The color of the confidence
interval is determined by the coverage probability. The argument
n must only be of length one. If not, only the first n
will be used and a warning is issued.
In either plot type, the number of points at which the coverage
probability is determined is specified by np. Increasing
np gives a finer granularity but performance will suffer.
Value
An object of class trellis.
Author(s)
Sundar Dorai-Raj (sdorairaj@gmail.com)
See Also
binom.confint, binom.optim,
xyplot, levelplot
Examples
binom.plot(5, type = "levelplot")
binom.plot(c(3, 5, 10, 25), type = "xyplot")