ratesci 1.1.1
New features
rdci()now includes the Brown-Li ‘Jeffreys’ method for binomial RD (noted to be a superior non-iterative method in Laud & Dane 2014).orpairci()now includes a second version of the transformed SCAS method, omitting the ‘N-1’ adjustment. (The adjusted version previously labelled ‘Transformed SCASp’ in the output is now labelled ‘Transformed SCAS(N-1)’).orpairci()now includes the Transformed Blaker method, produced whenccisTRUE.
Bug fixes
scoreci()andscasci()have improved computation of quadratic solution for the skewness-corrected score, avoiding spurious results observed in 0.13% of a simulation exercise (#38, thanks to Vincent Jaquet for reporting the issue and proposed solution).orpairci(),rrpairci()andrdpairci()have fixed special cases to avoid warnings due to negative variance estimate or intervals output as NaN.orci()now fixed to give CIs for OR instead of RR, and fixed handling of special cases.
ratesci 1.1.0 (2026-06-28)
CRAN release: 2026-07-02
New features
- New functions
rdci(),rrci()andorci()give a selection of confidence intervals for each contrast for 2 independent binomial or Poisson rates. - New functions
rdpairci(),rrpairci()andorpairci()give a selection of confidence intervals for each contrast for 2 paired binomial proportions. - New separate dedicated functions
scorepairci()andmoverpairci()for the score and MOVER methods, respectively, for paired contrasts, mirroringscoreci()andmoverci()for independent contrasts. - Note the above new functions for paired contrasts replace
pairbinci(), which is deprecated.
In rateci():
- New default point estimate is the “common sense” crude estimate
x / n, instead of an estimate that is consistent with a 0% CI.std_estallows the user to choose. (#32, thanks to Chelsea Dickens for raising the issue.) - New output object containing several confidence interval methods in an array format, including the inferior Wald, Wilson and Agresti-Coull methods (for reference, not recommended), plus an alternative formulation of the Clopper-Pearson or mid-p interval based on Beta or Gamma distributions (for comparison with the version based on binomial/Poisson tail probabilities). These match Clopper-Pearson and Garwood precisely when
ccisTRUE, and approximately match the corresponding mid-p intervals whenccisFALSE. - New output object for the Blaker exact method (for both binomial and Poisson rates).
-
precisfor setting the precision of the exact and mid-p method.
Lifecycle changes
Newly deprecated
-
pairbinci()is soft-deprecated, and is replaced byscorepairci()for score methods,moverpairci()for MOVER methods, andrdpairci(),rrpairciandorpairci()for other methods.
Bug fixes
In rateci() and moverci():
- Permit n=0 to produce output interval as [0, 1] for binomial, or [0, Inf] for Poisson with point estimate displayed as NaN. (prevents error for Bonett-Price method in
rdpairci()with no discordant pairs).
ratesci 1.0.0 (2025-06-20)
CRAN release: 2025-06-20
New features
- New function
clusterpci()for CI and test for a single binomial proportion from clustered data. - Example datasets are now included.
- Improved documentation with pkgdown website & vignettes.
In pairbinci():
-
skewfor skewness correction. -
bcffor variance bias correction. - Default paired RD and RR method changed to new SCAS method (i.e. including skewness correction - manuscript under review).
-
method_RD,method_RRandmethod_ORare replaced withmethod. - Bonett-Price methods for RD and RR (including proposed Jeffreys variant option for RR).
- TDAS method is deprecated.
- Default for MOVER method changed to Jeffreys.
- MOVER calculations now use x/N as point estimate instead of median from the Beta distribution.
-
ccuses a new form of correction for RR giving equivariant intervals. Also allows consistency with the continuity-corrected McNemar test (or an intermediate correction of the user’s choosing).cctypeis deprecated. - Default conditional odds ratio method changed to SCASp (with closed-form calculation).
- Output object now includes estimates of p1, p2, phi (correlation) and psi (odds ratio used by Fagerland et al).
- Output object now includes function call.
In scaspci():
-
bcfoption now implemented for contrast = “p” (default = FALSE). -
bignallows a different sample size to be used in the bias correction (used within transformed SCASp method for paired OR inpairbinci, for consistency with ‘N-1’ test).
In scoreci():
-
bcfoption now implemented for contrast = “p” (default = FALSE). - (Note adjusted sample size for bias correction can be achieved by including a non-zero value for n2.)
- ORbias, RRtang, and MNtol arguments renamed as or_bias, rr_tang and mn_tol.
- Implementation of
precisargument is improved for RR and OR contrasts. - For contrast = “RD”, weighting = “Tang” provides optimal test if RR is constant across strata.
ratesci 0.5.0 (2025-01-10)
CRAN release: 2025-01-10
New features
In pairbinci():
-
cccontinuity correction is now available for all methods for all contrasts. -
cctypecontrols the type of correction to apply forcontrast= “RR”. - New default
method_RD= “Score_closed” for non-iterative calculation of the Tango score interval forcontrast= “RD”. Thanks to Tony Yang for permission to use the code in his 2013 paper. - New default
method_RR= “Score_closed” for non-iterative calculation of the Tang score interval forcontrast= “RR”. Thanks to Guogen Shan for contributing code via email. - Added paired MOVER methods with
method_RD= “MOVER” andmethod_RR= “MOVER”. Also “MOVER_newc” incorporates Newcombe’s correlation correction. - Added
moverbase, for specifying different versions of the MOVER methods (Wilson, Jeffreys, midp or SCAS). - Added “jeff” and “wilson”
method_ORoptions for transformed binomial methods for OR. - Confirmed and documented that the 2-sided significance test is equivalent to the McNemar test (with or without continuity correction).
Bug fixes
In moverci():
- Corrected calculation of score intervals for single Poisson rate, using Rao score interval.
- Same correction affects MOVER method for comparison of Poisson rates [i.e.
moverci()withdistrib= “poi” andtype= “wilson”]
ratesci 0.4-0 (2021-12-04)
CRAN release: 2021-12-05
New features
In scoreci():
- MN weighting now iterates to convergence (@jonjvallejo, #20).
- Added optional prediction interval for random effects method (also in
tdasci()). - Added xlim and ylim arguments to control plot output.
- Added sda & fda arguments for optional sparse/full data adjustment when x1 + x2 = 0 or x1 + x2 = n1 + n2 in a stratum.
- Added INV option for weights that omit the variance bias correction.
- Added RRtang argument to apply Tang’s alternative score for RR (recommended for stratified analysis with INV/IVS weights. Experimental for Poisson RR).
Stheta = (p1hat - p2hat * theta) / p2d(see Tang 2020) - Added simplified skewness correction option (causes p-values to be omitted, see Tang 2021 & Laud 2021).
- Introduced warning and plot features for very rare occasions when quadratic skewness correction cannot be calculated due to a negative discriminant.
- p-value suppressed where affected by negative discriminants.
- Changed ORbias default to TRUE (see Laud 2018).
- Changed weighting default to MH for RD & RR, INV for OR (for consistency with CMH test).
- Added hetplot argument to separate heterogeneity plots from score function plot.
- Uninformative strata are now retained in the analysis except if:
- contrast = OR with MH weighting;
- contrast = RR with IVS/INV weighting if RRtang = FALSE;
- random = TRUE (needs further evaluation);
- excluded using new option dropzeros = TRUE.
Bug fixes
- MN weighting in
scoreci()corrected for distrib=“poi”. - Fixed bug in
scoreci()for calculation of stratum CIs with random=TRUE. - Fixed bug in
scoreci()for distrib = “poi” and contrast = “p” (#7). - Fixed finite precision bug in
scaspci(). - Fixed bug in
rateci()for closed-form calculation of continuity-corrected SCAS. - Fixed bug in
scoreci()for stratified zero scores calculated as NA, resulting in UL = 0. (Thanks to Lidia Mukina for reporting the bug.) - Fixed variable plot ranges for vectorised inputs.
ratesci 0.3-0 (2018-02-15)
CRAN release: 2018-02-15
New features
- Added bias correction in
scoreci()for OR SCAS method (derived from Gart 1985). - Added score methods (Tango & Tang) as default for paired binomial RD and RR in
pairbinci(). - Added transformed mid-p method for paired OR for comparison with transformed SCAS.
- Added
scaspci()for non-iterative SCAS methods for single binomial or Poisson rate. - Added
rateci()for selected methods for single binomial or Poisson rate.
Bug fixes
- Fixed bug in
pairbinci()for contrast=“OR”. - Fixed bug in
moverci()for contrast=“p” and type=“wilson”. - Corrected error in cc for stratified SCAS method for OR.
- Clarified documentation regarding continuity corrections.
- Set Stheta to 0 if |Stheta|<cc in
scoreci() - Fixed stratified calulations for contrast = “p” in
scoreci().
ratesci 0.2-0 (2017-04-21)
CRAN release: 2017-04-21
New features
- Added
pairbinci()for all comparisons of paired binomial rates. - Added option to suppress warnings in scoreci.
- Added Galbraith plot (for assessing stratum heterogeneity) to
scoreci(). - Added qualitative interaction test to
scoreci(). - Added stratum estimates & CIs to
scoreci()output when stratified = TRUE.
Bug fixes
- Fixed bug for contrast = “p” in
moverci(). - Fixed bug in
tdasci()wrapper function. - Fixed bug for stratified OR.
- Altered adjustment options for boundary cases in
moverci(). - Changed point estimate used in
moverci()to posterior median for type = “jeff”, to ensure consistent calculations with informative priors.
