How to write a vector of series

For questions and discussion related to reading in and working with data.
hardmann
Posts: 252
Joined: Sat Feb 26, 2011 9:49 pm

How to write a vector of series

Unread post by hardmann »

Dear Tom:

I deal with a real-time data set. I read a adjacent vantage series to a vectors of series. I simplly transform them and want to write them to another excel files.
My codes does not work as follows.
Please help me.

Code: Select all

calendar(q) 1992:1
open data qgdp_rt.xls
data(format=xls,org=columns)

* series of vantage from 1996Q1 to 2003Q1

dec vector[series] v(29)
dec vector[series] va(29)
dec series vt

do i = 2,29
   set v(i) = ([series]i)
   X11(MODE=MULT,PRINT=NONE,ADJUSTED=vt) V(i)
   set va(i) = 100*log(vt)
end do i


open(append) copy ad_qgdp_rt.xls

do i = 2,29
copy(format=xls,org=columns) 1992:1 1995:3+i va(i)
end do i


Attachments
qgdp_rt.xls
(22.5 KiB) Downloaded 683 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to write a vector of series

Unread post by TomDoan »

You can't append to an XLS file, only to text and binary files. (An XLS file and several of the others have to be written in a single act).

Why wouldn't just

copy(format=xls,org=columns) 1992:1 yourendofdata va(2) to va(29)

work? The early series are naturally shorter anyway, aren't they? So you'll get the NA padding that you're looking for when you copy them all over the same range.
hardmann
Posts: 252
Joined: Sat Feb 26, 2011 9:49 pm

Re: How to write a vector of series

Unread post by hardmann »

Dear Tom:

Thanks. It works well. Thanks. It works well. Due to data revised frequently, the data for identical date varies from different observation date, or vintage date. The vintage date is data observed date, in another words, the data is available in such date. The vintage date lags one for date of final available data. As for one variable, the single series becomes called real-time data set with tow dimension, adding a dimension of vintage. The shape of real time data set is right-angled trapezoid. The first and final vantage are two parallel sides of trapezoid, the lengths of them are lateral sides.
Post Reply