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,] 58.26744    0     75           5 6.040668 29.76266 29.03008 2.3061129
## [2,] 62.25519    0     75           4 5.713318 38.53744 41.15770 1.5151519
## [3,] 57.61413    0     75           4 5.400915 28.37836 31.22170 0.8075926
## [4,] 49.76701    0     75           5 5.403534 41.29927 44.43838 2.3531167
## [5,] 50.36749    0     75           3 7.627312 58.21009 57.30001 0.9759281
## [6,] 26.47107    0     75           5 5.194136 35.26140 35.42509 1.3478461

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,] 33.16350    0     75           3 5.565471 34.623348 38.299772
## [2,] 46.14925    0     75           4 4.251001 17.489256 10.931798
## [3,] 50.19157    0     75           3 2.561757  5.685346  3.974609
## [4,] 27.85229    0     75           1 4.754230 35.520840 24.846308
## [5,] 36.29011    1     89           4 3.353213 15.498816 11.788131
## [6,] 37.46652    0     75           1 3.593651 22.335083 13.271430
##           haq0
## [1,] 2.1844184
## [2,] 2.1093766
## [3,] 0.8983779
## [4,] 1.8959244
## [5,] 1.9976150
## [6,] 1.0331385

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"