Page 1 of 1
Data from Internet
Posted: Tue Sep 03, 2013 1:31 pm
by FrankC
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!
Re: Data from Internet
Posted: Tue Sep 03, 2013 1:48 pm
by EViews Glenn
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.
Re: Data from Internet
Posted: Tue Sep 03, 2013 1:51 pm
by EViews Gareth
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).
Re: Data from Internet
Posted: Tue Sep 03, 2013 2:55 pm
by FrankC
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!
Re: Data from Internet
Posted: Wed Sep 04, 2013 8:22 am
by EViews Glenn
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
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
Re: Data from Internet
Posted: Wed Sep 04, 2013 10:16 am
by FrankC
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...
Re: Data from Internet
Posted: Wed Sep 04, 2013 11:56 am
by EViews Glenn
It's on our list of things to do, but it's a large project. I'll make a note of the request.