simScenPrevSensSpec {bootComb}R Documentation

Simulation scenario for adjusting a prevalence for sensitivity and specificity.

Description

This is a simulation to compute the coverage of the confidence interval returned by bootComb() in the case of adjusting a prevalence estimate for estimates of sensitivity and specificity.

Usage

simScenPrevSensSpec(
  B = 1000,
  p,
  sens,
  spec,
  nExp,
  nExpSens,
  nExpSpec,
  alpha = 0.05,
  assumeSensSpecExact = FALSE
)

Arguments

B

The number of simulations to run. Defaults to 1e3.

p

The true value of the prevalence parameter.

sens

The true value of the assay sensitivity parameter.

spec

The true value of the assay specificity parameter

nExp

The size of each simulated experiment to estimate p.

nExpSens

The size of each simulated experiment to estimate sens.

nExpSpec

The size of each simulated experiment to estimate spec.

alpha

The confidence level; i.e. the desired coverage is 1-alpha. Defaults to 0.05.

assumeSensSpecExact

Logical; indicates whether coverage should also be computed for the situation where sensitivity and specificity are assumed to be known exactly. Defaults to FALSE.

Value

A list with 2 or 4 elements, depending whether assumeSensSpecExact is set to FALSE or TRUE:

estimate

A single number, the proportion of simulations for which the confidence interval contained the true prevalence parameter value.

conf.int

A confidence interval of coverage 1-alpha for the coverage estimate.

estimate.sensSpecExact

Returned only if assumeSensSpecExact is set to TRUE. A single number, the proportion of simulations for which the confidence interval, derived assuming sensitivity and specificity are known exactly, contained the true prevalence parameter value.

conf.int.sensSpecExact

Returned only if assumeSensSpecExact is set to TRUE. A confidence interval of coverage 1-alpha for the coverage estimate in the scenario where sensitivity and specificity are assumed to be known exactly.

Examples


simScenPrevSensSpec(p=0.15,sens=0.85,spec=0.90,nExp=300,nExpSens=600,nExpSpec=400,B=100)
  # B value only for convenience here
  # Increase B to 1e3 or 1e4 (be aware this may run for some time).
 


[Package bootComb version 1.1.2 Index]