[R] adjusting monthplot() towards a seasonal diagnostic plot for stl()

Jan.Verbesselt at csiro.au Jan.Verbesselt at csiro.au
Tue Feb 26 05:02:10 CET 2008


Hi all,

I would like to adjust the monthplot() of an stl() so that for a
time-series with freq=12 (months):
a) the curve on the panel for the k-th month graphs the seasonal values
minus their monthly mean values
b) add to the fig. the values of the k-th month of the seasonal +
remainder, also minus their monthly mean values
which corresponds to the 'seasonal diagnostic plot as described by
Cleveland et al. 1990 to select ns parameters of the stl() function.

How can I use the R code for the monthplot() so that I can adjust the
function to graph this?

fit <- stl(log(co2), s.window = 20, t.window = 20)
plot(fit)
monthplot(fit, choice = "seasonal", cex.axis = 0.8, base=mean, type='l')

Thanks,
Jan



More information about the R-help mailing list