Randomly draw parameters from their (joint) probability distribution.

sample_pars(n = 100, input_data, tx_names = iviRA::treatments$sname,
  nma_acr_mean = iviRA::nma.acr.naive$mean,
  nma_acr_vcov = iviRA::nma.acr.naive$vcov, nma_acr_k_lower = 0.75,
  nma_acr_k_upper = 0.92, nma_das28_mean = iviRA::nma.das28.naive$mean,
  nma_das28_vcov = iviRA::nma.das28.naive$vcov,
  nma_das28_k_lower = 0.75, nma_das28_k_upper = 0.92,
  nma_haq_mean = iviRA::nma.haq.naive$mean,
  nma_haq_vcov = iviRA::nma.haq.naive$vcov, nma_haq_k_lower = 0.75,
  nma_haq_k_upper = 0.92, acr2haq_mean = iviRA::acr2haq$mean,
  acr2haq_se = iviRA::acr2haq$se,
  acr2das28_lower = iviRA::acr2das28$inception$lower,
  acr2das28_upper = iviRA::acr2das28$inception$upper,
  acr2sdai_lower = iviRA::acr2sdai$inception$lower,
  acr2sdai_upper = iviRA::acr2sdai$inception$upper,
  acr2cdai_lower = iviRA::acr2cdai$inception$lower,
  acr2cdai_upper = iviRA::acr2cdai$inception$upper,
  acr2eular_mat = iviRA::acr2eular,
  eular2haq_mean = iviRA::eular2haq$mean,
  eular2haq_se = iviRA::eular2haq$se, rebound_lower = 0.7,
  rebound_upper = 1, haq_lprog_tx_mean = iviRA::haq.lprog$tx$est,
  haq_lprog_tx_se = iviRA::haq.lprog$tx$se,
  haq_lprog_age_mean = iviRA::haq.lprog$diff.age$est,
  haq_lprog_age_se = iviRA::haq.lprog$diff.age$se,
  haq_lcgm_pars = iviRA::haq.lcgm, ltfemale = iviRA::lifetable.female,
  ltmale = iviRA::lifetable.male, mort_logor = iviRA::mort.or$logor,
  mort_logor_se = iviRA::mort.or$logor_se,
  mort_loghr_haqdif = iviRA::mort.hr.haqdif$loghr,
  mort_loghr_se_haqdif = iviRA::mort.hr.haqdif$loghr_se,
  ttd_all = iviRA::ttd.all, ttd_da = iviRA::ttd.da,
  ttd_eular = iviRA::ttd.eular, ttsi = iviRA::ttsi,
  tx_cost = iviRA::tx.cost,
  hosp_days_mean = iviRA::hosp.cost$days_mean,
  hosp_days_se = iviRA::hosp.cost$days_se,
  hosp_cost_mean = iviRA::hosp.cost$cost_pday_mean,
  hosp_cost_se = iviRA::hosp.cost$cost_pday_se,
  mgmt_cost_mean = iviRA::mgmt.cost$est,
  mgmt_cost_se = iviRA::mgmt.cost$se, si_cost = 5873,
  si_cost_range = 0.2, si_ul = 0.156, si_ul_range = 0.2,
  tx_attr_utilcoef_lower = iviRA::utility.tx.attr$coef$lower,
  tx_attr_utilcoef_upper = iviRA::utility.tx.attr$coef$upper,
  tx_attr_utilcoef_names = iviRA::utility.tx.attr$coef$var,
  utility_mixture_pain = iviRA::pain, pl_mean = iviRA::prod.loss$est,
  pl_se = iviRA::prod.loss$se)

Arguments

n

Size of the posterior sample.

input_data

An object of class 'input_data' returned from get_input_data.

tx_names

Vector of treatment names. Length should be equal to the number of treatments included in the NMA for ACR response (nma_acr_mean, nma_acr_vcov), the NMA for the change in DAS28 at 6 months (nma_das28_mean, nma_das28_vcov), the NMA for the change in HAQ at 6 months (nma_haq_mean, nma_haq_vcov), the progression of HAQ over time assuming a constant annual rate (haq_lprog_tx_mean, haq_lprog_tx_se), and time to serious infection (ttsi).

nma_acr_mean

Posterior means for ACR response NMA parameters on probit scale for biologic naive patients (i.e., 1st line). ACR response is modeled using an ordered probit model.

nma_acr_vcov

Variance-covariance matrix for ACR response NMA parameters on probit scale for biologic naive patients (i.e., 1st line). ACR response is modeled using an ordered probit model.

nma_acr_k_lower

