{"id":24585865,"url":"https://github.com/stephaneguerrier/pempi","last_synced_at":"2025-03-17T18:16:24.693Z","repository":{"id":70231165,"uuid":"281454510","full_name":"stephaneguerrier/pempi","owner":"stephaneguerrier","description":"Proportion estimation with marginal proxy information","archived":false,"fork":false,"pushed_at":"2024-01-31T21:56:20.000Z","size":198873,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T16:54:17.866Z","etag":null,"topics":["covid","prevalence","r","rare-infectious-diseases","statistics"],"latest_commit_sha":null,"homepage":"https://stephaneguerrier.github.io/pempi/","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stephaneguerrier.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-07-21T16:53:34.000Z","updated_at":"2023-10-04T12:37:45.000Z","dependencies_parsed_at":"2024-03-04T11:15:37.394Z","dependency_job_id":null,"html_url":"https://github.com/stephaneguerrier/pempi","commit_stats":null,"previous_names":["stephaneguerrier/pempi","stephaneguerrier/cape"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephaneguerrier%2Fpempi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephaneguerrier%2Fpempi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephaneguerrier%2Fpempi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stephaneguerrier%2Fpempi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stephaneguerrier","download_url":"https://codeload.github.com/stephaneguerrier/pempi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244085012,"owners_count":20395523,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["covid","prevalence","r","rare-infectious-diseases","statistics"],"created_at":"2025-01-24T05:16:10.263Z","updated_at":"2025-03-17T18:16:24.673Z","avatar_url":"https://github.com/stephaneguerrier.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\"\n)\nlibrary(pempi)\n```\n\n\u003c!-- badges: start --\u003e\n[![Licence](https://img.shields.io/badge/licence-AGPL--3.0-blue.svg)](https://opensource.org/licenses/AGPL-3.0)\n[![minimal R version](https://img.shields.io/badge/R%3E%3D-4.0.0-6666ff.svg)](https://cran.r-project.org/)\n[![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-green.svg)](https://github.com/stephaneguerrier/pempi)\n[![R-CMD-check](https://github.com/stephaneguerrier/pempi/workflows/R-CMD-check/badge.svg)](https://github.com/stephaneguerrier/pempi/actions)\n[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/pempi)](https://www.r-pkg.org/pkg/pempi)\n[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/pempi)](https://www.r-pkg.org/pkg/pempi)\n\u003c!-- badges: end --\u003e\n\n# `pempi` Overview \n\nThe proportion estimation with marginal proxy information (`pempi`) package, allows to estimate and build confidence intervals for proportions, from random or stratified samples and census data with participation bias. Measurement errors in the form of false positive and false negative are also included in the inferential procedure. The `pempi` package also contains code for simulation studies and sensitivity analysis reported in the companion paper Guerrier et al. (2024), as well as the Austrian dataset on COVID-19 prevalence in November 2020.\n\n# Remark on notation\n\nThe notation and conventions used in Guerrier et al. (2024) are slightly amended for convenience in this package. In particular, we use `R1` instead $\\textit{R}_{11}$, `R2` instead of $\\textit{R}_{10}$, `R3` instead of $\\textit{R}_{01}$ and `R4` instead of $\\textit{R}_{00}$.\n\n# Package installation\n\nThe `pempi` package is available on both CRAN and GitHub. The CRAN version is considered stable, whereas the GitHub version is subject to modifications/updates which may lead to installation problems or broken functions. You can install the stable version of the `pempi` package with:\n\n```{r, eval = FALSE}\ninstall.packages(\"pempi\")\n```\n\nThe latest version can install from GitHub as follows:\n\n```{r, eval=FALSE}\n# Install devtools\ninstall.packages(\"devtools\")\n\n# Install the package from GitHub\ndevtools::install_github(\"stephaneguerrier/pempi\")\n```\n\nNote that Windows users are assumed that have Rtools installed (if this is not the case, please visit this [link](https://cran.r-project.org/bin/windows/Rtools/)).\n\n# Example: Austrian COVID-19 survey\n\nIn November 2020, a survey sample of $\\textit{n}=2,287$ was collected in Statistics Austria (2020) to test for COVID-19 using PCR-tests. In this study, seventy-two participants were tested positive (i.e., `R1 + R3 = 72`)), and among these ones, thirty-five (`R1 = 35`) had reported being tested positive with the official procedure, during the same month. In November, there were $93,914$  declared cases among the official (approximately) $7,166,167$ inhabitants in Austria (above 16 years old), so that $\\pi_0 \\approx 1.3105\\%$. For simplicity, we consider a random (unweighted) sampling and assume that the PCR false positive and negative rate as well as the false case positive rate are equal to 0. The data from this study can be obtained as follows:\n\n```{r}\n# Load pempi\nlibrary(pempi)\n\n# Austrian data (November 2020)\npi0 = 93914/7166167\n\n# Load data\ndata(\"covid19_austria\")\n\n# Random sampling\nn = nrow(covid19_austria)\nR1 = sum(covid19_austria$Y == 1 \u0026 covid19_austria$Z == 1)\nR2 = sum(covid19_austria$Y == 0 \u0026 covid19_austria$Z == 1)\nR3 = sum(covid19_austria$Y == 1 \u0026 covid19_austria$Z == 0)\nR4 = sum(covid19_austria$Y == 0 \u0026 covid19_austria$Z == 0)\n\n# Print table\ndata_mat =c(R1, R2, R3, R4)\nnames(data_mat) = c(\"R1\", \"R2\", \"R3\", \"R4\")\ndata_mat\n```\n\nThe survey MLE as well as the conditional MLE and moment estimator proposed in Guerrier et al. (2024) can be computed as follows:\n\n```{r}\nsurvey_mle(R = R1 + R3, n = n)\n\nconditional_mle(R1 = R1, R2 = R2, R3 = R3, R4 = R4, pi0 = pi0)\n\nmoment_estimator(R3 = R3, n = n, pi0 = pi0)\n```\n\n# Reproducibility\n\nAll results, including figures, tables, real data analysis, and simulations from Guerrier et al. (2024), can be reproduced as detailed here: [https://stephaneguerrier.github.io/pempi/articles/reproducibility.html](https://stephaneguerrier.github.io/pempi/articles/reproducibility.html).\n\n# How to cite\n\n```{}\n@Manual{guerrier2024pempi,\n    title = {{pempi}: Proportion estimation with marginal proxy information},\n    author = {Guerrier, S and Kuzmics, C and Victoria-Feser, M.-P.},\n    year = {2024},\n    note = {R package},\n    url = {https://github.com/stephaneguerrier/pempi}\n}\n```\n\n\n# License\n\nThe 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 [GNU](https://www.gnu.org/licenses/agpl-3.0.en.html) which will provide a synopsis of the restrictions placed upon the code.\n\n# References\n\nGuerrier, Stéphane, Christoph Kuzmics, and Maria-Pia Victoria-Feser, \"Assessing COVID-19 Prevalence in Austria  with Infection Surveys and Case Count Data as Auxiliary Information\", Journal of the American Statistical Association, in press, 2024.\n\nStatistics Austria, \"Pravalenz von SARS-CoV-2-Infektionen liegt bei 3,1\\%\", 2020.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephaneguerrier%2Fpempi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephaneguerrier%2Fpempi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephaneguerrier%2Fpempi/lists"}