rogan_gladen_stderr_unk: Frequentist approaches to correct prevalence under...

View source: R/frequentist_unknown.R

rogan_gladen_stderr_unkR Documentation

Frequentist approaches to correct prevalence under misclassification with an unknown test

Description

Functions that implement the Rogen Gladen Estimator (1978)

Usage

rogan_gladen_stderr_unk(prev.obs, stderr.obs, prev.tru, Se, Sp, n_Se, n_Sp)

Arguments

prev.obs

observed prevalence

stderr.obs

observed standard error

prev.tru

true prevalence

Se

observed sensitivity

Sp

observed specificity

n_Se

numbers of infected individuals in the validation study

n_Sp

numbers of non-infected individuals in the validation study

Functions

  • rogan_gladen_stderr_unk: Estimate Standard Error that captures the uncertainty of Se & Sp. assumption: results generated from independent studies. source: here

References

Kritsotakis, E. I. (2020). On the importance of population-based serological surveys of SARS-CoV-2 without overlooking their inherent uncertainties. Public Health in Practice, 100013. doi: https://doi.org/10.1016/j.puhip.2020.100013

Examples


## Not run: 

library(tidyverse)
library(skimr)

sensitivity = 0.93
specificity = 0.975
positive_pop <- c(321, 123, 100, 10)
negative_pop <- c(1234, 500, 375, 30)

# prop.test(x = 321,n = 321+1234) %>% broom::glance()
# binom.test(x = 321,n = 321+1234) %>% broom::glance()
# https://stackoverflow.com/questions/17802320/r-proportion-confidence-interval-factor
# https://stackoverflow.com/questions/21719578/confidence-interval-for-binomial-data-in-r

tibble(positive=positive_pop,
       negative=negative_pop) %>%
  mutate(total=positive+negative,
         prev_app=positive_pop/(positive_pop+negative_pop),
         # assumes random sample from large population
         stde_app=sqrt(prev_app * (1 - prev_app)/(total))) %>%
  mutate(prev_tru=rogan_gladen_estimator(prev.obs = prev_app,
                                  Se = 0.90,
                                  Sp = 0.76),
         stde_tru=rogan_gladen_stderr_unk(prev.obs = prev_app,
                                          prev.tru = prev_tru,
                                          stderr.obs = stde_app,
                                          Se = 0.90,
                                          Sp = 0.76,
                                          n_Se = 1586,
                                          n_Sp = 1586)) %>%
  mutate(prev_tru_low=prev_tru-qnorm(0.975)*stde_tru,
         prev_tru_upp=prev_tru+qnorm(0.975)*stde_tru)


## End(Not run)


avallecam/serosurvey documentation built on Feb. 12, 2023, 4:13 p.m.