Estimates prevalent cases at a specific index date by use of Monte Carlo simulation. Simulated cases are marked with age and sex to enable agreement with population survival data where a cure model is used, and calculation of the posterior distributions of each.
sim_prevalence(
data,
index,
starting_date,
inc_model,
surv_model,
age_column = "age",
N_boot = 1000,
age_dead = 100
)
A data frame with the corresponding column names provided in
form
.
The date at which to estimate point prevalence as a string in the format YYYY-MM-DD.
The initial date to start simulating prevalence from as a Date
object.
Typically the index date - (Nyears * 365.25). Allows for non-whole year prevalence estimations.
An object that has a draw_incident_population
method. See the vignette for further guidance.
An object that has a predict_survival_probability
method. See the vignette for further guidance.
A string providing the name of the column that holds patient age. If provided
then patients alive at age_dead
are set to die. This helps combat 'immortal' patients.
Number of bootstrapped calculations to perform.
The age at which patients are set to be dead if they are still alive, to prevent
'immortal' patients. Used in conjunction with age_column
.
A list with the following attributes:
A data.table containing the simulated incident populations from each simulation along with their covariates and survival status at the index.
The survival model built on the full registry data set.
The incidence model built on the full registry data set.
A list containing survival models built on each bootstrap sample.
A list containing incidence models built on each bootstrap sample.