sts-class {surveillance}R Documentation

Class "sts" – surveillance time series

Description

This is a rather leightweight class to implement multivariate time series of count used for public health surveillance data. The class captures the time series data as well as the spatial layout of the regions, where the data originate from.

Slots

week:
Object of class numeric specifying the week numbers. Actually this is not really used at the moment.
freq:
If weekly data freq corresponds to 52, in case of monthly data freq is 12.
start:
vector of length two denoting the year and the sample number (week, month, etc.) of the first observation
observed:
A matrix of size length(week) times the number of regions containing the weekly/monthly number of counts in each region. The colnames of the matrix should match the ID values of the shapes in the map slot.
state:
Matrix with the same dimension as observed containing booleans whether at the specific time point there was an outbreak in the region
alarm:
Matrix with the same dimension as observed specifying whether an outbreak detection algorithm declared a specific time point in the region as having an alarm. If the object containins just observations then this slot is null.
upperbound:
Matrix with upper bound values
neighbourhood:
Symmetric matrix of booleans size (number of regions)^2 stating the neighbourhood matrix.
populationFrac:
Object of class matrix.
map:
Object of class SpatialPolygonsDataFrame providing a shape of the areas which are monitored.
control:
Object of class list, thais is a rather free data type to be returned by the surveillance algorithms.
epochAsDate:
Object of class "logical" stating whether to use a ISO 8601 representation of the epoch/week slot using the Date class (epochAsDate=TRUE) or just to interpret the epochs/weeks as numerics (epochAsDate=FALSE).
multinomialTS:
Object of class "logical" stating whether to interpret the object as observed out of population, i.e. a multinomial interpretation instead of a count interpretation.

Methods

nrow
signature(x = "sts"): extract number of rows of the observed matrix slot. The dimension of the other matrix slots is similar.
ncol
signature(x = "sts"): extract number of columns of the observed matrix slot.
dim
signature(x = "sts"): extract matrix dimensions of observed using dim.
observed
signature(x = "sts"): extract the observed slot of an sts object.
population
signature(x = "sts"): extract the population slot of an sts object.
alarms
signature(x = "sts"): extract the alarm slot of an sts object.
upperbound
signature(x = "sts"): extract the upperbound slot of an sts object.
control
signature(x = "sts"): extract the control slot of an sts object.
epoch
signature(x = "sts"): extract the epoch slot of an sts object. If ISO dates are used then the returned object is of class Date.
epochInYear
signature(x = "sts"): Returns the epoch number within the year of the epoch slot.
colnames
signature(x="sts",do.NULL="missing",prefix="missing"): extract colnames of the observed matrix.
initialize
signature(x="sts"): the internal function init.sts is called, which assigns all slots.
aggregate
signature(x="sts"): see aggregate,sts-method
year
signature(x = "sts"): extracts the corresponding year of each observation of x
obsinyear
signature(x = "sts"): extracts the corresponding week number within the year of each observation of x
as.data.frame
signature(x = "sts"): converts the observed, week, state and alarm slots of x into a data frame with column names matching the colnames of the respective slots. Useful when one wants to fit a model based on the object
plot
signature(x="sts",y="missing",function(x, y, type,...)...): this function is the successor of the plot.disProg and plot.survRes functions. It takes (more or less) the same arguments as plot.survRes. The most important difference is the type of plot, which is specified using type. See show,sts-method for details.

Author(s)

M. Höhle

Examples

  data("ha")
  shp <- system.file("shapes/berlin.shp",package="surveillance")
  ha <- disProg2sts(ha, map=readShapePoly(shp,IDvar="SNAME"))
  plot(ha,type=observed ~ 1 | unit)


[Package surveillance version 1.1-2 Index]