Class "prev"

Share:

Description

The "prev" class represents output from Bayesian true prevalence estimation models.

Objects from the Class

Objects of class "prev" are created by truePrev, truePrevMulti, truePrevMulti2 and truePrevPools.

Slots

Objects of class "prev" contain the following four slots:

par:

A list of input parameters

model:

The fitted Bayesian model, in BUGS language (S3 class "prevModel")

mcmc:

A list, with one element per chain, of the simulated true prevalences, sensitivities and specificities

diagnostics:

A list with elements for the Deviance Information Criterion ($DIC), the Brooks-Gelman-Rubin statistic ($BGR), and in the case of truePrevMulti and truePrevMulti2, the Bayes-P statistic ($bayesP)

Author(s)

Brecht Devleesschauwer <brechtdv@gmail.com>

See Also

truePrev, truePrevMulti, truePrevMulti2, truePrevPools
show-methods, print-methods, summary-methods, convert-methods, plot-methods, plot-methods-coda

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
## Taenia solium cysticercosis in Nepal
SE <- list(dist = "uniform", min = 0.60, max = 1.00)
SP <- list(dist = "uniform", min = 0.75, max = 1.00)
TP <- truePrev(x = 142, n = 742, SE = SE, SP = SP)

## Summarize estimates per chain
summary(TP)

## Diagnostic plots
par(mfrow = c(2, 2))
plot(TP)

## Generic plots from package coda
par(mfrow = c(1, 1))
densplot(TP)
traceplot(TP)
gelman.plot(TP)
autocorr.plot(TP)

## Use 'str()' to see the structure of object TP
str(TP)

## Every slot can be accessed using the '@' operator
TP@par          # input parameters
TP@model        # fitted model
TP@mcmc         # simulated TP, SE, SP
TP@diagnostics  # DIC and BGR (and bayesP)

## Each element of TP@mcmc inherits from coda class 'mcmc.list'
## List all available methods for this class
methods(class = "mcmc.list")
## List all available functions in the coda package
library(help = "coda")

## Highest Posterior Density interval, from coda package
HPDinterval(TP@mcmc$TP)