Description Usage Arguments Value
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.
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)
|
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 |
Either a data.frame of infection time simulations for each family matched to sample times or a Kaplan-Meier object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.