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,] 53.88004    0     75           4 6.572856 54.38978 53.86545 1.7484387
## [2,] 61.31761    0     75           4 4.208864 31.16897 33.95544 1.2841086
## [3,] 62.73725    0     75           5 7.668678 60.63666 57.83942 2.0796582
## [4,] 74.18800    0     75           2 8.618711 60.38622 66.83134 1.3406628
## [5,] 52.06278    0     75           1 5.442815 38.14211 30.62040 0.1958937
## [6,] 28.99411    0     75           2 6.348633 43.63887 39.52236 1.7382138

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,] 23.99684    0     75           3 4.274272 26.084096 24.237744
## [2,] 41.57558    1     89           2 5.558402 24.058515 17.056680
## [3,] 49.69941    0     75           6 4.571363 20.651153 17.176171
## [4,] 57.76840    1     89           4 3.721735 17.023215  4.697975
## [5,] 51.46727    0     75           3 2.769621 13.795803 10.304489
## [6,] 34.94004    0     75           4 3.401002  1.979372  3.454537
##           haq0
## [1,] 1.7829844
## [2,] 1.2804805
## [3,] 1.7850090
## [4,] 0.4630017
## [5,] 0.5388198
## [6,] 1.5940766

## 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"