Treatment effects for bDMARD experienced patients are reduced by multiplying the parameters of the statistical model of ACR response for bDMARD naive patients by a constant \(k\). This is the lower bound for that constant \(k\).

nma_acr_k_upper

Upper bound for the constant \(k\).

nma_das28_mean

Posterior means for DAS28 NMA parameters for biologic naive patients (i.e., 1st line). Change in DAS28 from baseline is modeled using a linear model.

nma_das28_vcov

Variance-covariance matrix for DAS28 NMA paramters for biologic naive patients (i.e., 1st line). Change in DAS28 from baseline is modeled using a linear model.

nma_das28_k_lower

Treatment effects for bDMARD experienced patients are reduced by multiplying the parameters of the statistical model of the change in DAS28 at 6 months for bDMARD naive patients by a constant \(k\). This is the lower bound for that constant k.

nma_das28_k_upper

Upper bound for constant \(k\).

nma_haq_mean

Posterior means for HAQ NMA parameters for biologic naive patients (i.e., 1st line). Change in HAQ from baseline is modeled using a linear model.

nma_haq_vcov

Variance-covariance matrix for HAQ NMA paramters for biologic naive patients (i.e., 1st line). Change in HAQ from baseline is modeled using a linear model.

nma_haq_k_lower

Treatment effects for bDMARD experienced patients are reduced by multiplying the parameters of the statistical model of the change in HAQ at 6 months for bDMARD naive patients by a constant \(k\). This is the lower bound for that constant k.

nma_haq_k_upper

Upper bound for constant \(k\).

acr2haq_mean

Mean HAQ change by ACR response category.

acr2haq_se

Standard error of mean HAQ change by ACR response category.

acr2das28_lower

Lower bound for change in DAS28 by ACR response category.

acr2das28_upper

Upper bound for change in DAS28 by ACR response category.

acr2sdai_lower

Lower bound for change in SDAI by ACR response category.

acr2sdai_upper

Upper bound for change in SDAI by ACR response category.

acr2cdai_lower

Lower bound for change in CDAI by ACR response category.

acr2cdai_upper

Upper bound for change in CDAI by ACR response category.

acr2eular_mat

A two-way frequency matrix with columns denoting EULAR response (none, moderate, good) and rows denoting ACR response (<20, 20-50, 50-70, 70+).

eular2haq_mean

Mean HAQ change by Eular response category.

eular2haq_se

Standard error of mean HAQ change by Eular response category.

rebound_lower

The rebound is the increase in HAQ following treatment discontinuation. It is defined as a proportion \(f\) times the size of the inititial treatment response. rebound_lower defines the lower bound for \(f\). Default is 0.7, which implies that the rebound post treatment is 0.7 times the initial treatment effect.

rebound_upper

rebound_upper defines the upper bound for \(f\). Default is 1, which implies that the rebound post treatment is the same as the initial treatment effect.

haq_lprog_tx_mean

Point estimate of linear yearly HAQ progression rate by treatment.

haq_lprog_tx_se

Standard error of linear yearly HAQ progression rate by treatment.

haq_lprog_age_mean

Impact of age on annual linear HAQ progression rate.

haq_lprog_age_se

Standard error of impact of age on annual linear HAQ progression rate.

haq_lcgm_pars

Parameters of LCGM for HAQ progression.

ltfemale

Lifetable for women. Must contain column 'age' for single-year of age and 'qx' for the probability of death at a given age. Age must range from 0 to 100.

ltmale

Identical to ltfemale but for men.

mort_logor

Log odds ratio of impact of baseline HAQ on probability of mortality.

mort_logor_se

Standard error of log odds ratio of impact of baseline HAQ on probability of mortality.

mort_loghr_haqdif

Log hazard ratio of impact of change in HAQ from baseline on mortality rate. A vector with each element denoting (in order) hazard ratio for months 0-6, >6 - 12, >12 - 24, >24 -36, >36.

mort_loghr_se_haqdif

Standard error of log hazard ratio of impact of change in HAQ from baseline on mortality rate.

ttd_all

A list containing time to treatment discontinuation parameters representative of all patients (i.e., unstratified). See 'Time to treatment discontinuation' for more details.

ttd_da

A list containing time to treatment discontinuation parameters with covariates for moderate and high disease activity. See 'Time to treatment discontinuation'.

ttd_eular

A list containing time to treatment discontinuation parameters stratified by EULAR response. See 'Time to treatment discontinuation'.

ttsi

Paramters of survival model used to estimate time to serious infection.

tx_cost

Treatment cost matrix and treatment lookup in format of iviRA::tx.cost.

