.sample_outcome_time {simulist} | R Documentation |
Sample the onset-to-outcome time conditional that the outcome is after a hospitalisation event
Description
The outcome of a case, either died or recovered, can have a time of event,
but this must be after the hospitalisation time, if a case has been admitted
to hospital. This function samples either the onset-to-death or
onset-to-recovery time conditional on it being greater than a
onset-to-hospitalisation time for a given case, if the case was admitted
to hospital. It does this by resampling onset-to-outcome (death or recovery)
times if they are less than the onset-to-hospitalisation time (from
.add_hospitalisation()
).
Usage
.sample_outcome_time(.data, onset_to_outcome, idx)
Arguments
.data |
A |
onset_to_outcome |
A |
idx |
Either the |
Value
A <data.frame>
with a potentially modified $outcome_time
column.