Binomial confidence intervals using the profile likelihood
Uses the profile likelihood on the observed proportion to construct confidence intervals.
binom.profile(x, n, conf.level = 0.95, maxsteps = 50, del = zmax/5, bayes = TRUE, plot = FALSE, ...)
- Vector of number of successes in the binomial experiment.
- Vector of number of independent trials in the binomial experiment.
- The level of confidence to be used in the confidence interval.
- The maximum number of steps to take in the profiles.
- The size of the step to take
- logical; if
TRUEuse a Bayesian correction at the edges.
- logical; if
TRUEplot the profile with a
Confidence intervals are based on profiling the binomial deviance in the
neighbourhood of the MLE. If
x == 0 or
x == n and
TRUE, then a Bayesian adjustment is made to move
the log-likelihood function away from
Inf. Specifically, these
values are replaced by
(x + 0.5)/(n + 1), which is the posterier
f(p|x) using Jeffrey's prior on
p. Typically, the
observed mean will not be inside the estimated confidence interval.
FALSE, then the Clopper-Pearson exact method
is used on the endpoints. This tends to make confidence intervals at the
end too conservative, though the observed mean is guaranteed to be
within the estimated confidence limits.
data.framecontaining the observed proportions and the lower and upper bounds of the confidence interval.
binom.profile(x = 0:10, n = 10)