Time2Nsubjects {RCTRecruit} | R Documentation |
Simulate the number of weeks needed to recruit a given number of subjects
Description
Simulate the number of weeks needed to recruit a given number of subjects
Usage
Time2Nsubjects(
nSub = 50L,
nSim = 10000L,
fillGaps = FALSE,
cauchyWt = FALSE,
efficiencyFactor = 1
)
Arguments
nSub |
Number of subjects to recruit (default = 50L) |
nSim |
Number of simulations to run (default = 1e4L). Accepted values are in the |
fillGaps |
Whether to fill recruitment gaps in the data (default = FALSE). |
cauchyWt |
Whether to use Cauchy weights for sampling.
If FALSE (default), |
efficiencyFactor |
An efficiency coefficient to apply to the recruitment rate (default = 1).
|
Value
An object of RCTNWeeks
class with four elements.
-
weeks
is an integer vector with length equal tonSim
containing the simulation results. -
CI
shows the median and the 95% CI. -
call.
: The call (deparsed) that created the object -
cargs
: A list with the arguments of the call that created the object
including the default arguments
See Also
Other Links:
GetDistance()
,
GetWeekPredCI()
,
LoadData()
,
RCTRecruit-package
,
gripsYR1
,
gripsYR2
,
gripsYR2Weekly
,
plot.RCTPredCI()
Examples
LoadData(gripsYR1, ScreenDt, Enrolled)
(res <- Time2Nsubjects())
str(res)