Description Usage Arguments Details Value Author(s) References See Also Examples
Determines the expected length for a binomial confidence interval.
1 | binom.length(p, n, conf.level = 0.95, method = "all", ...)
|
p |
The (true) probability of success in a 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. |
method |
Either a character string to be passed to
|
... |
Additional parameters to be passed to
|
Derivations are based on the results given in the references. Methods
whose length probabilities are consistently closer to 0.95 are more
desireable. Thus, Wilson's, logit, and cloglog appear to be good for
this sample size, while Jeffreys, asymptotic, and prop.test are
poor. Jeffreys is a variation of Bayes using prior shape parameters of
0.5 and having equal probabilities in the tail. The Jeffreys'
equal-tailed interval was created using binom.bayes using (0.5,0.5) as
the prior shape parameters and type = "central"
.
A data.frame
containing the "method"
used, "n"
, "p"
,
and the average length, L(p,n)
.
Sundar Dorai-Raj (sdorairaj@gmail.com)
L.D. Brown, T.T. Cai and A. DasGupta (2001), Interval estimation for a binomial proportion (with discussion), Statistical Science, 16:101-133.
L.D. Brown, T.T. Cai and A. DasGupta (2002), Confidence Intervals for a Binomial Proportion and Asymptotic Expansions, Annals of Statistics, 30:160-201.
1 | binom.length(p = 0.5, n = 50)
|
method n p length
1 agresti-coull 50 0.5 0.2647754
2 asymptotic 50 0.5 0.2743657
3 bayes 50 0.5 0.2678533
4 cloglog 50 0.5 0.2701117
5 exact 50 0.5 0.2867770
6 logit 50 0.5 0.2678187
7 probit 50 0.5 0.2690582
8 profile 50 0.5 0.2692184
9 lrt 50 0.5 0.2692274
10 prop.test 50 0.5 0.2810356
11 wilson 50 0.5 0.2645934
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.