User’s Guide : EViews Fundamentals : EViews Databases : Database Auto-Series
Database Auto-Series
We have described how to fetch series into a workfile. There is an alternative way of working with databases which allows you to make direct use of the series contained in a database without first copying the series. The advantage of this approach is that you need not go through the process of importing the data every time the database is revised. This approach follows the model of auto-series in EViews as described in “Auto-series”.
There are many places in EViews where you can use a series expression, such as log(X), instead of a simple series name, and EViews will automatically create a temporary auto-series for use in the procedure. This functionality has been extended so that you can now directly refer to a series in a database using the syntax:
where db_name is the shorthand associated with the database. If you omit the database name and simply prefix the object name with a double colon like this:
EViews will look for the object in the default database.
A simple example is to generate a new series:
series lgdp = log(macro_db::gdp)
EViews will fetch the series named GDP from the database with the shorthand MACRO_DB, and put the log of GDP in a new series named LGDP in the workfile. It then deletes the series GDP from memory, unless it is in use by another object. Note that the generated series LGDP only contains data for observations within the current workfile sample.
You can also use auto-series in a regression. For example:
equation log(db1::y) c log(db2::x)
This will fetch the series named Y and X from the databases named DB1 and DB2, perform any necessary frequency conversions and end point truncation so that they are suitable for use in the current workfile, take the log of each of the series, then run the requested regression. Y and X are then deleted from memory unless they are otherwise in use.
The auto-series feature can be further extended to include automatic searching of databases according to rules set in the database registry (see “The Database Registry”). Using the database registry you can specify a list of databases to search whenever a series you request cannot be found in the workfile. With this feature enabled, the series command:
series lgdp = log(gdp)
looks in the workfile for a series named GDP. If it is not found, EViews will search through the list of databases one by one until a series called GDP is found. When found, the series will be fetched into EViews so that the expression can be evaluated. Similarly, the regression:
equation log(y) c log(x)
will fetch Y and X from the list of databases in the registry if they are not found in the workfile. Note that the regression output will label all variables with the database name from which they were imported.
In general, using auto-series directly from the database has the advantage that the data will be completely up to date. If the series in the database are revised, you do not need to repeat the step of importing the data into the workfile. You can simply reestimate the equation or model, and EViews will automatically retrieve new copies of any data which are required.
There is one complication to this discussion which results from the rules which regulate the updating and deletion of auto-series in general. If there is an existing copy of an auto-series already in use in EViews, a second use of the same expression will not cause the expression to be reevaluated (in this case reloaded from the database); it will simply make use of the existing copy. If the data in the database have changed since the last time the auto-series was loaded, the new expression will use the old data.
One implication of this behavior is that a copy of a series from a database can persist for any length of time if it is stored as a member in a group. For example, if you type:
show db1::y db2::x
this will create an untitled group in the workfile containing the expressions db1::y and db2::x. If the group window is left open and the data in the database are modified (for example by a store or a copy command), the group and its window will not update automatically. Furthermore, if the regression:
equation log(db1::y) c log(db2::x)
is run again, this will use the copies of the series contained in the untitled group; it will not re-fetch the series from the database.