You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
We were looking into why RBesT CI's for proportions using Clopper-Pearson method doesn't give an exact match to the Hmisc package. We discovered that you are using a slightly different formulae as hopefully we've described here correctly. https://psiaims.github.io/CAMIS/R/ci_for_prop.html. Is this method supported anywhere by published methods ? Could you give rationale as to why you implemented it this way?
Here is how we expalined what you've done, but please do let me know if it's incorrect. Thanks !
The {RBesT} package produces CIs using the Clopper-Pearson method. In this example (x=36 and n=154), the results match the cardx package. However, as described below, there are 2 cases where the results using RBesT package do not match cardx or Hmisc.
x = 0 (0% responders), in which case the lower limit does not match.
x = n (100% responders), in which case the upper limit does not match.
Because of the relationship between the binomial distirbution and the beta distribution. This package uses quantiles of the beta distribution to derive exact confidence intervals.
RBesT equations are:
pLow <- qbeta(Low, r + (r == 0), n - r + 1)
pHigh <- qbeta(High, r + 1, n - r + ((n - r) == 0))
If the equations were updated as follows then it would match Hmisc intervals:
pLow <- qbeta(Low, r, n - r + 1)
pHigh <- qbeta(High, r + 1, n - r)
The text was updated successfully, but these errors were encountered:
Again many thanks for the report here. The problem is now fixed on my local development version and a fix (as you suggest) will be included in the next release early 2025. I leave the issue open until the release is out.
Hi,
We were looking into why RBesT CI's for proportions using Clopper-Pearson method doesn't give an exact match to the Hmisc package. We discovered that you are using a slightly different formulae as hopefully we've described here correctly. https://psiaims.github.io/CAMIS/R/ci_for_prop.html. Is this method supported anywhere by published methods ? Could you give rationale as to why you implemented it this way?
Here is how we expalined what you've done, but please do let me know if it's incorrect. Thanks !
The {RBesT} package produces CIs using the Clopper-Pearson method. In this example (x=36 and n=154), the results match the cardx package. However, as described below, there are 2 cases where the results using RBesT package do not match cardx or Hmisc.
x = 0 (0% responders), in which case the lower limit does not match.
x = n (100% responders), in which case the upper limit does not match.
Because of the relationship between the binomial distirbution and the beta distribution. This package uses quantiles of the beta distribution to derive exact confidence intervals.
RBesT equations are:
pLow <- qbeta(Low, r + (r == 0), n - r + 1)
pHigh <- qbeta(High, r + 1, n - r + ((n - r) == 0))
If the equations were updated as follows then it would match Hmisc intervals:
pLow <- qbeta(Low, r, n - r + 1)
pHigh <- qbeta(High, r + 1, n - r)
The text was updated successfully, but these errors were encountered: