View source: R/calculate_posterior_no_infections.R
calculate_posterior_no_infections | R Documentation |
Calculates the probability that nobody is infected given the negative tests.
calculate_posterior_no_infections( negative_persons, infected_persons, event, test_infos, test_types, subgroup_size, distribution = NULL, info )
negative_persons |
Number of people without the infectious persons. |
infected_persons |
Number of infectious persons. |
event |
Characters, the name of the event, currently: "school" or "day_care_center". |
test_infos |
Matrix with testing information; each row gives the number of tests (1. column) and each test date (following columns) for each test group |
test_types |
Matrix with test day (columns) of each group (rows) and the informations about test types. |
subgroup_size |
Array with the number of persons per test group. |
distribution |
Vector, this is a placeholder |
info |
Dataframe, this is a placeholder |
The probability is based on Bayes' theorem.
The probability p.
calculate_prior_infections
,
generate_data_extended
, get_test_sensitivities
and calculate_likelihood_negative_tests
.
test_infos <- matrix(nrow = 2, ncol = 3) test_infos[1,] <- c(1, 2, NA) test_infos[2,] <- c(2, 4, 6) test_types <- matrix(nrow = 2, ncol = 2) test_types[1,] <- c("PCR", NA) test_types[2,] <- c("PCR", "Antigen") calculate_posterior_no_infections(negative_persons = 23, infected_persons = 2, event = "school", test_infos = test_infos, test_types = test_types, subgroup_size = c(3, 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.