attrMort {FluMoDL} | R Documentation |
Influenza- and temperature-attributable mortality for a FluMoDL object
Description
This function uses an object of class FluMoDL
to calculate mortality
attributed to influenza and/or temperature.
Usage
attrMort(m, par = c("H1", "H3", "B", "temp", "RSV"), sel = "week",
from = NULL, to = NULL, temprange = "cold", ci = TRUE,
nsim = 5000, mcsamples = FALSE, progress = TRUE, blup = FALSE)
Arguments
m |
An object of class |
par |
A character vector indicating which exposures to calculate the
attributable mortality for. Defaults to |
sel |
For which time period(s) to calculate attributable mortality. This can be
one of several choices. For |
from |
Week (integer, in YYYYWW format) or season to start from, in case
|
to |
Week (integer, in YYYYWW format) or season to end with, in case
|
temprange |
In case temperature-attributable mortality is calculated (argument
If Alternatively one can provide a numeric vector of length two, indicating a specific temperature range; this can also be provided as a character vector of length two, where one of the elements can be the word "MMP", which will be replaced with the MMP temperature. |
ci |
If |
nsim |
Number of Monte Carlo simulations to run per attributable mortality estimate. Defaults to 5000. Increase if higher precision is required (and you don't mind the wait). |
mcsamples |
If |
progress |
If |
blup |
If |
Details
All attributable mortalities are calculated using the "backward" perspective, meaning the mortality at any given day that is attributable to exposures up to 30 days previously (=the maximum lag).
Confidence intervals (when ci=TRUE
) are obtained empirically through Monte Carlo
simulations; this can take quite some time if lots of CIs need to be calculated (for example
if sel=TRUE
). For this reason, a progress bar is shown by default in this case
(which can be suppressed by progress=FALSE
).
Temperature-attributable mortalities are by default calculated for cold temperatures, i.e.
temperatures lower than the minimum mortality point (MMP). Note, however, that the adjustment
in the FluMoDL is made for the entire range of daily mean temperatures, not just for cold.
Therefore mortality attributable to any range of temperatures can be calculated, e.g. for
heat, extreme cold, extreme heat, etc. See argument temprange
above for details.
Value
If mcsamples=FALSE
(the default), a data.frame is returned with columns named
'FluH1', 'FluH3', 'FluB' and 'Temp' (and/or 'RSV'), depending on the argument par
,
and also 'FluH1.lo', 'FluH1.hi', 'FluH3.lo', ..., if ci=TRUE
. Each row in the output
corresponds to a selection
made in argument sel
, for example if sel="week"
(the default) rows correspond to
each week available in the data. If all influenza types/subtypes are selected in par
, a
column named 'AllFlu' is also calculated automatically, with the mortality (and 95
attributable to all influenza types/subtypes.
If mcsamples=TRUE
, a list is returned with elements 'result' and 'mcsamples'. The
first contains the data.frame with point estimates of influenza- and/or temperature-attributable
mortality, as before (no 95
element contains a list of the Monte Carlo simulation samples for each parameter in par
.
References
Lytras T, Pantavou K, Mouratidou E, Tsiodras S. Mortality attributable to seasonal influenza in Greece, 2013 to 2017: variation by type/subtype and age, and a possible harvesting effect. Euro Surveill. 2019;24(14):pii=1800118 (PubMed)
Gasparrini A, Leone M. Attributable risk from distributed lag models. BMC Med Res Methodol 2014;14:55.
Examples
data(greece) # Use example surveillance data from Greece
m <- with(greece, fitFluMoDL(deaths = daily$deaths,
temp = daily$temp, dates = daily$date,
proxyH1 = weekly$ILI * weekly$ppH1,
proxyH3 = weekly$ILI * weekly$ppH3,
proxyB = weekly$ILI * weekly$ppB,
yearweek = weekly$yearweek))
# Calculate influenza-attributable estimates by season, until 2016-17:
attr1 <- attrMort(m, par=c("H1","H3","B"), sel="season", to=2016)
attr1
# Calculate influenza-attributable estimates by week, only point
# estimates, for the 2014-15 season:
attr2 <- attrMort(m, par=c("H1","H3","B"), sel="week",
from=201440, to=201520, ci=FALSE)
attr2
# Calculate mortality attributable to temperatures below 5 celsius, for
# the period of January 2017:
attr3 <- attrMort(m, par="temp",
sel=with(m$data, which(dates>="2017-1-1" & dates<="2017-1-31")),
temprange=c(5,-20))
# Calculate attributable mortalities for the entire 2017-18 season, and
# return the Monte Carlo simulation samples in the output
attr4 <- attrMort(m, sel="season", from=2017, to=2017, mcsamples=TRUE)