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.

How to convert a vect into a series?

Postby Jennylai » Wed Jul 29, 2009 7:44 am

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!
Jennylai
 
Posts: 35
Joined: Sun Feb 08, 2009 9:40 pm

Re: How to convert a vect into a series?

Postby TomDoan » Wed Jul 29, 2009 10:10 am

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)
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: How to convert a vect into a series?

Postby Jennylai » Wed Jul 29, 2009 8:46 pm

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!
Jennylai
 
Posts: 35
Joined: Sun Feb 08, 2009 9:40 pm

Re: How to convert a vect into a series?

Postby TomDoan » Wed Jul 29, 2009 8:55 pm

Use COPY to copy the data out of one of the program, then read it into the other.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: How to convert a vect into a series?

Postby Jennylai » Thu Jul 30, 2009 2:18 am

Dear Tom,

Thank you very much for your generous help all the time! I've worked that out!
Jennylai
 
Posts: 35
Joined: Sun Feb 08, 2009 9:40 pm


Return to Help With Programming

Who is online

Users browsing this forum: Google [Bot] and 1 guest