JuliaStats / HypothesisTests.jl

Hypothesis tests for Julia
Other
292 stars 87 forks source link

Lower and upper limits of CI for proportion #295

Closed PharmCat closed 1 year ago

PharmCat commented 1 year ago

Should lower limit be min(0, val) and upper max(val, 1)?

for example:

confint(HypothesisTests.BinomialTest(0, 5), method = :agresti_coull)

Result

(**-**0.05457239484968546, 0.4890548596328611)
PharmCat commented 1 year ago

😊 @simonster , @andreasnoack , @palday , @nalimilan any considerations please 🙏

ararslan commented 1 year ago

Seems reasonable to me to clamp the endpoints to 0 and 1. As a data point, BinomCI from the R package DescTools seems to do this:

> library("DescTools")
> BinomCI(0, 5, method="agresti-coull")
           est lwr.ci    upr.ci
[1,] 0.2172412      0 0.4890549