Learn R Programming

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

The stable package can be installed from the official R repositories (CRAN) using the built-in install function (or from the package manager in some GUIs for R):

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

Or from the official repository:

if(!require("devtools")) install.packages("devtools")
library("devtools")
# install the mem stable version from GitHub
install_github("lozalojo/mem", ref = "master")

To install the development version of mem use the devtools package.

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

Web application

There is a package that acts as a Graphical User Interface (GUI) for mem. The package is called memapp, you can find more information on the official repository:

memapp repository

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

439

Version

2.18

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Lozano Jose E.

Last Published

June 20th, 2023

Functions in mem (2.18)

extraer.datos.pre.epi

Extract pre-epidemic hightest rates
flucylraw

Castilla y Leon influenza standarised rates
full.series.graph

Creates the historical series graph of the datasets
extraer.datos.post.epi

Extract post-epidemic hightest rates
iconfianza

generic confidence interval calculation function
fill.missing

fills in missing values inside the season with smoothing regression
get.dates

create epidemiological calendar
flucyl

Castilla y Leon influenza crude rates
epimem

Deprecated function(s) in the mem package
create.calendar

create epidemiological calendar
get.epiweek

create epidemiological calendar
extraer.datos.optimo.map

Extract optimum
iconfianza.logx

confidence interval for a point (using log transformation and geometric mean)
extraer.datos.epi

Extract epidemic hightest rates
iconfianza.geometrica

confidence interval for the geometric mean using the log-normal approximation
iconfianza.completo

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

Methods for influenza modelization
iconfianza.percentil.boot

confidence interval por the median using bootstrap methods
memintensity

Thresholds for influenza intensity
iconfianza.aritmetica

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

confidence interval por the median using KC Method
iconfianza.percentil.eqnpar

confidence interval por the median using KC Method
memsurveillance.animated

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

standarize data to [0,1] interval
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
memstability

Stability of indicators
memsurveillance

Creates the surveillance graph of the current season
maxFixNA

max function, removing Inf and -Inf
iconfianza.x

confidence interval for a point (using arithmetic mean)
suavizado

smoothing regression function
transformdata

Data transformation
mem-package

mem: The Moving Epidemic Method
maxnvalores

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

Evolution of estimators
missings.inside

returns position of missing values inside the season. Leading and trailing missing values are not considered.
minnvalores

lowest n values of a data set, removing Inf and -Inf
memtiming

Influenza Epidemic Timing
optimum.by.inspection

Inspection calcultation of the optimum
output.ci

function to format output
transformseries.spline

spline transformation
minFixNA

min function, removing Inf and -Inf
roc.analysis

Analysis of different indicators to find the optimum value of the window parameter
semana.absoluta

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

Methods for influenza trend calculation
transformseries.loess

loess transformation
transformdata.back

Data transformation
transformseries.moving.average

moving average transformation
transformseries

Transformation of series of data
transformseries.twowaves

adjust a mixed model of two normal distributions
memgoodness

Goodness of fit of the mem
percentage.added

For use with transformseries.multiple
processPlots

Full process plots for mem
transformseries.multiple

divide a series in parts
transformseries.odd

odd transformation
calcular.optimo.derivada

calculates optimum: second derivative equals 0 (change signs from - to +, or + to -)
calcular.optimo.original

calculates optimum: original method: second derivative + axis change
comparar.metodos

Compares outputs from two methods of locating the epidemic
calcular.indicadores

Calculates specificity and sensitivity
calcular.optimo.pendiente

calculates optimum: slope matches the overall slope
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.indicadores.2.timings

Calculates specificity and sensitivity
extraer.datos.curva.map

Extract map curve
calcular.map

calculates map curve
epitiming

Deprecated function(s) in the mem package
calcular.optimo

calculates optimum generic function
calcular.optimo.criterio

calculates optimum: fixed criteria for slope