Infect the current generation given the previous generation

general_generation_infection(
  cluster_id,
  df,
  covariate_weights = NULL,
  gen,
  prev_gen,
  cluster_size,
  max_size
)

Arguments

cluster_id

unique cluster ID

df

covariate data frame. One is prob_inf

covariate_weights

either NULL or weight of covariates

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