How to convert a vect into a series?

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
Jennylai
Posts: 35
Joined: Sun Feb 08, 2009 8:40 pm

How to convert a vect into a series?

Unread post 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!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to convert a vect into a series?

Unread post 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)
Jennylai
Posts: 35
Joined: Sun Feb 08, 2009 8:40 pm

Re: How to convert a vect into a series?

Unread post 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!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: How to convert a vect into a series?

Unread post by TomDoan »

Use COPY to copy the data out of one of the program, then read it into the other.
Jennylai
Posts: 35
Joined: Sun Feb 08, 2009 8:40 pm

Re: How to convert a vect into a series?

Unread post by Jennylai »

Dear Tom,

Thank you very much for your generous help all the time! I've worked that out!
Post Reply