adjustIncidence: Correct incidence data with notification delay (nowcasting).

Description Usage Arguments Value Examples

View source: R/adjust_incidence_functions.R

Description

This function estimate the time series of reported cases by adding the cases that will be reported in the future. Two methods were implemented, the "fixedprob" requires knowing the probability of notification per week passed. This function assumes a stationary notification process, there is, no influence of covariates or any temporal inhomogeneity. The "bayesian" is dynamic.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
adjustIncidence(
  obj,
  method = "fixedprob",
  pdig = plnorm((1:20) * 7, 2.5016, 1.1013),
  Dmax = 10,
  nyears = 2,
  datasource = con,
  nowSE,
  safelimit = 5
)

Arguments

obj

data.frame with crude weekly cases (not adjusted). This data.frame comes from the getCases function (if withdivision = FALSE), of getCases followed by casesinlocality (if dataframe is available per bairro)

method

"fixedprob" for fixed delay prob per week; "bayesian" for the dynamic model . If "none" just repeats case values

pdig

for the "fixedprob" method. It is a vector of probability of been typed in the database up to 1, 2, 3, n, weeks after symptoms onset. The length of the vector corresponds to the maximum delay. After day, it is assumed that p = 1. The default was obtained from Rio de Janeiro.

Dmax

for the "bayesian" method. Maximum number of weeks that is modeled

nyears

for the "bayesian" method. Number of years of data used for fitting the model

nowSE

for the "bayesian" method. Epidemiological week to be considered for the nowcast. If NA, the maximum SE in obj is used.

safelimit

if median estimate is larger than 'safelimit' times 'sum(tail(cases, n=5))', nowcasting fails.

Value

data.frame with pdig (proportion reported), median and 95percent confidence interval for the predicted cases-to-be-notified)

Examples

1
2
3
4
5
6
7
8
# fixedprob
d <- getCases(cities = 2304400, dataini = "sinpri",  completetail = 0) 
tail(d)
resfit<-adjustIncidence(obj = d)
tail(resfit)
# bayesian
resfit2<-adjustIncidence(obj=d, method = "bayesian", nowSE = 202111, datasource = con)
tail(resfit2)

claudia-codeco/AlertTools documentation built on Aug. 12, 2021, 9:58 a.m.