Export to csv or txt from VAR workfile

For questions regarding programming in the EViews programming language.

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

tmlai
Posts: 4
Joined: Thu May 07, 2009 9:34 pm

Export to csv or txt from VAR workfile

Postby tmlai » Tue Jun 16, 2009 10:55 pm

Hi, everyone. I am new to program in eviews.

First, I would like to export the VAR results and its equations from eviews. However, the following codes I program occur some errors to block the VAR results.

VAR G_VAR.LS 1 2 GDP property @ C
SHOW G_VAR
G_VAR.save(t=csv) G_VAR

I can export the VAR results in eviews interface but not the code.

Second, I would like to use the eviews program code to export the VAR equations, which I can obtain from "View -> representations" in VAR workfile, to csv/txt file. Can anyone help me code it?

Thanks.

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

Re: Export to csv or txt from VAR workfile

Postby EViews Gareth » Wed Jun 17, 2009 8:04 am

For the first part, freeze the var results first, then save the table to disk.

For the second part, you're out of luck, you cannot save the representations view to disk in a program.

tmlai
Posts: 4
Joined: Thu May 07, 2009 9:34 pm

Re: Export to csv or txt from VAR workfile

Postby tmlai » Wed Jun 17, 2009 7:00 pm

Thank you. But code the following, eviews display "G_VAR exists in FREEZE(G_VAR)".

VAR G_VAR.LS 1 2 GDP property @ C
SHOW G_VAR
FREEZE(G_VAR)
G_VAR.save(t=csv) G_VAR

How can I save the VAR results to csv or txt? What's wrong for the codes?
For LAGLEN and testexog, I can save them but not the VAR results.
Thanks!

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

Re: Export to csv or txt from VAR workfile

Postby EViews Glenn » Thu Jun 18, 2009 11:14 am

Your freeze has to be to a new object as G_VAR does indeed exist, and is a VAR. Save to G_VAR_OUT

Code: Select all

freeze(g_var_out) g_var.output g_var_out.save(t=csv) g_var_out

tmlai
Posts: 4
Joined: Thu May 07, 2009 9:34 pm

Re: Export to csv or txt from VAR workfile

Postby tmlai » Tue Sep 21, 2010 10:31 am

Thanks for your help!

But then I code to save the equation using "representation" as follows:

FREEZE(g_var_rep) g_var.representations(p)
g_var_rep.save(t=txt) g_var_rep

It works but the text dialog box is open. As I did a lot of VAR and eviews open a lot dialog box, it warns me to close dialog box and stop my program. Can anyone tell me the syntax to close the dialog box or to save the VAR equations without dialog box display?


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests