Converting tables into series

For questions regarding programming in the EViews programming language.

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

janku
Posts: 2
Joined: Thu Sep 16, 2010 5:44 am

Converting tables into series

Postby janku » Fri Oct 15, 2010 1:58 am

Dear eviews programmer,

is it possible to convert a table into a series object with a simple command?
Thanks in advance.

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: Converting tables into series

Postby trubador » Fri Oct 15, 2010 3:36 am

I am not sure whether it is possible to do that in a single/simple command or without the help of a programming code. The following steps might be helpful, though:

Code: Select all

'Create a matrix of same as the table (5x4, for instance)
matrix(5,4) my_matrix

'Copy table values and paste them into the matrix
Better use the Windows clipboard.

'Create a vector of your interest that sorts the values
vector my_vector= @vec(my_matrix)  or
vector my_vector= @vec(@transpose(my_matrix))

'Convert the vector into series. Sample period might be an important issue here.
mtos(my_vector,my_series)

janku
Posts: 2
Joined: Thu Sep 16, 2010 5:44 am

Re: Converting tables into series

Postby janku » Mon Oct 18, 2010 6:09 am

Thank you very much for your quick answer. it works out perfectly.

gsourop
Posts: 18
Joined: Wed Nov 11, 2015 11:46 am

Re: Converting tables into series

Postby gsourop » Thu Nov 26, 2015 9:39 am

Hi everyone,

I have a question on matrix to series transformation. I have a matrix of dimensions [504,433] and I want to create a vector [504,1] that will contain the following elements of my vector: the first 72 elements of column 1 and then the diagonal of the sub-matrix starting from [73,2] to [504,433]. The only way I can imagine to do this is by transforming the initial matrix into series and then by using the command @elem(x,@otod(!i)) to extract the elements of my matrix. If there is any other advise, it is more than welcome!

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

Re: Converting tables into series

Postby EViews Gareth » Thu Nov 26, 2015 10:31 am

Use the @subextract command to extract the first vector and the remainder sub-matrix. Then use @getmaindiagonal to extract the diagonal part, and use the @vcat function to stack them on top of each other.
Follow us on Twitter @IHSEViews

gsourop
Posts: 18
Joined: Wed Nov 11, 2015 11:46 am

Re: Converting tables into series

Postby gsourop » Thu Nov 26, 2015 10:52 am

EViews Gareth wrote:Use the @subextract command to extract the first vector and the remainder sub-matrix. Then use @getmaindiagonal to extract the diagonal part, and use the @vcat function to stack them on top of each other.


Thank you Gareth for the help. Though, I tried to find @vcat command on the help menu, to see how it works, but didn't find it. Can you help me at this point please?

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

Re: Converting tables into series

Postby EViews Gareth » Thu Nov 26, 2015 10:59 am

Follow us on Twitter @IHSEViews

gsourop
Posts: 18
Joined: Wed Nov 11, 2015 11:46 am

Re: Converting tables into series

Postby gsourop » Thu Nov 26, 2015 11:04 am

EViews Gareth wrote:http://www.eviews.com/help/helpintro.html#page/EViews%25209%2520Help%2Fmatrixref.086.96.html


I use EVIEWS 7. I get a message that it is an illegal name.

vector(72,1) final
matrix(432,432) final2
vector(432,1) final3
vector(492,1) final4
vector final=@subextract(xtr1,12,1,72,1)
matrix final2=@subextract(xtr1,73,2,504,433)
vector final3=@getmaindiagonal(final2)
vector final4=@vcat(final,final3)

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

Re: Converting tables into series

Postby EViews Gareth » Thu Nov 26, 2015 11:12 am

@vcat was added in EV7.

Use colplace or rowplace instead
Follow us on Twitter @IHSEViews


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 39 guests