Skip to content

tsdiag() titles

3 messages · Andrew Kniss, Andy Bunn, Brian Ripley

#
I am using the ts package to fit ARIMA models, and the tsdiag() function to
plot diagnostics.  In doing so I'm generating an awful lot of diagnostic
plots of different models and different data sets all within the same R
session.  So my question is, is there an option in tsdiag() similar to
<main="Title"> that I can use?  This would be quite helpful when I print out
the plots, so I can tell which plot goes with a particular data set and
model.  I can't seem to find any examples where this has been done, and no
options (other than gof.lag) are listed in the R manual.

library(ts)
data(tbills)       #Treasury Bills
attach(tbills)
ts.tbills<-ts(tbills)
diff.tbills<-diff(ts.tbills)  #Differenced Series
arima.diff.tbills.100<-arima(ts.tbills, order=c(1,0,0))
win.metafile("HW_ARIMA/tbill1.wmf")
  tsdiag(arima.diff.tbills.100, main="Treasury Bills")  #main= does not
work, is there a way to name the plot?
dev.off()

?
Thanks for any help or ideas.
?
Andrew Kniss
Assistant Research Scientist
University of Wyoming
Dept. 3354? 
1000 E. University Ave.
Laramie, WY  82071
(307) 766-3949
akniss at uwyo.edu
#
You can use title, but the result is unsatisfying:
Perhaps mtext with an appropriate par configuration?

HTH, Andy
#
Did you notice that tsdiag() plots about three plots and gives each a 
title?

You can add a title to the array of plots using title(outer=TRUE), 
surprisingly enough, but you will need to adjust the outer margins to make 
room for it.  Something like

par(oma=c(0,0,2,0))
fit <- arima(lh, c(1,0,0))
tsdiag(fit)
title("Some title or another", outer = TRUE)
On Mon, 15 Nov 2004, Andrew Kniss wrote: