Description Usage Arguments Details Value References Examples
1 test and 1 population binomial model to estimate prevalence and diagnostic test related meassures.
1 2 | OneTestOnePopBM(dataset, inits, priors, pars, n_iter = 10000,
n_chains = 3, burn_in = 1000, thin = 1)
|
dataset |
|
inits |
|
priors |
|
pars |
character vector giving the names of parameters to be monitored. It is passed to the |
n_iter |
number of iterations to monitor. It is passed to the |
n_chains |
the number of parallel chains for the model. It is passed to the |
burn_in |
the number of iteration to be discarded. It is passed to the |
thin |
thinning interval for monitors. It is passed to the |
This function creates a text file with the model and it is saved in the working directory.
A list
of class mcmc.list
.
https://dl.dropboxusercontent.com/u/49022/diagnostictests/index.html
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 | # Data.
dataset <- list(pop_size = 91, positives = 1)
# Initial conditions for chains.
inits <- list(list(true_prev = 0.05, se = 0.8, sp = 0.9),
list(true_prev = 0.02, se = 0.3, sp = 0.7),
list(true_prev = 0.09, se = 0.1, sp = 0.5))
# Priors.
priors <- c(true_prev_a = 1, true_prev_b = 1,
se_a = 6.28, se_b = 13.32, sp_a = 212.12, sp_b = 3.13)
# Prevalence estimate.
prev_est <- OneTestOnePopBM(dataset = dataset, inits = inits, n_iter = 3e3,
priors = priors, pars = 'true_prev')
summary(prev_est)
# Diagnostic plots.
library(coda); library(ggmcmc)
gelman.diag(prev_est)
gelman.plot(prev_est)
gg_res <- ggs(prev_est)
ggs_traceplot(gg_res)
ggs_density(gg_res)
ggs_histogram(gg_res, bins = 100)
ggs_compare_partial(gg_res)
ggs_running(gg_res)
ggs_autocorrelation(gg_res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.