Construct seasonal plots of various styles for a given time series. The series can automatically detrended as needed.
seasplot(y, m = NULL, s = NULL, trend = NULL, colour = NULL,
alpha = 0.05, outplot = c(1, 0, 2, 3, 4, 5),
decomposition = c("multiplicative", "additive", "auto"), cma = NULL,
labels = NULL, ...)
input time series. Can be ts
object.
seasonal period. If y
is a ts
object then the default is its frequency.
starting period in the season. If y
is a ts
object then this is picked up from y
.
if TRUE
, then presence of trend is assumed and removed. If FALSE
no trend is assumed. Use NULL
to identify automatically.
single colour override for plots.
significance level for statistical tests.
type of seasonal plot
0: none.
1: seasonal diagram.
2: seasonal boxplots.
3: seasonal subseries.
4: seasonal distribution.
5: seasonal density.
type of seasonal decomposition. This can be "multiplicative"
, "additive"
or "auto"
. If y
contains non-positive values then this is forced to "additive"
.
input precalculated level/trend for the analysis. This overrides trend=NULL
.
external labels for the seasonal periods. Use NULL
for none. If length(labels) < m
, then this input is ignored.
additional arguments passed to plotting functions. For example, use main=""
to replace the title.
An object of class seasexpl
containing:
season
: matrix of (detrended) seasonal elements.
season.exist
: TRUE
/FALSE
results of seasonality test.
season.pval
: p-value of seasonality test (Friedman test).
trend
: CMA estimate (using cmav
) or NULL
if trend=FALSE
.
trend.exist
: TRUE
/FALSE
results of trend test.
trend.pval
: p-value of trend test (Cox-Stuart).
decomposition
: type of decomposition used.
# NOT RUN {
seasplot(referrals,outplot=1)
# }
Run the code above in your browser using DataLab