Learn R Programming

⚠️There's a newer version (2.19) of this package.Take me there.

The Moving Epidemic Method R Package

Overview

The Moving Epidemics Method MEM is a tool developed in the Health Sentinel Network of Castilla y León (Spain) to help in the routine influenza surveillance in health systems. It gives a better understanding of the annual influenza epidemics and allows the weekly assessment of the epidemic status and intensity.

Although in its conception it was originally created to be used with influenza data and health sentinel networks, MEM has been tested with different respiratory infectious diseases and surveillance systems so nowadays it could be used with any parameter which present a seasonal accumulation of cases that can be considered an epidemic.

MEM development started in 2001 and the first record appeared in 2003 in the Options for the Control of Influenza V. It was presented to the baselines working group of the European Influenza Surveillance Scheme (EISS) in the 12th EISS Annual Meeting (Malaga, Spain, 2007), with whom started a collaboration that continued when, in 2008, was established the European Influenza Surveillance Network.

In 2009 MEM is referenced in an official European document: the Who European guidance for influenza surveillance in humans. A year later MEM was implemented in The European Surveillance System (TESSy), of the European Centre for Disease Prevention and Control (ECDC), and in 2012, after a year piloting, in the EuroFlu regional influenza surveillance platform, of the World Health Organization Regional Office for Europe (WHO-E).

As a result of the collaboration with ECDC and WHO-E, two papers have been published, one related to the establishment of epidemic thresholds and other to the comparison of intensity levels in Europe.

Installation

To install the lastest stable version from the official R repositories (CRAN):

# install the mem CRAN version
install.packages("mem")

To install the lastest development version of mem.

if(!require("devtools")) install.packages("devtools")
library("devtools")
# install the memapp development version from GitHub
install_github("lozalojo/mem", branch = "development")

Usage

# load the library
library("mem")

# run the help
help("mem")

References

Vega T, Lozano JE, Ortiz de Lejarazu R, Gutierrez Perez M. Modelling influenza epidemic—can we detect the beginning and predict the intensity and duration? Int Congr Ser. 2004 Jun;1263:281–3.

Vega T, Lozano JE, Meerhoff T, Snacken R, Mott J, Ortiz de Lejarazu R, et al. Influenza surveillance in Europe: establishing epidemic thresholds by the moving epidemic method. Influenza Other Respir Viruses. 2013 Jul;7(4):546–58. DOI:10.1111/j.1750-2659.2012.00422.x.

Vega T, Lozano JE, Meerhoff T, Snacken R, Beaute J, Jorgensen P, et al. Influenza surveillance in Europe: comparing intensity levels calculated using the moving epidemic method. Influenza Other Respir Viruses. 2015 Sep;9(5):234–46. DOI:10.1111/irv.12330.

Lozano JE. lozalojo/mem: Second release of the MEM R library. Zenodo [Internet]. [cited 2017 Feb 1]; Available from: https://zenodo.org/record/165983.

Lozano JE. lozalojo/memapp: Second release of the MEM Shiny Web Application R package. Zenodo [Internet]. [cited 2018 Feb 15]; Available from: https://zenodo.org/record/1173518.

Copy Link

Version

Install

install.packages('mem')

Monthly Downloads

762

Version

2.17

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Lozano Jose E.

Last Published

April 13th, 2022

Functions in mem (2.17)

iconfianza.logx

confidence interval for a point (using log transformation and geometric mean)
epitiming

Deprecated function(s) in the mem package
extraer.datos.optimo.map

Extract optimum
extraer.datos.epi

Extract epidemic hightest rates
iconfianza.percentil.boot

confidence interval por the median using bootstrap methods
iconfianza.completo

Int. Confianza de 2 y 1 cola, por encima y por debajo. De la media y el punto.
flucylraw

Castilla y Leon influenza standarised rates
extraer.datos.curva.map

Extract map curve
iconfianza.percentil.eqnpar

confidence interval por the median using KC Method
iconfianza.aritmetica

confidence interval for the arithmetic mean using the normal approximation
iconfianza.percentil.kc

confidence interval por the median using KC Method
iconfianza

generic confidence interval calculation function
mem-package

mem: The Moving Epidemic Method
max.n.valores

highest n values of a data set, removing Inf and -Inf
memintensity

Thresholds for influenza intensity
get.dates

create epidemiological calendar
get.epiweek

create epidemiological calendar
memmodel

Methods for influenza modelization
iconfianza.geometrica

confidence interval for the geometric mean using the log-normal approximation
flucyl

Castilla y Leon influenza crude rates
iconfianza.x

confidence interval for a point (using arithmetic mean)
fill.missing

fills in missing values inside the season with smoothing regression
full.series.graph

Creates the historical series graph of the datasets
min.fix.na

min function, removing Inf and -Inf
memevolution

Evolution of estimators
memgoodness

Goodness of fit of the mem
memstability

Stability of indicators
max.fix.na

max function, removing Inf and -Inf
memtrend

Methods for influenza trend calculation
memsurveillance.animated

Creates the animated graph of the surveillance of the current season
normalizar

standarize data to [0,1] interval
memtiming

Influenza Epidemic Timing
semana.absoluta

Transforms relative weeks to absolute weeks in a 1-52 normal season
transformseries

Transformation of series of data
transformdata.back

Data transformation
roc.analysis

Analysis of different indicators to find the optimum value of the window parameter
memsurveillance

Creates the surveillance graph of the current season
transformdata

Data transformation
suavizado

smoothing regression function
transformseries.twowaves

adjust a mixed model of two normal distributions
transformseries.odd

odd transformation
transformseries.multiple

divide a series in parts
transformseries.loess

loess transformation
optimal.tickmarks

Find tickmarks for a given range of the y-axis that best fit an optimal number of tickmarks you decide. f.i: what if i want to have a graph with 8 tickmarks in a range of 34 to 345
processPlots

Full process plots for mem
percentage.added

For use with transformseries.multiple
transformseries.spline

spline transformation
optimum.by.inspection

Inspection calcultation of the optimum
output.ci

function to format output
min.n.valores

lowest n values of a data set, removing Inf and -Inf
missings.inside

returns position of missing values inside the season. Leading and trailing missing values are not considered.
calcular.optimo.original

calculates optimum: original method: second derivative + axis change
calcular.indicadores.2.timings

Calculates specificity and sensitivity
add.alpha

Add an alpha value to a colour http://www.magesblog.com/2013/04/how-to-change-alpha-value-of-colours-in.html
calcular.optimo

calculates optimum generic function
calcular.indicadores

Calculates specificity and sensitivity
calcular.map

calculates map curve
comparar.metodos

Compares outputs from two methods of locating the epidemic
calcular.optimo.pendiente

calculates optimum: slope matches the overall slope
create.calendar

create epidemiological calendar
calcular.optimo.criterio

calculates optimum: fixed criteria for slope
calcular.optimo.derivada

calculates optimum: second derivative equals 0 (change signs from - to +, or + to -)
epimem

Deprecated function(s) in the mem package
extraer.datos.post.epi

Extract post-epidemic hightest rates
extraer.datos.pre.epi

Extract pre-epidemic hightest rates