Data from Internet

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

FrankC
Posts: 8
Joined: Tue Sep 03, 2013 1:21 pm

Data from Internet

Postby FrankC » Tue Sep 03, 2013 1:31 pm

Hi,
I am new to Eviews and I have a simple data question -- what is the best way to 1) import data from internet and 2) update this data programatically? Suppose the data is this one: http://unctadstat.unctad.org/TableViewe ... eportId=96
Thanks a lot!

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

Re: Data from Internet

Postby EViews Glenn » Tue Sep 03, 2013 1:48 pm

Save the file as an Excel file by clicking on the Excel icon. (Note that our normal URL reading requires there to be a file [edit: or basic HTML, which this one is not]).

Open the downloaded file in Excel and copy the rectangle starting at YEAR (A6) in the upper left corner and ending in the bottom right corner of your data (AR111). Open EViews and right-mouse-click "Paste as New Workfile". Click on the "Read series by row" checkbox in the bottom left of the dialog and then click on OK. EViews will create a workfile with the copied data.

Seems to read okay, but I'd double check.
Last edited by EViews Glenn on Tue Sep 03, 2013 3:22 pm, edited 1 time in total.

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

Re: Data from Internet

Postby EViews Gareth » Tue Sep 03, 2013 1:51 pm

EViews can read basic html tables direct from the web. However that particular site is not one that EViews can read (due to the dynamic nature of their table generation). Your best bet is to download it as an Excel file, then open the Excel file in EViews (wfopen command).

Alternatively, you can check whether the same data are available via FRED or Quandl. Both are supported from within EViews (Quandl with the getQuandl add-in).

FrankC
Posts: 8
Joined: Tue Sep 03, 2013 1:21 pm

Re: Data from Internet

Postby FrankC » Tue Sep 03, 2013 2:55 pm

Thank you very much for the help. Some further questions:
1) I am wondering whether using excel as an intermediate step would involve too much manual work since there are numerous tables to be downloaded (and updated on a regular basis)?
2) Suppose I am using FRED, File>Open>Database… FRED Database and query out the series (call them X, Y, and Z) I needed to a workfile. Later on, when these series are updated in FRED, how would I update my workfile series (X Y and Z) accordingly?
3) Could you provide a few lines of code that can achieve 2) (i.e., codes for querying FRED, save series to a workfile, and update the series in the workfile)
Thanks again!

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

Re: Data from Internet

Postby EViews Glenn » Wed Sep 04, 2013 8:22 am

2&3. You can use the fetch command to refresh the data. Or you can use a database link series to automatically update the data. I'm on a phone right now so I don't want to give you an incorrect command but the manual will have examples of using fetch and database links.

[edit]

1. Open the Fred database once interactively and use the edit field at the bottom to create a database abbreviation. "Fred" is an obvious one.

2. Once you have the abbreviation, you can use the command

Code: Select all

fetch fred::a fred::b fred::c
to fetch the series

3. Or you can create an auto-updating series to create a database link

Code: Select all

frml fred_a = fred::a frml fred_b = fred::b frml fred_c = fred::c
which will update when used.

Note that if you want to update because of new data arrival, you may need to expand the workfile to accommodate the new observations

FrankC
Posts: 8
Joined: Tue Sep 03, 2013 1:21 pm

Re: Data from Internet

Postby FrankC » Wed Sep 04, 2013 10:16 am

Thank you very much Glenn! I am wondering is Eviews can provide a "recorder" function (like the marcro recorder in Excel) so all the mouse operations can be saved as codes...

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

Re: Data from Internet

Postby EViews Glenn » Wed Sep 04, 2013 11:56 am

It's on our list of things to do, but it's a large project. I'll make a note of the request.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest