knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-" ) library(CPreval)
CPrval
OverviewThis R package provides an implementation of the estimators discussed in Accurate Prevalence Estimation for Emerging or Rare Infectious Diseases by Stéphane Guerrier, Christoph Kuzmics and Maria-Pia Victoria-Feser (submitted manuscript available upon request). The pacakge can be installed from GitHub as follows:
# Install devtools install.packages("devtools") # Install the package from GitHub devtools::install_github("stephaneguerrier/CPreval")
Consider the following data:
seed = 18 n = 1500 p0 = 3/100 pi0 = 1/100 (X = sim_Rs(p = p0, pi0 = pi0, n = n, seed = seed))
Estimators:
survey_sample(X$R, X$n) moment_estimator(R0 = X$R0, R = X$R, pi0 = X$pi0, n = X$n) mle(R0 = X$R0, R = X$R, pi0 = X$pi0, n = X$n)
With measurement error:
alpha0 = 1/100 alpha = 1/100 beta0 = 6/100 beta = 6/100 (X = sim_Rs(p = p0, pi0 = pi0, n = n, seed = seed, alpha = alpha, alpha0 = alpha0, beta = beta, beta0 = beta0))
Without taking into account measurement error:
survey_sample(X$R, X$n) moment_estimator(R0 = X$R0, R = X$R, pi0 = X$pi0, n = X$n) mle(R0 = X$R0, R = X$R, pi0 = X$pi0, n = X$n)
Taking into account measurement error:
survey_sample(X$R, X$n, alpha = alpha, beta = beta) moment_estimator(R0 = X$R0, R = X$R, pi0 = X$pi0, n = X$n, alpha = alpha, alpha0 = alpha0, beta = beta, beta0 = beta0) mle(R0 = X$R0, R = X$R, pi0 = X$pi0, n = X$n, alpha = alpha, alpha0 = alpha0, beta = beta, beta0 = beta0)
The license this source code is released under is the GNU AFFERO GENERAL PUBLIC LICENSE (AGPL) v3.0. Please see the LICENSE file for full text. Otherwise, please consult TLDR Legal or GNU which will provide a synopsis of the restrictions placed upon the code.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.