Skip to contents

Main Modelling Functions

Core Functions

run_sim()
Run the simulation
run_sim_parallel()
Run simulations in parallel mode (at the simulation level)
add_item()
Define or append model inputs
add_reactevt()
Define the modifications to other events, costs, utilities, or other items affected by the occurrence of the event
add_tte()
Define events and the initial event time
new_event()
Add Events to the Queue for a Patient
modify_event()
Modify or Add Events for a Patient
remove_event()
Remove Events for a Patient
get_event()
Get a specific event time
has_event()
Check if a Patient Has a Specific Event
next_event()
Get the Next Event(s) in the Queue
next_event_pt()
Get the Next Event(s) in the Queue for a specific patient
queue_empty()
Check if the Event Queue is Empty
queue_size()
Get the Size of the Event Queue
queue_create()
Create a New Event Queue
pop_event()
Remove the Next Event from the Queue
pop_and_return_event()
Pop and Return the Next Event

Resource Constrained Specific Functions

resource_discrete()
Create a Discrete Resource
shared_input()
Shared input object
discrete_resource_clone()
Clone independent discrete resources

Auxiliary Functions

create_indicators()
Creates a vector of indicators (0 and 1) for sensitivity/DSA analysis
sens_iterator()
Create an iterator based on sens of the current iteration within a scenario (DSA)
pick_psa()
Helper function to create a list with random draws or whenever a series of functions needs to be called. Can be implemented within pick_val_v.
pick_val_v()
Select which values should be applied in the corresponding loop for several values (vector or list).
replicate_profiles()
Replicate profiles data.frame

Summary Functions

ceac_des()
Calculate the cost-effectiveness acceptability curve (CEAC) for a DES model with a PSA result
evpi_des()
Calculate the Expected Value of Perfect Information (EVPI) for a DES model with a PSA result
summary_results_det()
Deterministic results for a specific treatment
summary_results_sens()
Summary of sensitivity outputs for a treatment
summary_results_sim()
Summary of PSA outputs for a treatment

Statistics Functions

Auxiliary Functions

draw_tte()
Draw a time to event from a list of parametric survival functions
random_stream()
Creates an environment (similar to R6 class) of random uniform numbers to be drawn from
luck_adj()
Perform luck adjustment
qtimecov()
Draw Time-to-Event with Time-Dependent Covariates and Luck Adjustment
adj_val()
Adjusted Value Calculation

Distributions Functions

cond_dirichlet()
Calculate conditional dirichlet values
cond_mvn()
Calculate conditional multivariate normal values
rgamma_mse()
Draw from a gamma distribution based on mean and se
qgamma_mse()
Use quantiles from a gamma distribution based on mean and se
rpoisgamma()
Draw time to event (tte) from a Poisson or Poisson-Gamma (PG) Mixture/Negative Binomial (NB) Process
rpoisgamma_rcpp()
Draw time to event (tte) from a Poisson or Poisson-Gamma (PG) Mixture/Negative Binomial (NB) Process using C++
qbeta_mse()
Draw from a beta distribution based on mean and se (quantile)
qcond_exp()
Conditional quantile function for exponential distribution
qcond_gamma()
Conditional quantile function for gamma distribution
qcond_gompertz()
Quantile function for conditional Gompertz distribution (lower bound only)
qcond_llogis()
Conditional quantile function for loglogistic distribution
qcond_lnorm()
Conditional quantile function for lognormal distribution
qcond_norm()
Conditional quantile function for normal distribution
qcond_weibull()
Conditional quantile function for weibull distribution
qcond_weibullPH()
Conditional quantile function for WeibullPH (flexsurv)
rbeta_mse()
Draw from a beta distribution based on mean and se
rcond_gompertz()
Draw from a conditional Gompertz distribution (lower bound only)
rcond_gompertz_lu()
Draw from a Conditional Gompertz distribution (lower and upper bound)
rdirichlet()
Draw from a dirichlet distribution based on number of counts in transition. Adapted from brms::rdirichlet
rdirichlet_prob()
Draw from a dirichlet distribution based on mean transition probabilities and standard errors
pcond_gompertz()
Survival Probaility function for conditional Gompertz distribution (lower bound only)

Other Functions and Utilities

disc_cycle_v()
Cycle discounting for vectors
disc_instant_v()
Calculate instantaneous discounted costs or qalys for vectors
disc_ongoing_v()
Calculate discounted costs and qalys between events for vectors
ast_as_list()
Transform a substituted expression to its Abstract Syntax Tree (AST) as a list
extract_elements_from_list()
Extracts items and events by looking into assignments, modify_event and new_event
extract_from_reactions()
Extract all items and events and their interactions from the event reactions list
extract_psa_result()
Extract PSA results from a treatment
tte.df
Example TTE IPD data

Deprecated Functions

add_item2()
Define parameters that may be used in model calculations (uses expressions)
modify_item()
Modify the value of existing items
modify_item_seq()
Modify the value of existing items
disc_cycle()
Cycle discounting
disc_instant()
Calculate instantaneous discounted costs or qalys
disc_ongoing()
Calculate discounted costs and qalys between events