hosp_days_mean

Vector denoting average number of hospital days for HAQ < 0.5, 0.5 <= HAQ < 1, 1 <= HAQ < 1.5, 1.5 <= HAQ < 2, 2 <= HAQ < 2.5, HAQ >= 2.5.

hosp_days_se

Vector denoting standard error of average number of hospital days for HAQ < 0.5, 0.5 <= HAQ < 1, 1 <= HAQ < 1.5, 1.5 <= HAQ < 2, 2 <= HAQ < 2.5, HAQ >= 2.5.

hosp_cost_mean

Mean of daily hospital cost.

hosp_cost_se

Standard error of dail hospital cost.

mgmt_cost_mean

Mean of costs of services (in order: chest x-ray, x-ray visit, outpatient followup, Mantoux tuberculin skin test) for general management of RA.

mgmt_cost_se

Standard error of mean of costs of services for general management of RA for general management of RA.

si_cost

Cost of a serious infection.

si_cost_range

Range used to vary serious infection cost. Default is to calculate upper and lower bound by multiplying si_cost by 1 +/- 0.2 (i.e. a 20% change).

si_ul

One month loss in utility from a serious infection.

si_ul_range

Range used to vary serious infection utility loss. Default is to calculate upper and lower bound by multiplying si_ul by 1 +/- 0.2 (i.e. a 20% change).

tx_attr_utilcoef_lower

Lower bound for utility gain from treatment attributes.

tx_attr_utilcoef_upper

Upper bound for utility gain from treatment attributes.

tx_attr_utilcoef_names

Names of treatment attributes to be returned in sampled matrix utility.tx.attr.

utility_mixture_pain

Summary statistics for bivariate distribution of HAQ and pain. Format should be the same as iviRA::pain. Currently, each element of the list must be of length 1.

pl_mean

Mean annual productivity loss per 1-unit increase in HAQ.

pl_se

Standard error of mean annual productivity loss per 1-unit increase in HAQ.

Value

List containing samples for the following model parameters:

acr

A list containing randomly sampled values of the parameters of the statistical model of ACR response at 6 months.

das28

A list containing randomly sampled values of the parameters of the statistical model of change in DAS28 at 6 months.

haq

Identical to DAS28 but for the HAQ score.

acr2haq

A matrix of sampled HAQ changes by ACR response category. The matrix has four columns for ACR < 20, ACR 20 - <50, ACR 50 - <70, and ACR 70+.

acr2das28

A matrix of sampled changes in DAS28 by ACR response category. The matrix has four columns for ACR < 20, ACR 20 - <50, ACR 50 - <70, and ACR 70+.

acr2sdai

Same as acr2das28 but for SDAI.

acr2cdai

Same as acr2das28 but for CDAI.

acr2eular

An array of matrices. Each matrix represents a random sample of the conditional probability of each EULAR response category for a given ACR response.

eular2haq

A matrix of sampled HAQ changes by Eular response category. The matrix has three columns for no response, moderate response, and good response.

rebound

Vector of the sampled values of the HAQ rebound (i.e., the increase in HAQ following treatment discontinuation.)

haq.lprog.tx

A matrix of sampled yearly linear change in HAQ by treatment. The matrix has one column for each treatment in tx_names.

haq.lprog.age

A matrix of sampled yearly linear change in HAQ by age. The matrix has three columns for age < 40, age 40-64, and age 65+.

haq.lcgm

A list of two elements containing parameters from the latent class growth model. The first element is delta which is a an array of sampled matrices with each matrix containing coefficients predicting class membership. Rows are classes and columns index variables. beta is similar to delta, but each matrix contains coefficients predicting HAQ as a function of time using a quadratic polynomial model.

lt

A list with two elements for consisting of two matrics, one for males and one for females. Each matrix contains three variables: age, qx (probability of death) and logit_qx (the logit of the probability of death). Importantly, there is a row for each single-year of age from 0 to 100, which is passed to the sim_iviRA function.

mort.logor

Matrix of log odds ratio used to adjust mortality. One row for each sample and one column for each variable used to adjust mortality.

mort.loghr.haqdif

Matrix of the log hazard ratio of the impact of a change in HAQ from baseline on mortality. Columns denote hazard ratios at times < 6 months, months 6 - <12, months 12 - <24, months 24 - <36, and months 36+.

ttd.all

Sampled values of time to treatment discontinuation parameters representative of all patients. See 'Time to treatment discontinuation' for more details.

ttd.da

Sampled values of time to treatment discontinuation parameters with covariates for moderate and high disease activity. See 'Time to treatment discontinuation' for more details.

