Page 1 of 1
How to convert a vect into a series?
Posted: Wed Jul 29, 2009 7:44 am
by Jennylai
Dear all,
My question is: How should I do if I want to convert a vector into a series?
For example, I have a 9by1 vector y, and I want to assign the values of each ofthe element in this vector y to a series yt starting from 2008:2 to 2008:10 ?
Thank you very much!
Re: How to convert a vect into a series?
Posted: Wed Jul 29, 2009 10:10 am
by TomDoan
Jennylai wrote:Dear all,
My question is: How should I do if I want to convert a vector into a series?
For example, I have a 9by1 vector y, and I want to assign the values of each ofthe element in this vector y to a series yt starting from 2008:2 to 2008:10 ?
Thank you very much
You can do that with a
SET instruction, but you need to use the
T subscript (with a shift value) in referring to entries in the vector. It sounds as if you need:
Code: Select all
SET YT 2008:2 2008:10 = Y(T-2008:1)
Re: How to convert a vect into a series?
Posted: Wed Jul 29, 2009 8:46 pm
by Jennylai
Dear Tom,
Thank you very much!
May I ask another question? If I have a series called ya in a program file prg1.r, and I want to use this ya together with other series yb which is in another program file prg2.r to graph some comparison figure, what should I do? How shall I proceed?
Thank you very much!
Re: How to convert a vect into a series?
Posted: Wed Jul 29, 2009 8:55 pm
by TomDoan
Use COPY to copy the data out of one of the program, then read it into the other.
Re: How to convert a vect into a series?
Posted: Thu Jul 30, 2009 2:18 am
by Jennylai
Dear Tom,
Thank you very much for your generous help all the time! I've worked that out!