Learn R Programming

surveillance (version 1.2-1)

algo.farrington: Surveillance for a time series using the Farrington procedure.

Description

The function takes range values of the time series counts and for each uses a GLM to predict the number of counts according to the procedure by Farrington et. al. This is then compared to the observed number of counts and in case an exceedance of the confidence interval calculated is seen an alarm is raised.

Usage

algo.farrington(disProgObj, control=list(range=NULL, b=3, w=3,
  reweight=TRUE,verbose=FALSE,alpha=0.01,trend=TRUE,limit54=c(5,4),
  powertrans="2/3",fitFun=c("algo.farrington.fitGLM.fast","algo.farrington.fitGLM")))

Arguments

disProgObj
object of class disProgObj (including the observed and the state chain)
control
Control object
  • range
{Specifies the index of all timepoints which should be tested. If range is NULL the maximum number of possible weeks is used.} b{how many years back in time to include when forming th

Value

  • An object of class SurvRes.

encoding

latin1

source

A statistical algorithm for the early detection of outbreaks of infectious disease, Farrington, C.P., Andrews, N.J, Beale A.D. and Catchpole, M.A. (1996). , J. R. Statist. Soc. A, 159, 547-563.

Details

The following steps are perfomed according to the Farrington et. al. (1996) paper.
  1. fit of the initial model and initial estimation of mean and overdispersion.
  2. calculation of the weights omega (correction for past outbreaks)
  3. refitting of the model
  4. revised estimation of overdispersion
  5. rescaled model
  6. omission of the trend, if it is not significant
  7. repetition of the whole procedure
  8. calculation of the threshold value
  9. computation of exceedance score

See Also

algo.farrington.fitGLM,algo.farrington.threshold

Examples

Run this code
#Read Salmonella Agona data
data("salmonella.agona")

#Do surveillance for the last 100 weeks.
n <- length(salmonella.agona$observed)
#Set control parameters.
control <- list(b=4,w=3,range=(n-100):n,reweight=TRUE, verbose=FALSE,alpha=0.01)
res <- algo.farrington(salmonella.agona,control=control)
#Plot the result.
plot(res,disease="Salmonella Agona",method="Farrington")

#Generate random data and convert into sts object
set.seed(123)
x <- matrix(rpois(1000,lambda=1),ncol=1)
sts <- new("sts", observed=x, epoch=1:nrow(x), state=x*0, freq=52)

#Compare timing of the two possible fitters for algo.farrington (here using S4)
system.time( sts1 <- farrington(sts, control=list(range=c(500:1000),fitFun="algo.farrington.fitGLM.fast")))
system.time( sts2 <- farrington(sts, control=list(range=c(500:1000),fitFun="algo.farrington.fitGLM")))

#Check if results are the same
sum(upperbound(sts1) - upperbound(sts2))

Run the code above in your browser using DataLab