Constructs coverage plots for binomial confidence intervals.
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, ...)
The number of independent trials in the binomial experiment.
The level of confidence to be used in the confidence interval.
Number of points to use in the plot.
The method used to estimate the confidence interval.
The actual confidence interval used in the confidence interval. See Details.
See Details.
The minimum probability of success to use in the plot.
Additional arguments to pass to
panel.xyplot
or panel.levelplot
.
An object of class trellis
.
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.
# NOT RUN {
binom.plot(5, type = "levelplot")
binom.plot(c(3, 5, 10, 25), type = "xyplot")
# }
Run the code above in your browser using DataLab