Background
In 2009, the new influenza virus A/H1N1 rapidly spread worldwide [
1]. In the World Health Organization guidance document [
2] detailing the epidemiological parameters to quickly determine after identification of the disease were: the incubation period, i.e. time between infection and symptoms; the serial interval, i.e. time between symptoms onset in primary and secondary cases; and the initial reproduction ratio, i.e. the average number of secondary cases per primary case. In a systematic review of all articles presenting such estimates for the 2009 H1N1 influenza pandemic [
3], we found high variability in the methods used to estimate the same parameters.
Numerical differences in the reported estimates were therefore due in part to the chosen method. Applying all methods on the same dataset would help to understand what variation is due to the method, and this will be encouraged if the required code is widely distributed. It is also worth noting that subtile variation arises from the actual implementation of the same methods. For example, the initial “exponential growth rate” of the epidemic curve, used in the method described by Wallinga & Lipsitch [
4] has been estimated using linear regression on logged incidence [
5], Poisson regression on incidence data [
6] or renewal equations [
7].
Authors may have provided code implementing their methods, but no effort has yet been made to provide end users with a unique framework, with standardized approach allowing easy comparisons. To allow comparisons and provide more standardized approaches, we developed an R package implementing five methods that were the most commonly used during the 2009 H1N1 influenza pandemic. These methods are “plug-in” methods, requiring only data that are commonly recorded during an outbreak (epidemic curve, serial interval), and have been applied in a variety of situations.
After briefly recalling the principle of these methods, we illustrate their use, propose some tools to critically examine results and finally discuss applicability and limitations.
Implementation
We recall and describe the implementation of methods to estimate the serial interval distribution and reproduction numbers in epidemics. We also propose tools to explore the sensitivity of estimates to required assumptions.
Defining a generation time distribution
The generation time is the time lag between infection in a primary case and a secondary case. The generation time distribution should be obtained from the time lag between all infectee/infector pairs [
8]. As it cannot be observed directly, it is often substituted with the serial interval distribution that measures time between symptoms onset. In our software package, the ‘generation.time’ function is used to represent a discretized generation time distribution. Discretization is carried out on the grid [0,0.5), [0.5, 1.5), [1.5, 2.5), etc.… where the unit is a user chosen time interval (hour, day, week…). Several descriptions are supported: “empirical” requiring the full specification of the distribution, or parametric distributions taken among “gamma”, “lognormal” or “weibull”. In the latter case, the mean and standard deviation must be provided in the desired time units.
A function (‘est.GT’) is also provided to estimate the serial interval distribution from a sample of observed time intervals between symptom onsets in primary cases and secondary cases by maximum likelihood.
Estimation of initial reproduction numbers
Reproduction numbers may be estimated at different times during an epidemic. In the following, we recall methods for estimating the “initial” reproduction number, i.e. at the beginning of an outbreak, and for estimating the “time-dependent” reproduction number at any time during an outbreak, as well as the required hypotheses for the methods. Proposed extensions and options implemented in the software are also presented.
Attack rate (AR)
In the classical SIR model of disease transmission, the attack rate (AR : the percentage of the population eventually infected) is linked to the basic reproduction number [
9], by
where
S
0 is the initial percentage of susceptible population. The required assumptions are homogeneous mixing, closed population, and no intervention during the outbreak.
Exponential growth (EG)
As summarized by Wallinga & Lipsitch [
4], the exponential growth rate during the early phase of an outbreak can be linked to the initial reproduction ratio. The exponential growth rate, denoted by r, is defined by the per capita change in number of new cases per unit of time. As incidence data are integer valued, Poisson regression is indicated to estimate this parameter [
6,
10], rather than linear regression of the logged incidence. The reproduction number is computed as
where M is the moment generating function of the (discretized) generation time distribution. It is necessary to choose a period in the epidemic curve over which growth is exponential. We propose to use the deviance based R-squared statistic to guide this choice. No assumption is made on mixing in the population.
Maximum likelihood estimation (ML)
This model, proposed by White & Pagano [
11], relies on the assumption that the number of secondary cases caused by an index case is Poisson distributed with expected value R. Given observation of (
N
0,
N
1, …,
N
T
) incident cases over consecutive time units, and a generation time distribution w, R is estimated by maximizing the log-likelihood
where
μ
t
=
R ∑
i = 1
t
N
t − i
w
i
. Here again, the likelihood must be calculated on a period of exponential growth, and the deviance R-squared measure may be used to select the best period. No assumption is made on mixing in the population.
The approach assumes that the epidemic curve is analysed from the first case on. If this is not the case, the initial reproduction number will be overestimated, as secondary cases will be assigned to too few index cases: we implemented a correction as described in Additional file
1: Supplementary material S1. It is also possible to account for importation of cases during the course of the epidemic.
Sequential bayesian method (SB)
This method, although introduced as “real-time bayesian” by its authors, more exactly allows sequential estimation of the initial reproduction number. It relies on an approximation to the SIR model, whereby incidence at time
t + 1,
N(
t + 1) is approximately Poisson distributed with mean
N(
t)
e
(γ(R − 1))[
12], where
the average duration of the infectious period. The proposed algorithm, described in a Bayesian framework, starts with a non-informative prior on the distribution of the reproduction number R. The distribution is updated as new data is observed, using
. In other words, the prior distribution for R used on each new day is the posterior distribution from the previous day. At each time, the mode of the posterior may be computed along with the highest probability density interval. As before, the method requires that the epidemic is in a period of exponential growth, i.e. it does not account for susceptible depletion; it implicitly uses an exponential distribution for the generation time; and assumes random mixing in the population.
Estimation of time dependent reproduction numbers (TD)
The time-dependant method, proposed by Wallinga & Teunis [
13], computes reproduction numbers by averaging over all transmission networks compatible with observations. The probability
p
ij
that case i with onset at time ti was infected by case j with onset at time tj is calculated as
. The effective reproduction number for case j is therefore
R
j
= ∑
i
p
ij
, and is averaged as
over all cases with the same date of onset. The confidence interval for Rt can be obtained by simulation. Correction for real time estimation, where not yet observed secondary cases are taken into account is possible [
14]. It is possible to account for importation cases during the course of the epidemic.
Discussion
We have described a package implementing several methods for estimating the reproduction number from epidemic curves, along with diagnostic tools and provided a comparison of the accuracy of these methods.
The reproduction number in an epidemic is of interest when the disease is actually transmitted between subjects, either directly or indirectly. This is for example the case for influenza, childhood diseases, vector borne diseases, but not in food-borne epidemics caused by environmental exposure to a pathogen. The methods implemented in the package will best be used for acute diseases with short serial intervals. The analysis of diseases with very long incubation times (e.g. HIV or HBV infection) requires more specialized methods, especially to account for censoring [
20].
While several methods for estimating reproduction numbers exist, sometimes with code provided by their authors, no common framework was available to allow easy and direct comparison of the results. Developing an R package provide this framework and allow widespread distribution. It will complement package developed for epidemiological surveillance [
4] and cost-effectiveness analyses [
5]. Furthermore, R packages are easily extensible, so that additional methods can be easily included in future releases.
Regarding the methods described here, we found that when the data was available on a time scale smaller than the mean generation time, all methods tended to be unbiased. Very small aggregation windows may lead to gaps, i.e. time periods with 0 observations. In this case, the SB method fails after the first gap (data not shown). Other methods are not affected, provided the maximum generation time is longer than the gap. When the data was aggregated in time periods up to twice the mean generation time, only the exponential growth method remained unbiased. Indeed, it has previously been reported that aggregation in time periods of 1 mean generation time width was ideal for estimation, and corrections proposed for larger time intervals [
21]. The results obtained from the methods described here when data are aggregated in time periods larger than the mean generation time should therefore be interpreted with caution, all the more than the exponential growth assumption is unlikely to be met on long time periods.
In a real situation, and especially for an emerging disease, several practical problems must be taken into account in the application of these methods. The attack rate method requires the least information, but is only usable when the epidemic is over, and furthermore requires that no intervention was set up during the whole course of an outbreak. Therefore its use is generally limited to particular settings like schools or army platoons, for example [
22]. All other methods require the epidemic curve and the generation time distribution, with the ‘initial’ reproduction ratio as an output. If one assumes that the population was totally susceptible at first, it may also be interpreted as the basic reproduction ratio (R0); a correction will be necessary in the case of a initial partial immunity.
With a truly emerging outbreak, prior knowledge on the generation time distribution may be unavailable. Allowing sensitivity analyses according to the mean generation time, as we described, is therefore important to help quantify uncertainty in this respect. In other cases, estimation of the generation time distribution is relatively straightforward from pairs of infectors/infectees if there is a marked separation between generations; it is more complicated when generations quickly overlap as with influenza [
23]. An additional issue is that symptom onset dates may be known only to an interval, requiring specialized methods for estimation [
24]. Joint-estimation of the generation time distribution and reproduction number is another possibility [
11,
14].
A second step is to choose a time period that displays exponential growth. Too long a time period may depart from true exponential growth and bias estimation downwards, while too short a period may lead to large variance in the estimates. We implemented a method to select the optimal period displaying exponential growth based on the deviance R-squared, a commonly used method to measure goodness of fit of model to data. As shown in Figure
2A, the typical profile of the R-squared deviance presents a maximum that allows selecting the best period.
An implicit assumption in all methods is that all cases are recorded and are linked by a chain of transmission. However, the following issues will arise: missing first cases; under-reporting; unreported cases; reporting delays; importation cases.
If the epidemic is not observed from the first case on, overestimation of the initial reproduction number is likely since some initial cases are absent from the epidemic curve, and secondary cases will be imputed to too few index cases. A correction was implemented for missing generations at the beginning of the epidemic curve for the ML method, similar to that proposed by McBryde in a Bayesian setting [
25] using the assumption of constant reproduction number. No obvious way exists to correct the TD method, as the reproduction ratio is allowed to change with time. The EG and SB methods are, by construction, not dependent on this issue.
No method explicitly accounts for under-reporting during the course of the epidemic. If the under-reporting rate is constant in time, no bias is expected. However, if it is known that under-reporting changed with time, this could be corrected before estimation proceeds, as was done in the US [
26].
Non-reported cases during an outbreak the epidemic are neither accounted for. Treating missing cases as latent observations has been proposed, but requires the grouping of cases in successive generations rather than on a temporal basis [
27].
Importation of cases during the course of the epidemic generally leads to overestimation of the reproduction ratio, since these cases are considered as “offspring” of cases present earlier in the outbreak. In all the methods presented here, only the TD and ML methods can satisfactorily correct for importation cases. The other methods are less easily modified in this respect, and this should be the object of further research.
A final issue is reporting delays, especially when analysis is done in real time. Reporting delays cause a downward bias in incidence in the last few days of observation. This will impact the most the ML and TD estimates, as these rely more heavily on the fit of the model to the observed incidence. In practice, one may wait for data consolidation before applying any method, but it would also be possible to correct for this bias before estimating the reproduction number if the reporting delay is known [
14,
26].
In the simulation study, we identified that all methods would generally be biased downwards for a disease like flu, with bias increasing both with larger aggregation windows and increasing reproduction number. An exception was the EG method, with upward bias for small R values (R<2) and downwards bias for larger values. When incidence data was available on a daily basis, i.e. smaller than the generation time distribution, the characteristics of the four methods compared. The EG method was the least sensitive to changes in aggregation window, while the ML and TD methods were rapidly inconsistent. The SB method was generally not better than the EG method. Best practice in case of an emerging epidemic will likely depend on a combination of reproduction ratio magnitude, mean generation time duration and aggregation detail. We have provided the framework that would allow comparison and critic of these estimates.
Finally, we highlighted that the estimated reproduction ratio may depend on the method for estimation. This should be taken into account in comparisons, and also when calibrating predictive models as small differences can lead to large variation in attack rates and assessment of required efficacy in interventions.
Appendix
Typical session code> library(R0) # loads library> # epidemic curve can be input as a list of dates> epid = c("2012-01-01", "2012-01-02", "2012-01-02", "2012-01-03")> # or as incidence counts> epid.count = c(1,2,4,8)> # create generation time : gamma distribution, with mean 2.6 time units and standard deviation 1 time unit> GT.flu <− generation.time("gamma", c(2.6,1))> # loads example dataset> data(Germany.1918)> res.R <− estimate.R(Germany.1918, GT=GT.flu, methods=c("EG","ML","SB","TD"))# applies methods EG, ML, SB, TD to the dataset> plot(res.R) # diplays results> plotfit(res.R) # displays fit to the epidemic curve# sensitivity analysis according to choice of time window for exponential growth> sensitivity.analysis(Germany.1918, GT.flu, begin=1:15, end=16:30, est.method="EG", sa.type="time")> # sensitivity analysis according to generation time> sensitivity.analysis(Germany.1918, GT.type="gamma", GT.mean=seq(1,5,1), GT.sd.range=1, begin=1, end=27, est.method="EG", sa.type="GT")
Competing interests
The authors declare that they have no competing interests.
Authors’ contributions
TO coded the software, wrote the manuscript. RH researched bibliography. PYB conceived the study, wrote the manuscript. All authors read and approved the final manuscript.