Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

create.disProg

Creating an object of class disProg


Description

Creates an object of class disProg from a vector with the weeknumber (week) and matrices with the observed number of counts (observed) and the respective state chains (state), where each column represents an individual time series. The matrices neighbourhood and populationFrac provide information about neighbouring units and population proportions.

Usage

create.disProg(week, observed, state, start=c(2001,1), freq=52, 
               neighbourhood=NULL, populationFrac=NULL, epochAsDate=FALSE)

Arguments

week

index in the matrix of observations, typically weeks

observed

matrix with parallel time series of counts where rows are time points and columns are the individual time series for unit/area i, i=1,…,m

state

matrix with corresponding states

start

vector of length two denoting the year and the sample number (week, month, etc.) of the first observation

freq

sampling frequency per year, i.e. 52 for weekly data, 12 for monthly data, 13 if 52 weeks are aggregated into 4 week blocks.

neighbourhood

neighbourhood matrix N of dimension m \times m with elements n_{ij}=1 if units i and j are adjacent and 0 otherwise

populationFrac

matrix with corresponding population proportions

epochAsDate

interpret the integers in week as Dates. Default is FALSE

Value

object of class disProg

Author(s)

M. Paul

Examples

# create an univariate disProg object 
# read in salmonella.agona data
salmonella <- read.table(system.file("extdata/salmonella.agona.txt", 
                                     package = "surveillance"), header = TRUE)
# look at data.frame
str(salmonella)

salmonellaDisProg <- create.disProg(week = 1:nrow(salmonella), 
                                    observed = salmonella$observed,
                                    state = salmonella$state,
                                    start = c(1990, 1))

# look at disProg object
salmonellaDisProg

surveillance

Temporal and Spatio-Temporal Modeling and Monitoring of Epidemic Phenomena

v1.19.1
GPL-2
Authors
Michael H<f6>hle [aut, ths] (<https://orcid.org/0000-0002-0423-6702>), Sebastian Meyer [aut, cre] (<https://orcid.org/0000-0002-1791-9449>), Michaela Paul [aut], Leonhard Held [ctb, ths], Howard Burkom [ctb], Thais Correa [ctb], Mathias Hofmann [ctb], Christian Lang [ctb], Juliane Manitz [ctb], Andrea Riebler [ctb], Daniel Saban<e9>s Bov<e9> [ctb], Ma<eb>lle Salmon [ctb], Dirk Schumacher [ctb], Stefan Steiner [ctb], Mikko Virtanen [ctb], Wei Wei [ctb], Valentin Wimmer [ctb], R Core Team [ctb] (A few code segments are modified versions of code from base R)
Initial release
2021-03-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.