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.

pop <- sample_pop(n = 100, type = "heterog")
head(pop)
##           age male weight prev_dmards    das28     sdai     cdai      haq0
## [1,] 49.34167    0     75           2 4.529553 14.65668 21.83073 2.0618762
## [2,] 57.82747    0     75           2 5.607912 38.17549 43.66886 0.6241703
## [3,] 31.87619    0     75           1 7.236282 47.57775 51.89506 1.6202595
## [4,] 37.00959    0     75           4 5.854026 41.18489 35.45050 2.0994835
## [5,] 42.80356    0     75           5 5.570586 44.73199 43.12915 2.7888834
## [6,] 57.90885    0     75           3 5.787169 34.13964 28.54326 0.6073561

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 = 100, 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,] 34.22746    1     89           4 5.195691 34.038042 32.200043
## [2,] 52.41400    0     75           5 3.910669 17.525877  2.638035
## [3,] 28.84563    0     75           2 5.080472 15.931430 17.775215
## [4,] 62.58620    1     89           4 2.748968 17.461536 15.812531
## [5,] 48.65564    0     75           4 4.038561  9.760667  8.497388
## [6,] 56.47463    1     89           3 5.421347 40.744857 38.966140
##           haq0
## [1,] 1.0670402
## [2,] 1.5645452
## [3,] 1.3702669
## [4,] 0.1754483
## [5,] 1.3755551
## [6,] 1.4464684

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.

colnames(pop)
## [1] "age"         "male"        "weight"      "prev_dmards" "das28"      
## [6] "sdai"        "cdai"        "haq0"