get_R: Estimate the Reproduction Number

Description Usage Arguments Details Value Author(s) Examples

View source: R/get_R.R

Description

This function estimates the (most of the time, 'basic') reproduction number (R) using i) the known distribution of the Serial Interval (delay between primary to secondary onset) and ii) incidence data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
get_R(x, ...)

## Default S3 method:
get_R(x, ...)

## S3 method for class 'integer'
get_R(x, disease = NULL, si = NULL, si_mean = NULL,
  si_sd = NULL, max_R = 10, days = 30, ...)

## S3 method for class 'numeric'
get_R(x, ...)

## S3 method for class 'incidence'
get_R(x, ...)

Arguments

x

The daily incidence to be used for inferring the reproduction number. Input can be an incidence object, as output by the package incidence, or a vector of numbers indicating daily number of cases. Note that 'zero' incidence should be reported as well (see details).

...

Further arguments to be passed to the methods.

disease

A character string indicating the name of the disease studied. If provided, then si_mean and si_sd will be filled in automatically using value from the literature. Accepted values are: "ebola".

si

A distcrete object (see package distcrete) containing the discretized distribution of the serial interval.

si_mean

The mean of the serial interval distribution. Ignored if si is provided.

si_sd

The standard deviation of the serial interval distribution. Ignored if si is provided.

max_R

The maximum value the reproduction number can take.

days

The number of days after the last incidence date for which the force of infection should be computed. This does not change the estimation of the reproduction number, but will affect projections.

Details

The estimation of R relies on all available incidence data. As such, all zero incidence after the first case should be included in x. When using inidence from the 'incidence' package, make sure you use the argument last_date to indicate where the epicurve stops, otherwise the curve is stopped after the last case. Use as.data.frame to double-check that the epicurve includes the last 'zeros'.

Value

A list with the earlyR class, containing the following components:

Author(s)

Thibaut Jombart thibautjombart@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
if (require(incidence)) {

## example: onsets on days 1, 5, 6 and 12; estimation on day 24
 x <- incidence(c(1, 5, 6, 12), last_date = 24)
 x
 as.data.frame(x)
 plot(x)
 res <- get_R(x, disease = "ebola")
 res
 plot(res)
 plot(res, "lambdas")

}

earlyR documentation built on May 2, 2019, 7:58 a.m.

Related to get_R in earlyR...