Biology Reference
In-Depth Information
In what follows, focus will be on aberration detection methods. A pre-
requisite to their use is an understanding of the data structure and related
access and visualization methods for the data.
12.2.1 Data Structure and Data input
The S4 class sts (an abbreviation for “surveillance time series”) provides
a data structure for handling the multivariate time series of counts of the
form { y it ; i=1,…,m, t= 1 ,…,n }. Here, n denotes the length of the time series, and
m denotes the number of entities being monitored, for example, geographi-
cal regions, hospitals, or age groups. A slot observed of sts contains an
n × m matrix representing the y it counts. The slot start denotes the origin of
the time series given by a vector of length two containing the year and the
epoch within that year. Furthermore, freq denotes the number of observa-
tions per year, for example, 365 for daily data, 52 for weekly data, and 12 for
monthly data. An integer slot epoch denotes the time index 1 ≤ t n of each
row in observed.
To import data into R and surveillance , one can use R's read.table
or read.csv functions to read ASCII text or comma-separated value files.
A different option is to use the package foreign to import SAS, SPSS, Stata
or dBase files or the RODBC database interface to import from Microsoft
Access/Excel or SQL databases. An sts object is then created from the result-
ing matrix of counts. We start the analysis of the Danish 1994-2008 mortality
data by reading a CSV file (782 rows and 8 columns) containing the weekly
number of all-cause mortality, and use this to create an sts object.
R> momo.ts <- read.csv ("mortality-dk.csv", header = TRUE,
check.names = FALSE)
R> dates <- as.Date ("1994-01-03") + 7 * 0:(nrow(momo.ts) - 1)
R> momo <- new("sts", epoch = as.numeric(dates), start = c(1994,
1), freq = 52, observed = momo.ts, epochAsDate = TRUE)
The eight columns correspond to the eight age groups <1, 1-4, 5-14, 15-44,
45-64, 65-74, 75-84, and ≥85 years as defined by the EuroMOMO project to be a
relevant age stratification. Deaths are registered by the day of death. A special
feature of the EuroMOMO data is that weeks are handled as defined by the
ISO 8601 standard (Anonymous, 2004). This standard defines week-numbering
for a year to start at the first Monday of week 01 and to end at the last Sunday
before the new ISO year. Here, week 01 of a year is the week with the year's first
Thursday in it. As a consequence, a year consists of either 52 or 53 full weeks.
Usually, one operates in surveillance with a fixed number of epochs per
period, for example, 52 weeks per year as given by the freq argument. But
by specifically setting the epoch slot to a numeric representation of the cor-
responding Monday of each week and setting the epochAsDate attribute, we
can use the Date class in R to easily handle this ISO week complication.
Search WWH ::




Custom Search