How to create a vector containing series name?

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

Gibus
Posts: 9
Joined: Tue Dec 07, 2010 2:57 am

How to create a vector containing series name?

Postby Gibus » Wed Dec 15, 2010 6:01 am

Hello,

I am Eviews7 user.
I would like to create a matrix(7,3) from the extraction of 3 vector columns from different other matrixs.
One of this 3 vector columns should contain the serie (or variable) names of a group.
As serie names are string, how can I create a vector contaning these string names?
(Later, this should allow me to identify the corresponding (vlookup) variable name for an identified value).

...
group groupC {%jres} groupA
for !k =1 to groupC.@count
!lmk=groupC.@count
%kname = groupC.@seriesname(!k)
vector (!lmk) varnames
varnames(!k) = %kname
etc..
matrix(!lkm,3) matcorprob
colplace(matcorprob, vcorabs,1)
colplace(matcorprob,vcorprob,2)
colplace(matcorprob,varnames,3)

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: How to create a vector containing series name?

Postby EViews Gareth » Wed Dec 15, 2010 7:41 am

Vectors and matrices can only contain numerical data, not strings. You can use an svector to contain strings rather than numbers. However you cannot place an svector inside a matrix using the colplace command (since matrices cannot contain strings).

Gibus
Posts: 9
Joined: Tue Dec 07, 2010 2:57 am

Re: How to create a vector containing series name?

Postby Gibus » Wed Dec 15, 2010 9:32 am

Thanks for your answer.
Therefore, the only way is to use numerical serie names instead of string serie name i.e. X1 to Xn into 1 to n, or is there an another way?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

How to create a vector containing series name?

Postby EViews Gareth » Wed Dec 15, 2010 10:19 am

I'm not certain I follow what you're doing. You might prefer to use a table object.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests