This class can be used to simulate the arrival times of patients in a simulated clinical trial. The function NewAccrualProcess returns an object used to simulate arrival times for patients by calling SimulateArrivalTime. The class assumes After calling NewAccrualProces you can call SimulateArrivalTimes to generate a vector of accrual times.
# S4 method for class 'AccrualMethods'
SimulateArrivalTimes(cAP)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.
NewAccrualProcess for creating the object.
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 )