R/ci2num.R
ci2num.Rd
Estimate the number of events and denominator that contain roughly equivalent information to an estimate and uncertainty interval for a proportion, by interpreting the estimate and interval as a Beta posterior arising from a vague Beta(0.5,0.5) prior updated with the data consisting of that number and denominator.
ci2num(est, lower, upper, epsilon = 0.5, denom0 = 1000)
Point estimate
Lower 95% credible limit
Upper 95% credible limit
If any of lower
are zero, then they are replaced by the minimum of epsilon
and est/2
. Similarly values of 1 for upper
are replaced by the maximum of 1-epsilon
and (1+est)/2
.
Denominator to use as a default when the point estimate is exactly 0 or 1 (which is not compatible with the beta distribution). Should correspond to a guess of the population size used to produce the estimate,
which should be no greater than the actual population of the area, and usually less. Should be either a scalar, or a vector of the same length as est
(though note if it is a vector, then only the elements where est
is 1 or 0 get used).
A data frame with elements num
and denom
corresponding to the supplied estimate and limits.
Based on fitting a Beta distribution by least squares, using the method provided by the SHELF package.
Requires that the estimate and upper and lower limits are all distinct (except that est=0
is allowed and handled specially for convenience, see denom0
). Vectors of estimates and limits may be supplied.
Oakley (2020). SHELF: Tools to Support the Sheffield Elicitation Framework. R package version 1.7.0. https://CRAN.R-project.org/package=SHELF
est <- 3.00 / 100
upper <- 3.52 / 100
lower <- 2.60 / 100
ci2num(est, lower, upper)
#> num denom
#> 1 171 5708