s-news
[Top] [All Lists]

Plotting two time series

To: s-news@lists.biostat.wustl.edu
Subject: Plotting two time series
From: "Data Analytics Corp." <dataanalytics@earthlink.net>
Date: Mon, 28 Apr 2008 14:54:22 -0400
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=dk20050327; d=earthlink.net; b=YHpeABUcK+yvfyCSot45Xch1eXJN7JpUSbYf3cuorVFa16yAiR55e0IYez3Z1zm7; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding:X-ELNK-Trace:X-Originating-IP;
User-agent: Thunderbird 2.0.0.12 (Windows/20080213)
Hi,

I have a matrix with two time series, the S&P500 and the Consumer Confidence Index, created using the function timeSeries(). Let's say I create

x <- timeSeries(data, from = timeCalendar(d=1, m=1, y = 2004))

I can easily plot one of the components using

plot.timeSeries(x$sp500). Similarly for, say, confidence. The series x$sp500 and x$confidence have different scales. I'd like to have them on one plot with the scale for the S&P500 on the left and the scale for the Confidence Index on the right If I use

plot.timeSeries(x)

then both are drawn on the same plot area, but the scales are not for the series individually so the graph is hard to read. I can do this in Stata (with a little effort) but I'd prefer to do it in S+. How can this be done? Any suggestions?

I'm using S+8 on Windows Vista.

Thanks,

Walt Paczkowski

--
________________________

Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
________________________
(V) 609-936-8999
(F) 609-936-3733
dataanalytics@earthlink.net
www.dataanalyticscorp.com


<Prev in Thread] Current Thread [Next in Thread>
  • Plotting two time series, Data Analytics Corp. <=