flip_til_failure: Simulate the process of flipping until failure for a single...

Description Usage Arguments Details Value

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

Description

Simulate the process of flipping until failure for a single cluster

Usage

1
flip_til_failure(cluster_id, inf_params, smear_pos_prob, max_size = 30)

Arguments

cluster_id

unique ID of the cluster

inf_params

vector with beta_0 and beta_1

smear_pos_prob

probability of a smear positsive

max_size

maximum size a cluster can be

Details

breadth not depth. Generate generation by generation as opposed to going up the branch til termination.

Value

data frame with the following columns

cluster_id

unique cluster ID

person_id

order of infection in the cluster

smear

- 1 (negative) / + 1 (positive)

gen

generation number (>=0)

inf_id

ID of the infector

n_inf

number of people infected by person

cluster_pos

number of positive smears in the cluster

cluster_size

number in cluster

censored

whether the cluster end was censored or not


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