Generate data inputs for the the individual patient simulation (sim_iviRA).

get_input_data(pop, x_acr = NULL, x_haq = NULL, x_das28 = NULL,
  x_ttd_all = NULL, x_ttd_da = NULL, x_ttd_eular = NULL,
  x_mort = NULL, x_attr = iviRA::utility.tx.attr$x)

Arguments

pop

The patient population. A matrix that must contain variables generated from sample_pop: age' for age, 'haq0' for baseline HAQ, 'male' as a indicator equal to 1 if the patient is male and 0 if female, 'weight' for patient weight, 'prev_dmards' for number of previous DMARDs, 'das28' for the patient's DAS28 score, 'sdai' for the patient's SDAI score, and 'cdai' for the patient's CDAI score.

x_acr

Design matrix where each column is a variable known at baseline that is used to predict the relative treatment effects for ACR response. By default, only includes an intercept, which implies that there are no treatment-by-covariate interactions.

x_haq

Design matrix where each column is a variable known at baseline that is used to predict the relative treatment effects for change in HAQ at 6 months from baseline. By default, only includes an intercept, which implies that there are no treatment-by-covariate interactions.

x_das28

Design matrix where each column is a variables known at baseline that is used to predict the relative treatment effects for change in DAS28 at 6 months from baseline. By default, only includes an intercept, which implies that there are no treatment-by-covariate interactions.

x_ttd_all

Design matrix where each column is a variable influencing treatment duration in a model representative of all patients. The impact of each variable is determined by the sampled values of the coefficients used to predict the location parameter in ttd.all returned by sample_pars.

x_ttd_da

Design matrix where the first column is the intercept, the second column is a dummy variable used to indicate whether a patient has moderate disease activity, and the third column is dummy variable used to indicate whether a patient has high disease activity (note, however, that the second and third columns are updated during the simulation according to the simulated disease activity level). All remaining columns after the 3rd column are variables influencing treatment duration. The impact of each variable is determined by the sampled values of the coefficients used to predict the location parameter in ttd.da returned by sample_pars.

x_ttd_eular

Design matrix where each column is a variable influencing treatment duration in models stratified by EULAR response. The impact of each variable is determined by the sampled values of the coefficients used to predict the location parameter in ttd.eular returned by sample_pars.

x_mort

Design matrix where each column is a variable influencing mortality. The impact of each variable is determined by the parameter vector mort.logor returned by sample_pars.

x_attr

Design matrix where each column is a variable related to treatment attributes related to the processes of care influencing utility. The impact of each variable is determined by the parameter vector tx.attr.utility returned by sample_pars

Value

A list containing the following data inputs:

n

Number of simulated patients.

haq0

A vector of patient HAQ at baseline.

age

A vector of patient age at baseline.

male

A vector of patient gender (1 = male, 0 = female).

prev.dmards

A vector of the number of previous DMARDs.

x.acr

Equivalent to x.acr passed as an argument to the function.

x.haq

Equivalent to x.haq passed as an argument to the function.

x.das28

Equivalent to x.das28 passed as an argument to the function.

x.ttd.all

Equivalent to x.ttd.all passed as an argument to the function.

x.ttd.da

Equivalent to x.ttd.da passed as an argument to the function.

x.ttd.eular

Equivalent to x.ttd.eular passed as an argument to the function.

x.mort

Equivalent to x.mort passed as an argument to the function.

x.attr

Equivalent to x.attr passed as an argument to the function.

Details

If a design matrix is set to NULL, then a single column of ones is returned. In other words, if a design matrix is not specified, then it is assumed that an intercept only model will be used.

Examples

pop <- sample_pop(n = 100) input.dat <- get_input_data(pop) names(input.dat)
#> [1] "n" "haq0" "age" "male" "das28" #> [6] "sdai" "cdai" "weight" "prev.dmards" "x.mort" #> [11] "x.acr" "x.haq" "x.das28" "x.ttd.all" "x.ttd.eular" #> [16] "x.ttd.da" "x.attr"
head(input.dat$haq0)
#> [1] 1.5 1.5 1.5 1.5 1.5 1.5
head(input.dat$x.haq)
#> [,1] #> [1,] 1 #> [2,] 1 #> [3,] 1 #> [4,] 1 #> [5,] 1 #> [6,] 1