View source: R/adjust_incidence_functions.R
adjustIncidence | R Documentation |
This function estimate the time series of reported cases by adding the cases that will be reported in the future.
adjustIncidence(
obj,
datas,
method = "none",
pdig = plnorm((1:20) * 7, 2.5016, 1.1013),
Dmax = 10,
nyears = 2,
datasource = con,
nowSE,
safelimit = 5,
...
)
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) |
datas |
data.frame with notification data. Requires: municipio_geocodigo, dt_sin_pro, dt_digita, dt_notific. |
method |
"bayesian" or "none". The later 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. DEPRECATED. |
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. |
data.frame with median and 95percent confidence interval for the predicted cases-to-be-notified
muns <- getCidades(uf = "Acre", regional = "Baixo Acre e Purus")
t1 <- Sys.time()
d <- getCases(cities = muns$municipio_geocodigo, dataini = "sinpri")
d <- getCases(cities = 3302700, dataini = "sinpri")
dd <- d[d$cidade == 1200401,]
t1 <- Sys.time()
resfit0<-adjustIncidence(obj=dd, method = "bayesian", nowSE = 202414,
interation = TRUE, datasource = con)
t2 <- Sys.time()
message(paste("total time was", t2-t1))
# Using argument 'datas' is good to save time with dataset access
t1 <- Sys.time()
load("caselist.RData") # output of getCases
resfit<-adjustIncidence(obj=dd, datas = caselist, method = "bayesian",
nowSE = 202414,datasource = con)
t2 <- Sys.time()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.