adjPrevSensSpecCI {bootComb}R Documentation

Adjust a prevalence point estimate and confidence interval for a given assay sensitivity and specificity (also known only imprecisely).

Description

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.

Usage

adjPrevSensSpecCI(
  prevCI,
  sensCI,
  specCI,
  N = 1e+06,
  method = "hdi",
  alpha = 0.05,
  doPlot = FALSE,
  prev = NULL,
  sens = NULL,
  spec = NULL,
  ylim = NULL
)

Arguments

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 and spec are also not NULL, then an adjusted point estimate will also be calculated.

sens

Optional; if not NULL, and parameters prev and spec are also not NULL, then an adjusted point estimate will also be calculated.

spec

Optional; if not NULL, and parameters prev and sens are also not NULL, then an adjusted point estimate will also be calculated.

ylim

Optional; a vector of length 2, giving the vertical limits for the top panel of the produced plot. Only used if doPlot is set to TRUE.

Value

A list object with 2 elements:

estimate

The adjusted prevalence point estimate (only non-NULL if prev, sens and spec are specified).

conf.int

The confidence interval for the adjusted prevalence.

See Also

bootComb, adjPrevSensSpec, identifyBetaPars, dbeta, hdi

Examples

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)


[Package bootComb version 1.0.1 Index]