calculate_posterior_no_infections {smidm}R Documentation

Negative analysis probability

Description

Calculates the probability that nobody is infected given the negative tests.

Usage

calculate_posterior_no_infections(
  negative_persons,
  infected_persons,
  event,
  test_infos,
  test_types,
  subgroup_size,
  distribution = NULL,
  info
)

Arguments

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

Details

The probability is based on Bayes' theorem.

Value

The probability p.

See Also

calculate_prior_infections, generate_data_extended, get_test_sensitivities and calculate_likelihood_negative_tests.

Examples

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))


[Package smidm version 1.0 Index]