Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/binom.profile.R
Uses the profile likelihood on the observed proportion to construct confidence intervals.
1 2 | binom.profile(x, n, conf.level = 0.95, maxsteps = 50,
del = zmax/5, bayes = TRUE, plot = FALSE, ...)
|
x |
Vector of number of successes in the binomial experiment. |
n |
Vector of number of independent trials in the binomial experiment. |
conf.level |
The level of confidence to be used in the confidence interval. |
maxsteps |
The maximum number of steps to take in the profiles. |
del |
The size of the step to take |
bayes |
logical; if |
plot |
logical; if |
... |
ignored |
Confidence intervals are based on profiling the binomial deviance in the
neighbourhood of the MLE. If x == 0
or x == n
and
bayes
is 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
mode of f(p|x)
using Jeffrey's prior on p
. Typically, the
observed mean will not be inside the estimated confidence interval.
If bayes
is 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.
A data.frame
containing the observed
proportions and the lower and upper bounds of the confidence
interval.
Sundar Dorai-Raj (sdorairaj@gmail.com)
binom.confint
, binom.bayes
, binom.cloglog
,
binom.logit
, binom.probit
, binom.coverage
,
confint
in package MASS,
family
, glm
1 | binom.profile(x = 0:10, n = 10)
|
method x n mean lower upper
1 profile 0 10 0.0 0.000000000 0.2696942
2 profile 1 10 0.1 0.009711075 0.3716901
3 profile 2 10 0.2 0.037061505 0.4994521
4 profile 3 10 0.3 0.084926077 0.6064986
5 profile 4 10 0.4 0.145665487 0.7000114
6 profile 5 10 0.5 0.217625470 0.7823745
7 profile 6 10 0.6 0.299988593 0.8543345
8 profile 7 10 0.7 0.393501396 0.9150739
9 profile 8 10 0.8 0.500547902 0.9629385
10 profile 9 10 0.9 0.628309859 0.9902889
11 profile 10 10 1.0 0.730305791 1.0000000
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.