How to export a vector to excel ?

For questions regarding programming in the EViews programming language.

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

Rosa.hh
Posts: 22
Joined: Tue Dec 14, 2010 8:07 am

How to export a vector to excel ?

Postby Rosa.hh » Thu Dec 16, 2010 2:21 am

Dear all,

I am using Eviews 7 and a panel database of 13 countries for the period 1990q1-2009q2. How do I export a vectoR to excel? My final goal is to create a table but I dont know if it is possible to create a table with several vectors in Eviews.

I tried converting a vector into a matrix so that I could later on export the matrix to excel; here is the program but the data of the vector is being changed (numbers are different than originals) which is something I want to avoid.

Any idea of how should I export a vector to excel? I enclose the database.

Thank you a lot!

'transform vector into matrix:

vector rmr_lags1= @mrnd(29)
matrix rmr1= @unvec(rmr_lags1,29)

vector rmr_lags2= @mrnd(29)
matrix rmr2= @unvec(rmr_lags2,29)

vector rmr_lags4= @mrnd(29)
matrix rmr4= @unvec(rmr_lags4,29)

smpl @all
series rmrl1_series
mtos(rmr1, rmrl1_series)

ps: I've been visiting the forum a lot this week as I am new to Eviews and need to work with it, great forum!
Attachments
loop vector matrix and series.prg
prog
(385 Bytes) Downloaded 237 times
australia.WF1
database
(9.38 KiB) Downloaded 212 times

Rosa.hh
Posts: 22
Joined: Tue Dec 14, 2010 8:07 am

Re: How to export a vector to excel ?

Postby Rosa.hh » Thu Dec 16, 2010 5:02 am

I found out how to do it. Here are the codes

'transforms vector into matrix:
matrix rmrl1= rmr_lags1

'transform matrix into series:
series rmrl1_series
group rmrl1_s
mtos(rmrl1, rmrl1_series )

EViews Glenn
EViews Developer
Posts: 2672
Joined: Wed Oct 15, 2008 9:17 am

Re: How to export a vector to excel ?

Postby EViews Glenn » Thu Dec 16, 2010 9:25 am

I'm not sure if I"m misunderstanding the original question, but if you want to write a vector object to an Excel spreadsheet, you can use the just use the write command as in...

Code: Select all

vector rmr_lags1 = @mrnd(29)
rmr_lags1.write(t=xls) rmr_lags1.xls


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 23 guests