Skip to content

Instantly share code, notes, and snippets.

@mhoehle
Last active June 3, 2021 20:59
Show Gist options
  • Select an option

  • Save mhoehle/dc298f7d750a318e0e38c10375c40dd2 to your computer and use it in GitHub Desktop.

Select an option

Save mhoehle/dc298f7d750a318e0e38c10375c40dd2 to your computer and use it in GitHub Desktop.
Teste den Schnelltester
#' Statistischer Test, ob Anteil positiver Test bei einem
#' Testanbieter kleiner ist als 1-Spez.
#'
#' Test von H_0: \pi >= 1-spez vs. H_1 \pi < 1-Spez
#' zum \alpha=0.025 Niveau.
ist_auffaellig <- function(pos_test, total_test, spez=0.997) {
t <- binomSamSize::binom.midp(pos_test, total_test, conf.level=0.95)
return( as.logical(t["upper"] < 1-spez))
}
# Beispiel aus https://zerforschung.org/posts/testzentrum-die-dritte/
ist_auffaellig(pos_test=190, total_test=80000, spez=0.997)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment