create_waiting_list {NHSRwaitinglist} | R Documentation |
Create Waiting List
Description
Creates a waiting list using the parameters specified
Usage
create_waiting_list(
n,
mean_arrival_rate,
mean_wait,
start_date = Sys.Date(),
limit_removals = TRUE,
sd = 0,
rott = 0,
...
)
Arguments
n |
Numeric value of rate of demand in same units as target wait
|
mean_arrival_rate |
Numeric value of mean daily arrival rate. |
mean_wait |
Numeric value of mean wait time for treatment/on waiting list. |
start_date |
Character value of date from which to start generated waiting list. |
limit_removals |
Defaults to TRUE |
sd |
Numeric value, standard deviation. Defaults to 0. |
rott |
Numeric value, proportion of referrals to be randomly flagged as ROTT. Defaults to 0. |
... |
Container for the list |
Value
A tibble with randomly generated patient records and the following columns:
- pat_id
Integer. Unique identifier for the patient.
- addition_date
Date. The date the patient was added to the waiting list.
- removal_date
Date. The date the patient was removed from the waiting list.
- wait_length
Numeric. Number of days between the addition and removal dates.
- rott
Logical. Whether the removal was for reasons other than treatment (ROTT).
Additional columns may be included if supplied via ...
,
where named vectors (e.g., patient-level variables) of compatible length
are merged into the output tibble.
Examples
create_waiting_list(366, 50, 21, "2024-01-01", 10, 0.1)