This class can be used to simulate the arrival times of patients in a simulated trial. The function NewAccrualProcess returns an object used to simulate arrival times for patients by calling The class assumes a Poisson process and allows the user to several options, such as ramp up the accrual rate which typically occurs in clinical trials. #' For this function you must supply nMaxQtyPatients and/or nMaxMonthsOfAccrual Accrual will continue until either the max qty of patient or max months of accrual is reached, which ever comes first

NewAccrualProcess(vQtyPatsPerMonth, nMaxQtyPatients, nMaxMonthsOfAccrual)

Arguments

vQtyPatsPerMonth

A vector (possibly of length 1 for constant rate) for the number of patient accrued each month

nMaxQtyPatients

The maximum of of patient recruitment times to simulate.

nMaxMonthsOfAccrual

The maximum number of months that you want to simulate accrual for.

Details

If both nMaxQtyPatients and nMaxMonthsOfAccrual are supplied then the returned vector will be at most nMaxQtyPatients in length. However, when nMaxMonthsOfAccrual all values will be less than nMaxMonthsOfAccrual so the length of the returned vector could be less than nMaxQtyPatient.

See also

SimulateArrivalTimes for simulating the arrival times once you have created the object..

Examples

vPatsPerMonth <- c(5, 10, 15, 20, 30, 40, 50) # The ramp up in expected Pat/month nMaxQtyPats <- 100 # Maximum of 100 patients ap <- NewAccrualProcess( vQtyPatsPerMonth = vPatsPerMonth, nMaxQtyPatients = nMaxQtyPats ) vAccTimes <- SimulateArrivalTimes( ap )