Page 1 of 1

Converting tables into series

Posted: Fri Oct 15, 2010 1:58 am
by janku
Dear eviews programmer,

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

Re: Converting tables into series

Posted: Fri Oct 15, 2010 3:36 am
by trubador
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)

Re: Converting tables into series

Posted: Mon Oct 18, 2010 6:09 am
by janku
Thank you very much for your quick answer. it works out perfectly.

Re: Converting tables into series

Posted: Thu Nov 26, 2015 9:39 am
by gsourop
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!

Re: Converting tables into series

Posted: Thu Nov 26, 2015 10:31 am
by EViews Gareth
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.

Re: Converting tables into series

Posted: Thu Nov 26, 2015 10:52 am
by gsourop
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?

Re: Converting tables into series

Posted: Thu Nov 26, 2015 10:59 am
by EViews Gareth

Re: Converting tables into series

Posted: Thu Nov 26, 2015 11:04 am
by gsourop
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)

Re: Converting tables into series

Posted: Thu Nov 26, 2015 11:12 am
by EViews Gareth
@vcat was added in EV7.

Use colplace or rowplace instead