An assessment of a health technology is always conditional on the patient population studied. The first step in an analysis is thus to specify the population considered. Below, we consider two ways to generate the patient population: first, the cohort can be randomly sampled using the sample_pats function from the iviRA package, and, second, a user can supply their own patient data.

Randomly sampling a patient population

The simplest way to generate a patient cohort is to use the sample_pats function. The variables included in the cohort are age, gender, HAQ score at baseline, weight, the number of previous DMARDs, and three measures of disease activity (Disease Activity Score with 28-joint counts (DAS28), Simple Disease Activity Index (SDAI), and the Clinical Disease Activity Index (CDAI)). The type argument specifies whether the patient cohort is homogeneous or heterogeneous. If the cohort is homogeneous, then the cohort consists of male and female patients that are identical in all respects other than gender; if the cohort is heterogeneous, then all variables vary across patients.

We can randomly sample a heterogeneous population with default setting. To examine these settings type ?sample_pats into the console.

n.pats <- 100
pop <- sample_pop(n = n.pats, type = "heterog")
head(pop)
##           age male weight prev_dmards    das28     sdai     cdai     haq0
## [1,] 61.02684    0     75           5 5.465976 30.63675 32.07972 1.137859
## [2,] 71.25579    0     75           3 6.921399 37.03210 39.03053 2.460240
## [3,] 60.06325    0     75           0 5.971370 34.08397 38.93296 1.798122
## [4,] 60.66096    0     75           3 4.890702 28.21718 21.57930 0.429847
## [5,] 61.06985    0     75           5 6.708158 33.11212 31.02810 2.499273
## [6,] 68.53777    0     75           4 8.256732 67.44800 64.12642 1.542698

We can also customize the distribution of patients. For example, suppose we want to study a younger and healthier population. We might then sample patients by customizing arguments in sample_pats,

pop2 <- sample_pop(n = n.pats, type = "heterog", age_mean = 45, das28_mean = 4, sdai_mean = 20, 
                    cdai_mean = 18)
head(pop2)
##           age male weight prev_dmards    das28       sdai      cdai
## [1,] 50.54048    0     75           2 2.704023  0.9849625  1.083538
## [2,] 46.99155    0     75           3 6.276414 38.4812648 30.910145
## [3,] 44.50258    0     75           3 3.697388 17.4936214 13.618280
## [4,] 50.85143    1     89           5 3.864608 20.9667852 15.313670
## [5,] 47.42490    1     89           4 3.525874 21.9051298 14.924474
## [6,] 63.97364    1     89           4 4.453902 33.5057183 31.561699
##           haq0
## [1,] 2.5652117
## [2,] 1.7446993
## [3,] 1.5785482
## [4,] 0.9925878
## [5,] 1.9190828
## [6,] 1.2074917

Using your own patient population

Users who have data on their own patient population may wish to run the simulation using their own data. To do this, users can simply load their own data and convert it to an R matrix. The matrix must have 1 row for each patient and the same columns as returned by sample_pats.

## [1] "age"         "male"        "weight"      "prev_dmards" "das28"      
## [6] "sdai"        "cdai"        "haq0"