help for ^sssplot^

Seasonal subseries plot (month plot or cycle plot) --------------------------------------------------

^sssplot^ datavar monthvar yearvar [^if^ exp] [^in^ range] [ ^, st^art^(^#^) sf(^string^) la(^string^) gbym f(^#^)^ graph_options ]

Description -----------

^sssplot^ produces a graph of datavar by monthvar and yearvar. In practice datavar may be raw data or the seasonal component of such data.

The descriptors monthvar and yearvar are used for concreteness. The plot may be useful whenever periods (e.g. years) are divided into a fixed number of shorter periods (e.g. months, quarters).

monthvar by default should be a variable taking on values 1,...,12 for the 12 months. The data are sorted by month and then by year, so that the series is split into 12 monthly subseries.

However, if the ^f()^ option is used, monthvar should be a variable taking on values 1,...,^f^. The data are in that case plotted as ^f^ subseries.

Hereafter, for `month' and for `year' read strictly `shorter period' and `longer period'.

The data are also sorted so that ^c(L)^ can be used to connect data points, without connections across periods with missing values. ^c(l)^ is not advised as a consequence.

Terminology for this plot is not stable. See notes with References.

Options -------

^start(^#^)^ indicates the first month plotted on the x axis. Default 1. This option may be used whenever there is some better natural start to the year than (say) January.

^sf(^string^)^ calculates a summary function to be shown for each month. The summary function may be any function acceptable to ^egen^ that has syntax like

^egen^ newvar = ^mean(^datavar^), by(^monthvar^)^

^mean^ and ^median^ are the most obvious possibilities.

If ^sf^ is used, two variables -- the data and the summary -- are plotted on the y axis. Graph options such as ^c( )^ and ^sy( )^ should be specified accordingly. The defaults are ^c(.L) sy(oi)^.

^la(^string^)^ gives labels for the months. Default ^Jan^ ... ^Dec^ for ^f^ = 12 and ^JFM AMJ JAS OND^ for ^f^ = 4. Labels should be separated by spaces. They should be specified in the sort order of monthvar, that is before the rotation implied by ^start^ other than 1.

^gbym^ indicates that graphs are to be shown separately for each month. Year is on the x axis.

^f(^#^)^ indicates that data are for # shorter periods within each longer period.

graph_options are options allowed with ^graph, twoway^.

Examples --------

^. sssplot runoff month year, c(L) sy(i)^ ^. sssplot runoff month year, c(L) sy(i) st(7)^ ^. sssplot runoff month year, sf(median) c(||) sy(ii)^ ^. sssplot runoff month year, sf(median) c(L.) sy(i.) gbym^ ^. sssplot GDP quarter year, f(4) c(L) sy(i)^ ^ la(Winter Spring Summer Autumn)^

References ----------

Becker, R.A., Chambers, J.M. and Wilks, A.R. 1988. The new S language: a programming environment for data analysis and graphics. Wadsworth & Brooks/Cole, Pacific Grove, CA, pp.508-509. [month plot]

Cleveland, R.B., Cleveland, W.S., McRae, J.E. and Terpenning, I. 1990. STL: a seasonal-trend decomposition procedure based on loess. Journal of Official Statistics 6, 3-73. [cycle-subseries plot]

Cleveland, W.S. 1993. Visualizing data. Hobart Press, Summit, NJ, pp.164-165. [cycle plot]

Cleveland, W.S. 1994. The elements of graphing data. Hobart Press, Summit, NJ, pp.186-187. [cycle plot]

Cleveland, W.S. and Devlin, S.J. 1980. Calendar effects in monthly time series: detection by spectrum analysis and graphical methods. Journal, American Statistical Association 75, 487-496. [seasonal-by-month plot]

Cleveland, W.S., Freeny, A.E. and Graedel, T.E. 1983. The seasonal component of atmospheric CO2: information from new approaches to the decomposition of seasonal time series. Journal of Geophysical Research 88, 10934-10946. [seasonal subseries plot]

Cleveland, W.S. and Terpenning, I.J. 1982. Graphical methods for seasonal adjustment. Journal, American Statistical Association 77, 52-62. [seasonal subseries plot]

Author ------ Nicholas J. Cox, University of Durham, U.K. n.j.cox@@durham.ac.uk

Also see --------

On-line: help for @graph@, @egen@