s-news
[Top] [All Lists]

Re: timeSeries question

To: "'Eric Zivot'" <ezivot@u.washington.edu>, "'S-News'" <s-news@lists.biostat.wustl.edu>
Subject: Re: timeSeries question
From: "Steve McKinney" <smckinney@insightful.com>
Date: Wed, 19 Sep 2001 13:10:53 -0700
Importance: Normal
In-reply-to: <GPECKMJDPHIDALEELIMHIELJCCAA.ezivot@u.washington.edu>
Reply-to: <smckinney@insightful.com>
Hi Eric,

Check the help for class.timeDate
> ?class.timeDate

which shows the available output formats.  One
of the formats is "%Q" (quarter of the year as a Roman numeral)

fooTimes <- timeSeq(from = timeDate("1/1/1997"),
                    to = timeDate("12/31/2000"),
                    by = "quarters",
                    format = "%Y%Q"
                    )
fooTimes

> fooTimes
 [1] 1997I   1997II  1997III 1997IV  1998I   1998II  1998III 1998IV
 [9] 1999I   1999II  1999III 1999IV  2000I   2000II  2000III 2000IV

> fooTimes <- timeSeq(from = timeDate("1/1/1997"),
+                     to = timeDate("12/31/2000"),
+                     by = "quarters",
+                     format = "%Y:%Q"
+                     )
> fooTimes
 [1] 1997:I   1997:II  1997:III 1997:IV  1998:I   1998:II  1998:III
 [8] 1998:IV  1999:I   1999:II  1999:III 1999:IV  2000:I   2000:II
[15] 2000:III 2000:IV


so it should be possible for you to display quarters
this way.

Hope this helps

Steven McKinney
Consulting Services
Insightful Corporation
 
smckinney@insightful.com <mailto:smckinney@insightful.com>
 
tel: (800) 569-0123 x349
tel: (206) 283-8802 x349
fax: (206) 283-8691
 
Insightful Corporation
1700 Westlake Avenue North, Suite 500
Seattle, Washington 98109-3044 USA
www.insightful.com

Formerly known as MathSoft, Insightful Corporation
provides analytical solutions leveraging S-PLUS,
StatServer, S-PLUS Analytic Server and consulting services.


> -----Original Message-----
> From: s-news-owner@lists.biostat.wustl.edu
> [mailto:s-news-owner@lists.biostat.wustl.edu]On Behalf Of Eric Zivot
> Sent: Wednesday, September 19, 2001 11:41 AM
> To: S-News
> Subject: [S] timeSeries question
>
>
> I am learning to use the new timeSeries objects in Splus 6
> for windows. I
> have some economic data that is measured quarterly (postwar
> quarterly real
> GDP) from 1947:I to 2000:I. From what I can gather from my
> reading of the
> manual there is no date format for timeDate objects that will display
> quarterly data in standard forms like
>
>               1947:I 1947:II ... 2000:I
> or
>               1947 Q1 1947 Q2 ... 2000 Q1
>
> Does anyone have suggestions? Thanks in advance. ez
>
> Eric Zivot
> Associate Professor
> Department of Economics
> Box 353330
> University of Washington
> (206) 543-6715
> http://faculty.washington.edu
> http://myprofile.cos.com/zivote47
>
> ---------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message:  unsubscribe s-news


<Prev in Thread] Current Thread [Next in Thread>