Package 'CIfinder'

Title: Estimate the Confidence Intervals for Predictive Values
Description: Computes confidence intervals for the positive predictive value (PPV) and negative predictive value (NPV) based on varied scenarios. In situations where the proportion of diseased subjects does not correspond to the disease prevalence (e.g. case-control studies), this package provides two types of solutions: 1) five methods for estimating confidence intervals for PPV and NPV via ratio of two binomial proportions including Gart & Nam (1988), Walter (1975), MOVER-J (Laud, 2017), Fieller (1954), and Bootstrap (Efron, 1979); 2) three direct methods that compute the confidence intervals including Pepe (2003), Zhou (2007), and Delta. In prospective studies where the proportion of diseased subjects is an unbiased estimate of the disease prevalence, this package provides several methods for calculating the confidence intervals for PPV and NPV including Clopper-Pearson, Wald, Wilson, Agresti-Coull, and Beta. See the Details and References sections in the corresponding functions.
Authors: Dadong Zhang <[email protected]>, Jingye Wang <[email protected]>, Suqin Cai <[email protected]>, Johan Surtihadi <[email protected]>
Maintainer: Dadong Zhang <[email protected]>
License: GPL (>= 3)
Version: 2.0.0
Built: 2024-11-09 06:27:36 UTC
Source: CRAN

Help Index


Estimate the confidence intervals for positive predictive value (PPV) and negative predictive value (NPV) based on different methods

Description

Estimate the confidence intervals for positive predictive value (PPV) and negative predictive value (NPV) based on different methods

Usage

ppv_npv_ci(
  x1,
  n1,
  x0,
  n0,
  prevalence,
  method = "gart and nam",
  conf.level = 0.95,
  bias_correction = FALSE,
  continuity.correction = FALSE,
  n_bootstraps = 1000,
  boot.type = "bca",
  ...
)

Arguments

x1

number of positives for both reference(true) marker and testing marker.

n1

number of positives for reference (true) marker.

x0

number of negatives for both reference(true) marker and testing marker.

n0

number of negatives for reference (true) marker.

prevalence

disease prevalence.

method

current support "gart and nam", "walter", "mover-j", "pepe", "zhou", "delta", "fieller", "bootstrap"; Default is "gart and nam"; Check the Details for additional information for each method.

conf.level

confidence level. default 0.95.

bias_correction

Logical, indicating whether to apply bias correction in the score denominator. default FALSE. This argument can be used only for 'gart and nam' method.

continuity.correction

logical. default FALSE. 0.5 will be applied if TRUE except the zhou's method where zα/222\frac{z_{\alpha/2}^2}{2} is used.

n_bootstraps

number of bootstraps for bootstrap method, default 1000

boot.type

A character string representing the type of intervals for bootstrap. The value should be any of the values c("bca", "norm", "perc"), default bca.

...

Other arguments passed on to method (e.g., defining the 'Beta(ai,bi)' prior distributions in mover-j method for each group (default 'ai = bi = 0.5' for Jeffreys method))

Details

Eight methods are supported in current version: "gart and nam", "walter", "mover-j", "pepe", "zhou", "delta", "fieller", and "bootstrap".

