noroBE: Create '"sts"' Objects from the Berlin Norovirus Data

Description Usage Arguments Format Author(s) Source References Examples

Description

The function noroBE() creates an "sts" object based on the array of norovirus surveillance counts, the map of Berlin's city district, and the pop2011 data stored in the package. This is the data analysed by Meyer and Held (2017).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
noroBE(
  by = c("districts", "agegroups", "all", "none"),
  agegroups = c(1, 2, 2, 4, 4, 2),
  timeRange = c("2011-w27", "2015-w26"),
  flatten = FALSE
)

counts

map

Arguments

by

character string determining the stratification, i.e., which units the resulting "sts" object should represent:

"districts":

aggregates counts and pop2011 over the age groups and stores the matrix of adjacency orders from the map in the neighbourhood slot. The latter is obtained via nbOrder(poly2adjmat(map), maxlag = 5).

"agegroups":

aggregates counts and pop2011 over the districts and stores the contactmatrix() in the neighbourhood slot, potentially also combining some age groups via the agegroups argument.

"all":

retains both dimensions, either as a list of spatial "sts" objects per age group, or in a single "sts" object (see flatten below).

"none":

creates the overall (univariate) time series of rowSums(counts).

agegroups

how the age groups in counts (and pop2011) should be aggregated. Will be used as the grouping argument in aggregateCountsArray and contactmatrix. The default setting uses the six age groups of Meyer and Held (2017).

timeRange

character vector of length two determining the time range of the "sts" object to generate. The two strings are matched against dimnames(counts)[[1]], which ranges from "2011-w01" until "2016-w30". The default value extracts four seasons (years) starting at "2011-w27".

flatten

logical indicating whether for by = "all" a single "sts" object should be returned where the observation unit is the interaction of district and age group (“flattened” counts array, see as.data.frame.array). By default (flatten = FALSE), a list of district-based "sts" objects is returned, one for each age group.

Format

counts:

an integer-valued array of norovirus surveillance counts with labelled dimensions of size 290 ("week") x 12 ("district") x 15 ("agegroup").

map:

a "SpatialPolygonsDataFrame" of length 12 with row.names(map) matching colnames(counts), representing Berlin's city districts in longlat coordinates (WGS84). The data slot contains the full "NAME"s of the city districts as well as their "POPULATION", i.e., rowSums(pop2011).

The function noroBE() returns an "sts" object generated from these data (and pop2011).

Author(s)

Sebastian Meyer

Source

counts:

based on norovirus surveillance counts retrieved from the SurvStat@RKI 2.0 online service (https://survstat.rki.de) of Germany's public health institute, the Robert Koch Institute, as of 2016-09-08.

map:

based on a KML file of Berlin's 97 local centres (“Ortsteile”) downloaded from the Berlin Open Data repository at https://daten.berlin.de/datensaetze/geometrien-der-ortsteile-von-berlin-juli-2012 as of 2014-11-12, published by Amt fuer Statistik Berlin-Brandenburg (Statistical Office of Berlin-Brandenburg) under the ‘CC BY 3.0 DE’ license (https://creativecommons.org/licenses/by/3.0/de/). The map included here is a gUnaryUnion of these local centres by city district.

References

Meyer S and Held L (2017): Incorporating social contact data in spatio-temporal models for infectious disease spread. Biostatistics, 18 (2), 338-351. doi: 10.1093/biostatistics/kxw051

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## the raw data
str(counts)
summary(map)

## district-specific time series
noroBEr <- noroBE(by = "districts")
plot(noroBEr)

## age group-specific time series
noroBEg <- noroBE(by = "agegroups")
plot(noroBEg)

## list of spatio-temporal surveillance counts, one for each age group
noroBErbyg <- noroBE(by = "all", flatten = FALSE)
plot(noroBErbyg[[1L]], par.list = list(oma=c(0,0,2,0)))
title(main = names(noroBErbyg)[1], outer = TRUE, line = -1)

## flattened "sts" object (the 'neighbourhood' only reflects spatial info)
noroBEall <- noroBE(by = "all", flatten = TRUE)
dev.new(width = 16, height = 7)
plot(noroBEall, par.list = list(
    xaxt = "n", mar = c(1,4,1,1), mfrow = c(ncol(noroBEg), ncol(noroBEr))
))

Example output

Loading required package: surveillance
Loading required package: sp
Loading required package: xtable
This is surveillance 1.18.0. For overview typehelp(surveillance).
 int [1:290, 1:12, 1:15] 0 0 0 0 0 0 0 0 1 2 ...
 - attr(*, "dimnames")=List of 3
  ..$ week    : chr [1:290] "2011-w01" "2011-w02" "2011-w03" "2011-w04" ...
  ..$ district: chr [1:12] "chwi" "frkr" "lich" "mahe" ...
  ..$ agegroup: chr [1:15] "00-04" "05-09" "10-14" "15-19" ...
Object of class SpatialPolygonsDataFrame
Coordinates:
       min      max
x 13.08835 13.76114
y 52.33824 52.67547
Is projected: FALSE 
proj4string :
[+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0]
Data attributes:
     NAME             POPULATION    
 Length:12          Min.   :228919  
 Class :character   1st Qu.:250984  
 Mode  :character   Median :286192  
                    Mean   :291823  
                    3rd Qu.:326718  
                    Max.   :375938  
Warning message:
In wkt(obj) : CRS object has no comment

hhh4contacts documentation built on March 20, 2020, 5:07 p.m.