View source: R/syndromicW-function.r
syndromicW | R Documentation |
syndromicW
from pre-cleaned data.Syndromic is the main class of the package. Two versions are available,
syndromicD
, which is intended for use when data are to be monitored daily,
and syndromicW
, which is to be used when data are monitored weekly.
syndromicW(observed, dates = data.frame(), min.week = NULL, max.week = NULL, min.year = NULL, max.year = NULL, baseline = matrix(nrow = 0, ncol = 0), alarms = array(dim = 0), UCL = array(dim = 0), LCL = array(dim = 0), formula = list())
observed |
A |
dates |
A |
min.week |
Alternative to providing dates: the user can specify the
minimum week-year, and the maximum week-year,
and the function will generate
a complete sequence of weeks between them. This is the recommended use
of the function because then additional date variables will also be created
and assigned to the slot dates, such as ISOweek, year and numerical weeks.
Note that the sequence must match the number of rows
in the matrix |
max.week |
see min.week above |
min.year |
see min.week above |
max.year |
see min.week above |
baseline |
Optional argument. A |
alarms |
Optional argument. An |
UCL |
Optional argument. An |
LCL |
Lower control limit. See UCL above. |
formula |
A formula, or list of formulas, specifying the regression formula to be used when removing temporal patterns from each of the syndromes in @observed. For instance formula=list(y~dow+mon) for a single syndrome, where regression must take into account the variables dow (day-of-week) and month; or formula=c(y~dow, y~dow+mon) specifying two different formulas for two syndromes. The names of the variables given should exist in the columns of the slot @dates. Make sure that formulas' index match the columns in observed (for instance the second formula should correspond to the second syndrome, or second column in the observed matrix).You can provide NA for syndromes which should not be associated with any formula. This parameter is often only filled after some analysis in the data, not at the time of object creation. |
The observed data are assumed to be formatted as a matrix
, in
which each row corresponds to an observation time point (here, WEEKS),
columns correspond to each syndromic group to be monitored, and the
numbers refer to the number of observatiosn per group per time point.
For an example of data formatted this way use date(observedW). For data
not formatted use directly the function raw_to_syndromicW
.
The dates are expected to be a data.frame
with the first column
in the ISOweek
format, though the function will also accept a
minimum and maximum week, and take care of constructing the appropriate
data frame (this is the recommended use).
an object of the class syndromicW
with the slots
corresponding to the parameters described. See class-syndromic
for more details.
data(observedW) my.syndromicW <- syndromicW(observed,min.week=1, min.year=2011, max.week=22, max.year=2013)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.