Bayesian models true prevalence for panel
Source:R/bayesian_panel_complex_model.R
      bayesian_panel_complex_model.RdUses resampling to incorporate uncertainty of sensitivity and specificity into an estimate of true prevalence from a given value of apparent prevalence.
Usage
bayesian_panel_complex_model(
  test_results = testerror::.input_data,
  false_pos_controls = NULL,
  n_controls = NULL,
  false_neg_diseased = NULL,
  n_diseased = NULL,
  ...,
  sens = uniform_prior(),
  spec = uniform_prior(),
  panel_sens = uniform_prior(),
  panel_spec = uniform_prior(),
  panel_name = "Panel",
  confint = 0.95,
  fmt = "%1.2f%% [%1.2f%% — %1.2f%%]",
  chains = 4,
  warmup = 1000,
  iter = 2000,
  cache_result = TRUE
)Arguments
- test_results
 A dataframe containing the following columns:
id (character) - the patient identifier
test (factor) - the test type
result (logical) - the test result
Ungrouped.
No default value.
- false_pos_controls
 the number of positives that appeared in the specificity disease-free control group. These are by definition false positives. This is (1-specificity)*n_controls
- n_controls
 the number of controls in the specificity disease-free control group.
- false_neg_diseased
 the number of negatives that appeared in the sensitivity confirmed disease group. These are by definition false negatives. This is (1-sensitivity)*n_diseased
- n_diseased
 the number of confirmed disease cases in the sensitivity control group.
- ...
 not used
- sens
 the prior sensitivity of the test as a
beta_dist.- spec
 the prior specificity of the test as a
beta_dist.- panel_sens
 the prior sensitivity of the panel as a
beta_dist(optional)- panel_spec
 the prior specificity of the panel as a
beta_dist(optional)- panel_name
 the name of the panel for combined result
- confint
 confidence interval limits
- fmt
 a
sprintfformatting string accepting 3 numbers- chains
 A positive integer specifying the number of Markov chains. The default is 4.
- warmup
 A positive integer specifying the number of warmup (aka burnin) iterations per chain. If step-size adaptation is on (which it is by default), this also controls the number of iterations for which adaptation is run (and hence these warmup samples should not be used for inference). The number of warmup iterations should be smaller than
iterand the default isiter/2.- iter
 A positive integer specifying the number of iterations for each chain (including warmup). The default is 2000.
- cache_result
 save the result of the sampling in memory for the current session