Simulate change in HAQ at 6 months using different model structures relating treatment to HAQ.

sim_dhaq6(treatments, input_data, pars,
  tx_lookup = iviRA::treatments$sname, hist = c("naive",
  "experienced"), line = 1, tx_ihaq = c("acr-haq", "acr-eular-haq",
  "haq"))

Arguments

treatments

Vector of treatments to simulate. Should correpond to sname in iviRA::treatments.

input_data

An object of class input_data returned from get_input_data. The only elements required are x_acr and x_haq.

pars

List of sampled parameter values generated from get_input_data. The only elements required are acr, haq, acr2haq, acr2eular, and eular2haq.

tx_lookup

Vector of treatments with names equivalent to iviRA::treatments$sname. Index of treatments in treatments are matched against treatments in tx_lookup by name. Indices of parameter estimates from the network meta-analyses bust be in the same order as in tx_data.

hist

Is the patient tDMARD naive or tDMARD experienced?

line

Line of therapy

tx_ihaq

Equivalent to argument tx_haq in select_model_structures.

Value

A data.table with the following columns:

tx

Treatment index based on tx_lookup.

model

The model structure component relating treatment to change in HAQ (i.e., tx_ihaq).

sim

Simulation number denoting a randomly sampled parameter set from sample_pars.

id

ID number denoting a simulated patients (e.g., from sample_pop).

dhaq

Change in HAQ score from baseline at 6 months.

Examples

pop <- sample_pop(n = 10) input.dat <- get_input_data(pop = pop) parsamp <- sample_pars(n = 10, input_data = input.dat) sim <- sim_dhaq6(treatments = c("cdmards", "adamtx"), input_data = input.dat, pars = parsamp, tx_ihaq = c("acr-haq", "acr-eular-haq")) head(sim)
#> tx model sim id dhaq #> 1: 1 acr-haq 1 1 -0.4406861 #> 2: 1 acr-haq 1 2 -0.1719505 #> 3: 1 acr-haq 1 3 -0.1719505 #> 4: 1 acr-haq 1 4 -0.1719505 #> 5: 1 acr-haq 1 5 -0.1719505 #> 6: 1 acr-haq 1 6 -0.1719505
tail(sim)
#> tx model sim id dhaq #> 1: 4 acr-eular-haq 10 5 -0.2492727 #> 2: 4 acr-eular-haq 10 6 0.0000000 #> 3: 4 acr-eular-haq 10 7 -0.5432509 #> 4: 4 acr-eular-haq 10 8 -0.2492727 #> 5: 4 acr-eular-haq 10 9 -0.5432509 #> 6: 4 acr-eular-haq 10 10 -0.5432509