Convert a proportion and credible interval to a numerator and denominator
Convert a proportion and credible interval to a numerator and denominator
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.
epsilon: 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.
denom0: 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).
Returns
A data frame with elements num and denom corresponding to the supplied estimate and limits.
Details
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.
Examples
est <-3.00/100upper <-3.52/100lower <-2.60/100ci2num(est, lower, upper)