Page 1 of 1

How to write a vector of series

Posted: Tue Dec 02, 2014 9:36 am
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



Re: How to write a vector of series

Posted: Tue Dec 02, 2014 9:54 am
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.

Re: How to write a vector of series

Posted: Fri Dec 05, 2014 11:54 pm
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.