Simulate utility after running sim_iviRA with output = "data". This can be useful in cases where you want to use a different algorithm to estimate utility, but do not want to rerun the entire simulation.

sim_utility_mixture(simhaq, male, pars)

sim_utility_wailoo(simhaq, haq0, male, prev_dmards, coefs)

sim_qalys(simhaq, utility, si_ul, x_attr, tx_attr_coef)

Arguments

simhaq

Simulation output from sim_iviRA. Must include columns yrlen for year length of model cycle, sim for simulation number, and si for whether a serious infection occured during the model cycle.

male

Indicator = 1 for males and 0 for females.

pars

List of sampled parameters needed to simulate utility using the Hernandez Alava (2013) mixture model (i.e., the element utility.mixture returned by sample_pars). to sample_pars.

haq0

HAQ score at baseline.

prev_dmards

Number of previous DMARDs.

coefs

Matrix of sampled coefficients needed to simulate utility using the Wailoo (2006) model (i.e., the element utility.wailoo returned by sample_pars). Note that the matrix columns must contain the exact same variables as generated by sample_pars.

utility

Simulated utility from sim_utility_mixture or sim_utility_wailoo.

si_ul

Sampled utility loss. Equivalent to output si.ul from sample_pars.

x_attr

Treatment attribute data (e.g., ouptut x.attr from get_input_data)

tx_attr_coef

Distribution of coefficient vector for treatment attributes (e.g., output utility.tx.attr from sample_pars.)

simhaq

Simulation output from sim_iviRA. Variables needed are sim, id, age, and haq.

Value

For sim_utility_mixture and sim_utility_wailoo, a vector of simulated utility for each row returned in simhaq. For sim_qalys, a vector of QALYs for each row in simhaq.

Details

Note that disease duration is set to 18.65 years in sim_utility_wailoo, which is the mean value from the Wailoo (2006) paper used for the parameter estimates. Age and the HAQ score are taken from the simulation output.

Examples

pop <- sample_pop(n = 10) tx.seq <- c("adamtx", "cdmards") mod.structs <- select_model_structures(utility_model = "wailoo") input.dat <- get_input_data(pop = pop) parsamp <- sample_pars(n = 10, input_dat = input.dat) sim.out <- sim_iviRA(tx_seqs = tx.seq, input_data = input.dat, pars = parsamp, model_structures = mod.structs, output = "data") utility.mix <- sim_utility_mixture(simhaq = sim.out, male = pop[, "male"], pars = parsamp$utility.mixture) utility.wailoo <- sim_utility_wailoo(simhaq = sim.out, haq0 = pop[, "haq0"], male = pop[, "male"], prev_dmards = pop[, "prev_dmards"], coefs = parsamp$utility.wailoo) qalys.mix <- sim_qalys(simhaq = sim.out, utility = utility.mix, si_ul = parsamp$si.ul, x_attr = input.dat$x.attr, tx_attr_coef = parsamp$utility.tx.attr) head(utility.mix)
#> [1] 0.6555519 0.6814161 0.6597661 0.6957064 0.6687879 0.6024492
head(utility.wailoo)
#> [1] 0.8773545 0.8784677 0.8795721 0.8806678 0.8817549 0.8828334
head(qalys.mix)
#> [1] 0.3277759 0.3407080 0.3298831 0.3478532 0.3343940 0.3012246