adjPrevSensSpecCI {bootComb} | R Documentation |
This function takes as input a prevalence confidence interval, a sensitivity confidence interval and a specificity confidence interval and returns a confidence interval with the desired coverage of the adjusted prevalence. Optionally the point estimates of prevalence, sensitivity and specificity can also be specified and, if so, these will be returned together with the confidence interval.
adjPrevSensSpecCI( prevCI, sensCI, specCI, N = 1e+06, method = "hdi", alpha = 0.05, doPlot = FALSE, prev = NULL, sens = NULL, spec = NULL, ylim = NULL )
prevCI |
A vector of length 2 giving the lower and upper bounds of the confidence interval for the prevalence estimate. |
sensCI |
A vector of length 2 giving the lower and upper bounds of the confidence interval for the assay sensitivity estimate. |
specCI |
A vector of length 2 giving the lower and upper bounds of the confidence interval for the assay specificity estimate. |
N |
A (large) integer giving the number of parametric bootstrap samples to take. Defaults to 1e6. |
method |
The method uses to derive a confidence interval from the empirical distribution of the combined parameter. Needs to be one of 'hdi' (default; computes the highest density interval) or 'quantile (uses quantiles to derive the confidence interval). |
alpha |
The desired confidence level; i.e. the returned confidence interval will have coverage 1-alpha. |
doPlot |
Logical; indicates whether a graph should be produced showing the input estimated distributions for the prevalence, sensitivity and specificity estimates and the resulting empirical distribution of the adjusted prevalence together with the reported confidence interval. Defaults to FALSE. |
prev |
Optional; if not NULL, and parameters |
sens |
Optional; if not NULL, and parameters |
spec |
Optional; if not NULL, and parameters |
ylim |
Optional; a vector of length 2, giving the vertical limits for the top panel of the produced plot. Only used if |
A list object with 2 elements:
estimate |
The adjusted prevalence point estimate (only non-NULL if |
conf.int |
The confidence interval for the adjusted prevalence. |
bootComb
, adjPrevSensSpec
, identifyBetaPars
, dbeta
, hdi
adjPrevSensSpecCI( prevCI=binom.test(x=84,n=500)$conf.int, sensCI=binom.test(x=238,n=270)$conf.int, specCI=binom.test(x=82,n=88)$conf.int, doPlot=TRUE, prev=84/500, sens=238/270, spec=82/88)