GetDistance {RCTRecruit}R Documentation

Euclidean distance between predicted and actual recruitment

Description

Euclidean distance between predicted and actual recruitment

Usage

GetDistance(
  target,
  nSim = 10000L,
  fillGaps = FALSE,
  cauchyWt = FALSE,
  efficiencyFactor = 1
)

Arguments

target

A vector with the actual recruitment by week

nSim

Number of simulations to run (default = 1e4L). Accepted values are in the
range of 1 to 10,000.

fillGaps

Whether to fill recruitment gaps in the data (default = FALSE).
Recruitment gaps are defined as any full week (Monday through Sunday) with
no dates recorded in the loaded data. If at least one date is present within
a given week, that week will not be considered a gap in recruitment.

cauchyWt

Whether to use Cauchy weights for sampling. If FALSE (default),
binomial weights are used.

efficiencyFactor

An efficiency coefficient to apply to the recruitment rate (default = 1).
If the efficiency of the recruitment process is expected to match
the provided data, this value should be set to 1. If the recruitment
process is expected to be slower, this value should less than 1. Finally,
if the recruitment process is expected to proceed faster, this value should be
greater than 1. Accepted values range from 0.1 to 2:

  • 0.1: Indicates that the recruitment rate is expected to be 10% of the original rate.

  • 2.0: Indicates that the recruitment rate is expected to be double the original rate.

Value

An object of RCTDist class with four elements.

  1. dist: A numeric vector with length equal to nSim containing the simulated
    Euclidean distance.

  2. CI: A numeric vector with the median and the 95% CI Euclidean distance.

  3. call.: The call (deparsed) that created the object

  4. cargs: A list with the arguments of the call that created the object
    including the default arguments

See Also

Other Links: GetWeekPredCI(), LoadData(), RCTRecruit-package, Time2Nsubjects(), gripsYR1, gripsYR2, gripsYR2Weekly, plot.RCTPredCI()

Examples

LoadData(gripsYR1, ScreenDt, Enrolled)
(res <- GetDistance(gripsYR2Weekly$enrolled))
str(res)

[Package RCTRecruit version 0.2.0 Index]