Description Usage Arguments Details Value References Examples
Bayesian PEM models provide the posterior distribution for the
true prevalence (pi
), diagnostic sensitivity (se
) and
specificity (sp
) for a given empirical prevalence estimate using
physically pooled samples (if k>1
) and priors for the model parameters.
The misclassification parameters (se
and sp
) can be specified
at the level of the pool or individual level of testing. On the other side,
the function estimates the true prevalence based on the results
(x/n
) of an application study with individual samples (if k=1
)
using a diagnostic test, for
which some prior information on sensitivity and/or specificity is available.
1 2 3 4 5 | rrisk.BayesPEM(x, n, k, simulation = FALSE,
prior.pi = c(1, 1), prior.se, prior.sp,
misclass = "pool", chains = 3, burn = 4000,
thin = 1, update = 5000,
max.time = "15minutes", plots = FALSE)
|
x |
Scalar value for number of pools ( |
n |
Scalar value for number of pools tested ( |
k |
Scalar value for number of individual samples physically combined
into one pool;
set |
prior.pi |
Numeric vector containing parameters of a beta distribution
as prior for prevalence |
prior.se |
Numeric vector containing parameters of a beta distribution
as prior for sensitivity |
prior.sp |
Numeric vector containing parameters of a beta distribution
as prior for specificity |
simulation |
Not used any longer. |
misclass |
Character with legal character entries: |
chains |
Positive single numeric value, number of independent MCMC chains (default 3). |
burn |
Positive single numeric value, length of the burn-in period (default 4000). |
thin |
Positive single numeric value (default 1). The samples from every k-th iteration will be used for inference, where k is the value of thin. Setting thin > 1 can help to reduce the autocorrelation in the sample. |
update |
Positive single numeric value, length of update iterations for estimation (default 5000). |
max.time |
Maximum time for which the function is allowed to extend the chains. Acceptable units include 'seconds', 'minutes', 'hours', 'days', 'weeks' (default "15minutes") (see autorun.jags). |
plots |
Logical, if |
The application data (k=1
) has one degree of freedom while the
underlying model has three unknown parameters. Thus, the model is not
identifiable and informative priors on at least two model parameters are required. The Bayesian models for estimation prevalence, sensitivity and specificity take the following forms in rjags/JAGS (originally BRugs/Winbugs) syntax:
Misclassifications at the individual level (k=1
and misclass="individual"
)
1 2 3 4 5 6 7 8 9 10 11 12 |
Misclassifications at the individual level with fixed sensitivity
resp. specifity (k=1
and misclass="individual-fix-sp"
)
Both se and sp could be set to fixed values.
1 2 3 4 5 6 7 8 9 10 11 |
For misclassification at the pool-level (k>1
and misclass="pool"
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
For misclassification at the pool-level (k>1
) and fixed
sensitivity and specifity (misclass="pool-fix-se-sp"
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
and for comparison (k>1
)
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 | model{
pi1 ~ dbeta(prior.pi[1], prior.pi[2])
pi2 ~ dbeta(prior.pi[1], prior.pi[2])
se ~ dbeta(prior.se[1], prior.se[2])
sp ~ dbeta(prior.sp[1], prior.sp[2])
x1 <- x
x2 <- x
p.neg <- pow(1-pi1, k)
p.pos <- (1-p.neg)*se + p.neg*(1-sp)
x1 ~ dbin(p.pos, n)
ap <- pi2*se + (1-pi2)*(1-sp)
p <- 1- pow(1-ap,k)
x2 ~ dbin(p,n)
}
|
The function rrisk.BayesZIP
returns an instance of the bayesmodelClass
class containing following information:
|
Logical, whether the model has converged (assessed by the user). |
|
Data frame containing statitsics of the posterior distribution. |
|
Data frame giving the joint posterior probability distribution. |
|
Names of the parameters jointly estimated by the Bayes model. |
|
Model in rjags/JAGS syntax as a character string. |
|
Number of independent MCMC chains. |
|
Length of burn-in period. |
|
Length of update iterations for estimation. |
Greiner, M., Belgoroski, N., NN (2011). Estimating prevalence
using diagnostic data with pooled samples: R function rrisk.BayesPEM
.
J.Stat.Software (in preparation).
Cowling, D.W., Gardner, I.A. and Johnson W.O. (1999). Comparison
of methods for estimation of individual-level prevalence based on pooled
samples, Prev.Vet.Med. 39: 211-225.
Rogan, W.J. and B. Gladen (1978). Estimating prevalence from the results of
a screening test. Am. J. Epidemiol. 107: 71-76.
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 | ------------------------------------------
Example of PEM model
------------------------------------------
# generate PEM data at individual level
n <- 100
x <- 14
k <- 1
pi_prior <- c(1, 1)
se_prior <- c(64, 4)
sp_prior <- c(94, 16)
misclass <- "individual"
# run model
resPEM <- rrisk.BayesPEM(x = x, n = n, k = k,
prior.pi = pi_prior, prior.se = se_prior, prior.sp = sp_prior,
misclass = misclass, plots=TRUE)
# generate data for pooled sampling and fixed sensitivity and specifity
n <- 100
x <- 14
k <- 4
pi_prior <- c(1, 1)
sp_prior <- 1
se_prior <- 0.7
misclass <- "pool-fix-se-sp"
# run model
resPEM <- rrisk.BayesPEM(x = x, n = n, k = k,
prior.pi = pi_prior, prior.se = se_prior, prior.sp = sp_prior,
misclass = misclass, plots=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.