the prevalence package
tools for prevalence assessment studies.

Specifying distributions


The prevalence package allows different ways of specifying the priors and external information used in the true prevalence estimation models. To see how these distributions need to be passed on to the different truePrev functions, see the documentation for truePrev, truePrevPools, truePrevMulti and truePrevMulti2.

Available distributions

In general, five distributions are available:

Fixed This is actually not a (probabilistic) distribution, but just means that you specify a certain parameter as a single, fixed value. In other words, you do not assign any uncertainty to that parameter.
Uniform A Uniform distribution gives equal weight or likelihood to each value between a certain minimum and maximum. Values outside of that range get a likelihood of zero. A Uniform(0,1) distribution would mean that each value in between zero and one is equally likely, and is a common uniformative prior for the true prevalence. Find out more on Wikipedia.
Beta-PERT A PERT distribution is a synthetic distribution, representing the uncertainty in a parameter defined by a minimum, a maximum, and a most likely value. Function betaPERT can be used to generate the parameters of a PERT distribution from expert opinion on the minimum, maximum, and most likely value.
Beta A Beta distribution is characterized by two parameters, denoted alpha and beta (or shape1 and shape2 in R). As it is bounded by (0,1), it is a common distribution for modelling the uncertainty in proportions, such as prevalence, sensitivity and specificity. Find out more on Wikipedia.
Beta-Expert The beta-expert distribution in the prevalence package provides an alternative way of specifying a Beta distribution. Function betaExpert fits a Beta distribution to expert opinion on a best guess estimate (which can be the mean or the mode), and additional information on a lower bound, an upper bound, or both.

These distributions can be specified in two ways, i.e., using a named list and using so-called BUGS-notation.

Specification 1: named list

Distribution parameters can be specified in a named list() as follows:

Fixed list(dist = "fixed", par)

Uniform list(dist = "uniform", min, max)

Beta-PERT

list(dist = "pert", method, a, m, b, k)

  • method must be "classic" or "vose"
  • a denotes the pessimistic (minimum) estimate
  • m denotes the most likely estimate
  • b denotes the optimistic (maximum) estimate
  • k denotes the scale parameter

See betaPERT for more information on Beta-PERT parametrization.

Beta list(dist = "beta", alpha, beta)

Beta-Expert

list(dist = "beta-expert", mode, mean, lower, upper, p)

  • mode denotes the most likely estimate
  • mean denotes the mean estimate
  • only mode or mean should be specified
  • lower denotes the lower bound
  • upper denotes the upper bound
  • lower and upper can be specified together or alone
  • p denotes the confidence level of the expert
See betaExpert for more information on Beta-Expert parametrization.

Specfication 2: BUGS style

For Uniform, Beta-PERT and Beta distributions, BUGS-style short-hand notation is also allowed:

Uniform ~dunif(min, max)
Beta-PERT ~dpert(min, mode, max)
Beta ~dbeta(alpha, beta)