Among those, gart and nam, mover-j, walter, and fieller construct the confidence intervals for PPV and NPV by converting the confidence intervals for the ratio of two binomial proportions (ϕ=p1p0\phi=\frac{p_1}{p_0}) where ϕPPV=(1specificity)sensitivity\phi_{PPV}=\frac{(1-specificity)}{sensitivity} and ϕNPV=(1sensitivity)specificity\phi_{NPV}=\frac{(1-sensitivity)}{specificity}. The sensitivity is estimated by sensitivity=x1n1sensitivity=\frac{x_1}{n_1} and the specificity by specificity=x0n0specificity=\frac{x_0}{n_0}. The confidence intervals for ϕPPV\phi_{PPV} and ϕNPV\phi_{NPV} are converted to the corresponding confidence intervals for PPV and NPV using the following equations:

  • PPV=ρρ+(1ρ)ϕPPVPPV=\frac{\rho}{\rho+(1-\rho)*\phi_{PPV}}

  • NPV=1ρ(1ρ)+ρϕNPVNPV=\frac{1-\rho}{(1-\rho)+\rho*\phi_{NPV}}

    where ρ\rho denotes the prevalence.

  1. The gart and nam method constructs the confidence interval for ϕ\phi based on score method with skewness correction. See the details in the paper listed in the Reference section. This method can be applied to special situations where 'x1=n1' or 'x0=n0' but not for 'x1=0' and/or 'x0=0'. 'continuity.correction' can be considered where 'x1=0' and/or 'x0=0'.

  2. The mover-j method constructs the confidence interval for ϕ\phi from separate intervals for the individual group rates (i.e., p1p_1 and p0p_0). By applying the equal-tailed Jeffreys method (default 0.5 to each group), it may achieve a skewness-corrected interval for ϕ\phi.

  3. The walter method constructs the confidence interval for ϕ\phi based on log(ϕ)log(\phi). 0.5 is added to 'x1', 'x0', 'n1', and 'n0'. Thus, no continuity correct should be applied additionally. This method has shown skewness concerns for small ratios and sample sizes.

  4. The fieller method constructs the confidence interval for ϕ\phi by solving the roots of a quadratic equation, see the reference for details.

    The pepe, zhou, and delta are three direct confidence interval methods for PPV and NPV.

  5. The pepe method finds the confidence intervals for PPV and NPV via diagnostic likelihood ratios (DLR) and associated logit(PPV) and logit(NPV). This method is not applicable for special cases when 'x1=0', 'x0=0', 'x1=n1' or 'x0=n0'. Continuity correction should be considered for those special cases.

  6. The zhou method can return confidence intervals from the four methods described in the paper. Without continuity correction, it will return the confidence intervals for PPV and NPV based on standard delta method and based on logit transformed method. If continuity.correction=TRUE, zα/222\frac{z_{\alpha/2}^2}{2} will be added to 'x1', 'x0', 'n1', and 'n0', and the function will return the adjusted and adjusted logit confidence intervals as described in the paper.

  7. The delta method constructs the confidence intervals based on the Wald-type formulation. The estimates and variances of PPV and NPV are calculated based equations described in the Zhou's paper listed in the Reference section.

  8. The boot method constructs the confidence intervals based on bootstrap method.

Value

A list object contains the method and the estimates of sensitivity, specificity, PPV, NPV and their confidence intervals.

References

  1. Gart JJ, Nam J (1988). “Approximate Interval Estimation of the Ratio of Binomial Parameters: A Review and Corrections for Skewness.” Biometrics, 44(2), 323-338.

  2. Mercaldo ND, Lau KF, Zhou XH (2007). “Confidence intervals for predictive values with an emphasis to case-control studies.” Statistics in Medicine, 26, 2170-2183.

  3. Laud PJ (2017). “Equal-tailed confidence intervals for comparison of rates.” Pharmaceutical Statistics, 16(5), 334-348.

  4. Pepe MS (2003). The Statistical Evaluation of Medical Tests for Classification and Prediction. Oxford University Press, New York.

  5. Fieller EC (1954). “Some problems in interval estimation.” Journal of the Royal Statistical Society: Series B (Methodological), 16(2), 175-185.

Examples

ppv_npv_ci(60, 65, 113, 113, prevalence = 0.02)

Compute the confidence interval for a single proportion based on different methods

Description

Compute the confidence interval for a single proportion based on different methods

Usage

single_prop_ci(
  x,
  n,
  method = "all",
  alternative = "two.sided",
  conf.level = 0.95,
  prior = c(1, 1)
)

Arguments

x

number of successes

n

number of trials

method

one of these options "all", "clopper.pearson", "wald", "wislon", "wislon.correct", "agresti", or "beta"

alternative

indicates "two.sided", "one.sided"

conf.level

confidence level

prior

the prior values for "beta" method

Value

Estimated confidence intervals for the probability of success

Examples

single_prop_ci(53, 57, method = "all")