Dear eviews programmer,
is it possible to convert a table into a series object with a simple command?
Thanks in advance.
Converting tables into series
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
Re: Converting tables into series
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
Thank you very much for your quick answer. it works out perfectly.
Re: Converting tables into series
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!
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!
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Converting tables into series
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
Re: Converting tables into series
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?
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Converting tables into series
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)
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13319
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Converting tables into series
@vcat was added in EV7.
Use colplace or rowplace instead
Use colplace or rowplace instead
Follow us on Twitter @IHSEViews
Who is online
Users browsing this forum: No registered users and 39 guests