Create a fake subject database with clustering

create_fake_subjectDB_clustered(
  n_subjects = 50,
  n_facilities = 10,
  avg_n_stays = 3,
  days_since_discharge = NULL,
  length_of_stay = NULL,
  n_clusters = 3
)

Arguments

n_subjects

the number of different subjects in the database

n_facilities

the number of facility present in the database

avg_n_stays

the average number of stays per subject

days_since_discharge

the number of days between a discharge date and an admission date (default: max(0, rnorm(1, mean = 30, sd = 10)))

length_of_stay

the length of stay (default: max(1, rnorm(1, mean = 5, sd = 3) )

n_clusters

the number of cluster in the network

Value

a data.table containing all subjects stays

Examples

mydb <- create_fake_subjectDB_clustered(n_subjects = 100, n_facilities = 10)
mydb
#>      sID fID      Adate      Ddate
#>   1: s01  f4 2019-01-30 2019-01-31
#>   2: s01  f7 2019-03-16 2019-03-25
#>   3: s01  f7 2019-04-22 2019-04-26
#>   4: s01  f4 2019-06-04 2019-06-10
#>   5: s02  f7 2019-01-10 2019-01-18
#>  ---                              
#> 270: s81  f7 2019-03-25 2019-03-29
#> 271: s84  f7 2019-05-04 2019-05-11
#> 272: s82  f3 2019-05-10 2019-05-17
#> 273: s98  f9 2019-02-28 2019-03-09
#> 274: s67  f4 2019-04-12 2019-04-15