GetWeekPredCI {RCTRecruit} | R Documentation |
Calculate median recruitment with 95% CI for the next 104 weeks (two years)
Description
Calculate median recruitment with 95% CI for the next 104 weeks (two years)
Usage
GetWeekPredCI(
nSim = 10000L,
fillGaps = FALSE,
cauchyWt = FALSE,
efficiencyFactor = 1
)
Arguments
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 RCTPredCI
class with 5 elements.
-
predCI
: An 104x3 matrix with the 2.5%, 50% and 97.5% weekly percentiles -
pargs
:
An environment which contains objects and functions used to construct
the plot withbase::plot()
. For internal use only. -
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()
,
LoadData()
,
RCTRecruit-package
,
Time2Nsubjects()
,
gripsYR1
,
gripsYR2
,
gripsYR2Weekly
,
plot.RCTPredCI()
Examples
LoadData(gripsYR1, ScreenDt, Enrolled)
(res <- GetWeekPredCI(fillGaps = TRUE, efficiencyFactor = 1.5))
scenarios <- list(
sc1 = GetWeekPredCI(),
sc2 = GetWeekPredCI(cauchyWt = TRUE),
sc3 = GetWeekPredCI(fillGaps = TRUE),
sc4 = GetWeekPredCI(fillGaps = TRUE, efficiencyFactor = 1.2)
)
maxY <- sapply(scenarios, \(x) x$pargs$maxY) |> max()
defaultGraphicParams <- par(no.readonly = TRUE)
graphics::par(mfrow = c(2, 2), cex.main = 1)
for (x in scenarios) plot(x, yMax = maxY, main = x$call.)
do.call(par, defaultGraphicParams)