run_sample_times_simulations: Runs multiple simulations for infection time by ID and given...

Description Usage Arguments Value

Description

This function takes data of multiple subjects with repeated exposure data and runs mulitple stochastic simulations estimating infection time infection time that is linked to the given detection time. For more flexibility on returning exact infection times, use TBD.

Usage

1
2
3
run_sample_times_simulations(nsims = 100, raw_exposure_data, raw_sample_times,
  exposure_rate, hazard_risk, clr = 2, lag = 0, return_KM = F,
  parallel = F)

Arguments

raw_exposure_data

The data.frame time containing series of all possible exposures (must include a day and count name) for all subjects (FamilyID)

raw_sample_times

The sampling days that infection would actually be observed for each subject

exposure_rate

The rate of exposures to be sampled from raw_exposure_data

hazard_risk

The per time hazard risk for the hazard function

clr

The exponential pathogen clearance rate

lag

The minimum amount of time between infection and when it could be detected (lag = 0 means infection is instantly detectable)

return_KM

return the Kaplan-Meier estimates from all the runs (if false, just returns raw data)

parallel,

Use parallel computation for simulations across nsim

nsim

The amount of simulations to run

Value

Either a data.frame of infection time simulations for each family matched to sample times or a Kaplan-Meier object


bryanmayer/multdr documentation built on May 13, 2019, 8:11 a.m.