sensspec: Sample size and precision of sensitivity and specificity

Description Usage Arguments Details Value Note See Also Examples

Description

Because sensitivity and specificity are simple proportions, these functions act as wrappers for prec_prop.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
prec_sens(
  sens,
  n = NULL,
  ntot = NULL,
  prev = NULL,
  conf.width = NULL,
  round = "ceiling",
  ...
)

prec_spec(
  spec,
  n = NULL,
  ntot = NULL,
  prev = NULL,
  conf.width = NULL,
  round = "ceiling",
  ...
)

Arguments

sens, spec

proportions.

n

number of observations.

ntot

total sample size.

prev

prevalence of cases/disease (i.e. proportion of ntot with the disease).

conf.width

precision (the full width of the confidence interval).

round

string, round calculated n up (ceiling) or down (floor).

...

options passed to prec_prop (e.g. method, conf.width, conf.level).

Details

If ntot and prev are given, they are used to calculate n.

Value

Object of class "presize", a list of arguments (including the computed one) augmented with method and note elements.

Note

Calculated n can take on non-integer numbers, but prec_prop requires integers, so the calculated n is rounded according to the approach indicated in round.

See Also

prec_prop

Examples

1
2
3
4
5
6
  # confidence interval width with n
  prec_sens(.6, 50)
  # confidence interval width with ntot and prevalence (assuming 50% prev)
  prec_sens(.6, ntot = 100, prev = .5)
  # sample size with confidence interval width
  prec_sens(.6, conf.width = 0.262)

presize documentation built on April 9, 2021, 1:05 a.m.