
Determine the short term trend of a surveillance time series
Source:R/short_term_trend_sts_v1.R
short_term_trend_sts_v1.RdFits a quasi-Poisson regression over a moving window of recent observations of
a surveillance sts object. It sets the alarm slot to 1 for
time points with a significant increasing trend, and to 0 otherwise. The method is
based upon a published analytics strategy by Benedetti (2019)
<doi:10.5588/pha.19.0002>. This function was frozen on 2024-06-24 and operates
on sts objects.
Usage
short_term_trend_sts_v1(sts, control = list(w = 5, alpha = 0.05))See also
Neither package vignette covers this function. It is the
surveillance::sts form of the deprecated `csfmt_rts_data_v1` trend
method of short_term_trend, whose help page carries the only
worked example of that method.
Examples
d <- cstidy::nor_covid19_icu_and_hospitalization_csfmt_rts_v1
d <- d[granularity_time=="isoyearweek"]
sts <- surveillance::sts(
observed = d$hospitalization_with_covid19_as_primary_cause_n, # weekly number of cases
start = c(d$isoyear[1], d$isoweek[1]), # first week of the time series
frequency = 52
)
x <- csalert::short_term_trend_sts_v1(
sts,
control = list(
w = 5,
alpha = 0.05
)
)
plot(x)