correct_prevalence {serosv} | R Documentation |
Estimate the true sero prevalence using Bayesian estimation
Description
Estimate the true sero prevalence using Bayesian estimation
Usage
correct_prevalence(
data,
bayesian = TRUE,
init_se = 0.95,
init_sp = 0.8,
study_size_se = 1000,
study_size_sp = 1000,
chains = 1,
warmup = 1000,
iter = 2000
)
Arguments
data |
the input data frame, must either have 'age', 'pos', 'tot' columns (for aggregated data) OR 'age', 'status' for (linelisting data) |
bayesian |
whether to adjust sero-prevalence using the Bayesian or frequentist approach. If set to 'TRUE', true sero-prevalence is estimated using MCMC. |
init_se |
sensitivity of the serological test |
init_sp |
specificity of the serological test |
study_size_se |
(applicable when 'bayesian=TRUE') study size for sensitivity validation study (i.e., number of confirmed infected patients in the study) |
study_size_sp |
(applicable when 'bayesian=TRUE') study size for specificity validation study (i.e., number of confirmed non-infected patients in the study) |
chains |
(applicable when 'bayesian=TRUE') number of Markov chains |
warmup |
(applicable when 'bayesian=TRUE') number of warm up runs |
iter |
(applicable when 'bayesian=TRUE') number of iterations |
Value
a list of 2 items
info |
estimated parameters |
corrected_sero |
data.frame containing age, the corresponding estimated seroprevalance, adjusted tot and pos |
Examples
data <- rubella_uk_1986_1987
correct_prevalence(data)