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!
Data from Internet
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: Data from Internet
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.
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
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).
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
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!
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
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
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
[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::c3. 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::cNote 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
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
It's on our list of things to do, but it's a large project. I'll make a note of the request.
Who is online
Users browsing this forum: No registered users and 1 guest
