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 |
Estimate the confidence intervals for positive predictive value (PPV) and negative predictive value (NPV) based on different methods
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", ... )
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", ... )
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 |
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 |
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)) |
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 () where
and
.
The sensitivity is estimated by
and the specificity by
. The confidence intervals for
and
are converted to the corresponding confidence intervals for PPV and NPV using the following equations:
where denotes the
prevalence
.
The gart and nam method constructs the confidence interval for 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'.
The mover-j method constructs the confidence interval for from separate intervals for the individual group rates (i.e.,
and
).
By applying the equal-tailed Jeffreys method (default 0.5 to each group), it may achieve a skewness-corrected interval for
.
The walter method constructs the confidence interval for based on
. 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.
The fieller method constructs the confidence interval for 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.
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.
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
, 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.
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.
The boot method constructs the confidence intervals based on bootstrap method.
A list object contains the method and the estimates of sensitivity, specificity, PPV, NPV and their confidence intervals.
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.
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.
Laud PJ (2017). “Equal-tailed confidence intervals for comparison of rates.” Pharmaceutical Statistics, 16(5), 334-348.
Pepe MS (2003). The Statistical Evaluation of Medical Tests for Classification and Prediction. Oxford University Press, New York.
Fieller EC (1954). “Some problems in interval estimation.” Journal of the Royal Statistical Society: Series B (Methodological), 16(2), 175-185.
ppv_npv_ci(60, 65, 113, 113, prevalence = 0.02)
ppv_npv_ci(60, 65, 113, 113, prevalence = 0.02)
Compute the confidence interval for a single proportion based on different methods
single_prop_ci( x, n, method = "all", alternative = "two.sided", conf.level = 0.95, prior = c(1, 1) )
single_prop_ci( x, n, method = "all", alternative = "two.sided", conf.level = 0.95, prior = c(1, 1) )
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 |
Estimated confidence intervals for the probability of success
single_prop_ci(53, 57, method = "all")
single_prop_ci(53, 57, method = "all")