View source: R/AccrualMethods.R
NewAccrualProcess | R Documentation |
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)
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. |
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.
SimulateArrivalTimes
for simulating the arrival times once you have created 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 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.