generation_infection: Infect the current generation given the previous generation

Description Usage Arguments Value

View source: R/simulate-flip-til-failure.R

Description

Infect the current generation given the previous generation

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
generation_infection(
  cluster_id,
  p_pos,
  p_neg,
  smear_pos_prob,
  gen,
  prev_gen,
  cluster_size,
  max_size
)

Arguments

cluster_id

unique cluster ID

p_pos

probability of being infected given a smear positive

p_neg

probability of being infected given a smear negative

smear_pos_prob

probability of being smear positive

gen

new generation number

prev_gen

data frame with at least smear status (0/1) and person_id

cluster_size

size of previous cluster

max_size

maximum size of cluster

Value

list with the following entries

new_cluster_size

new cluster size with the current generation

cur_gen

data frame of current generation (new infections)

n_inf

number of infections for each person in the previous generation


skgallagher/TBornotTB documentation built on April 21, 2020, 1:19 p.m.