ttd.eular

Sampled values of time to treatment discontinuation parameters stratified by EULAR response. See 'Time to treatment discontinuation' for more details.

ttsi

A matrix of sampled values of time to serious infection. The matrix has one column for each treatment in tx_names.

tx.cost

Identical to argument tx_cost passed to sample_pars.

hosp.cost

A list of two matrices hosp.days and cost.pday. hosp.days is sample of hospital days by HAQ category; the columns of the matrix are the six HAQ categories (HAQ < 0.5, 0.5 <= HAQ < 1, 1 <= HAQ < 1.5, 1.5 <= HAQ < 2, 2 <= HAQ < 2.5, HAQ >= 2.5). in hosp.days are HAQ. cost.pday is a sample of the costs per hospital day by HAQ category; the columns are the same six HAQ categories as in hosp.days.

mgmt.cost

Matrix of sampled values of general management costs. Each column is a different category of costs ( chest x-ray, x-ray visit, outpatient follow-up, and Mantoux tuberculin skin test).

si.cost

Vector of sampled values of the medical cost of a serious infection.

utility.mixture

A list containing samples of all parameters in the Hernandez Alva (2013) mixture model. See 'Sampled mixture model parameters' for details.

utility.wailoo

A matrix of sampled regression coefficients from the model mapping HAQ to EQ5D utility in Wailoo (2006). Variables are (in order) "int" (intercept), "age" (patient age), "dis_dur" (disease duration), "haq0" (baseline HAQ), "male" (1 = male, 0 = female), "prev_dmards" (number of previous DMARDs), and "haq" (current HAQ).

si.ul

Vector of the sampled values of the annualized utility loss from a serious infection.

utility.tx.attr

Matrix of sampled values of utility gains. Each column is a different treatment attribute.

prod.loss

Vector of sampled values of decrease in wages (e.g. productivity loss) per unit increase in HAQ.

Time to treatment discontinuation

Time to treatment discontinuation parameters should be contained in a list of lists. The top-level list identifies the name of the probability distribution; the possible distributions are the exponential (exponential), Weibull (weibull), Gompertz (gompertz), gamma (gamma), log-logistic (llogis), lognormal (lnorm), and generalized gamma (gengamma). Each distribution should also contain a list with five elements:

est

A vector of the maximum likelihood estimates of the parameters.

vcov

The variance-covariance of the parameters.

loc.index

A vector of the indices of the location parameters.

anc1.index

A vector of the indices of the first ancillary parameter.

anc2.index

A vector of indices of the second ancillary parameter.

The maximum likelihood estimates should be transformed to the real line. For example, if the model is fit using flexsurvreg in the flexsurv package, the output should be returned from res.t.

Sampled mixture model parameters

The sampled mixture model parameters are contained in a list containing the following:

beta1

Coefficients for class 1 explanatory variables. A matrix of random draws where each column is an explanatory variable.

beta2

Coefficients for class 2 explanatory variables. A matrix of random draws where each column is an explanatory variable.

beta3

Coefficients for class 3 explanatory variables. A matrix of random draws where each column is an explanatory variable.

beta4

Coefficients for class 4 explanatory variables. A matrix of random draws where each column is an explanatory variable.

alpha1

Random effects intecept term for class 1. A vector of random draws.

alpha2

Random effects intecept term for class 2. A vector of random draws.

alpha3

Random effects intecept term for class 3. A vector of random draws.

alpha4

Random effects intecept term for class 4. A vector of random draws.

alpha

Random effects term for male indicator variable. A vector of random draws.

epsilon1

Variance for class 1. A vector of random draws.

epsilon2

Variance for class 2. A vector of random draws.

epsilon3

Variance for class 3. A vector of random draws.

epsilon4

Variance for class 4. A vector of random draws.

mu

Random effects variance term. A vector of random draws.

delta

Coefficients for explanatory variables explaining the probbaility of class membership. An array of matrices where each matrix is a random draw. There are three rows in each matrix (one for each class) and four columns (one for each explanatory variable).

The list also contains summary statistics for pain and HAQ, which is needed to simulate pain. In particular, the object 'pain' in the list is a list containing:

pain.mean

Mean of pain score in the population.

haq.mean

Mean of HAQ score in the population.

pain.var

Variance of pain score in the population.

haq.var

Variance of HAQ in the population.

painhaq.cor

Correlation between pain and HAQ in the population.

Examples

pop <- sample_pop(n = 10, type = "homog") input.dat <- get_input_data(pop = pop) parsamp <- sample_pars(n = 10, input_dat = input.dat)