Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Eviews5 / EViews5 / Docs / EViews 5 Users Guide.pdf
Скачиваний:
204
Добавлен:
23.03.2015
Размер:
11.51 Mб
Скачать

Saving a Workfile—61

Workfile Summary View

In place of the directory display, you can display a summary view for your workfile. If you select this view, the display will change to provide a description of the current workfile structure, along with a list of the types and numbers of the various objects in each of the pages of the workfile.

To select the summary view, click on View/Statistics in the main workfile menu or toolbar. Here we see the display for a first page of a two page workfile.

To return to the directory display view, select View/Workfile Directory.

Saving a Workfile

You should name and save your workfile for future use. Push the Save button on the workfile toolbar to save a copy of the workfile on disk. You can also save a file using the File/ Save As… or File/Save… choices from the main menu. EViews will display the Windows common file dialog.

You can specify the target directory in the upper file menu labeled Save in. You can navigate between directories in the standard Windows fash- ion—click once on the down arrow to access a directory tree; double clicking on a directory name in the display area gives you a list of all the files and subdirectories in that directory. Once you have worked your way to the right

62—Chapter 3. Workfile Basics

directory, type the name you want to give the workfile in the File name field and push the Save button.

Alternatively, you could just type the full Windows path information and name in the File name edit field.

In most cases, you will save your data as an EViews workfile. By default, EViews will save your data in this format, using the specified name and the extension “.WF1”. You may, of course, choose to save the data in your workfile in a foreign data format by selecting a different format in the combo box. We explore the subject of saving foreign formats below in “Exporting from a Workfile” on page 259.

Saving Updated Workfiles

You may save modified or updated versions of your named workfile using the Save button on the workfile toolbar, or by selecting File/Save… from the main menu. Selecting Save will update the existing workfile stored on disk. You may also use File/Save As… to save the workfile with a new name. If the file you save to already exists, EViews will ask you whether you want to update the version on disk.

When you overwrite a workfile on disk, EViews will usually keep a backup copy of the overwritten file. The backup copy will have the same name as the file, but with the first character in the extension changed to ~. For example, if you have a workfile named MYDATA.WF1, the backup file will be named MYDATA.~F1. The existence of these backup files will prove useful if you accidentally overwrite or delete the current version of the workfile file, or if the current version becomes damaged.

If you wish to turn on or off the creation of these backup copies you should set the desired global options by selecting Options/Workfile Storage Defaults..., and selecting the desired settings.

Workfile Save Options

By default, when you click on the Save button, EViews will display a dialog showing the current global default options for storing the data in your workfile.

Your first choice is whether to save your series data in either Single precision or Double precision. Single precision will create smaller files on disk, but saves the data with fewer digits of accuracy (7 versus 16).

You may also choose to save your data in compressed or non-compressed form. If you select Use compression, EViews will analyze the contents of your series, choose an opti-

Loading a Workfile—63

mal (lossless) storage precision for each series, and will apply compression algorithms, all to reduce the size of the workfile on disk. The storage savings may be considerable, especially for large datasets containing lots of integer and 0, 1 variables. We caution however, that a compressed workfile is not backward compatible, and will not be readable by versions of EViews prior to 5.0.

Lastly, there is a checkbox for showing the options dialog on each save operation. By default, the dialog will be displayed every time you save a workfile. Unchecking the Prompt on each Save option instructs EViews to hide this dialog on subsequent saves. If you later wish to change the save settings or wish to display the dialog on saves, you must update your global settings by selecting Options/Workfile Default Storage Options... from the main EViews menu.

Note that, with the exception of compressed workfiles, workfiles saved in EViews 5 may be read by previous versions of EViews. Objects such as valmaps or alpha series that are not supported by previous versions will, however, be dropped when read by earlier versions of EViews. You should take great caution when saving workfiles using older versions of EViews as you will lose these deleted objects (see “Workfile Compatibility” on page 5).

Note also that only the first page of a multi-page workfile will be read by previous versions; all other pages will be dropped. You may save individual pages of a multi-page workfile to separate workfiles so that they may be read by previous versions; see “Saving a Workfile Page” on page 71.

Loading a Workfile

You can use File/Open/EViews Workfile… to load into memory a previously saved workfile. You will typically save a workfile containing all of your data and results at the end of the day, and later load the workfile to pick up where you left off.

When you select File/Open/EViews Workfile… you will see a standard Windows file dialog. Simply navigate to the appropriate directory and double click on the name of the workfile to load it into RAM. The workfile window will open and all of the objects in the workfile will immediately be available.

For convenience, EViews keeps a record of the most recently used files at the bottom of the File menu. Select an entry and it will be opened in EViews.

Version 5 of EViews can read workfiles from all previous versions of EViews. Due to changes in the program, however, some objects may be modified when they are read into EViews 5.

64—Chapter 3. Workfile Basics

Multi-page Workfiles

While a great many of your workfiles will probably contain a single page, you may find it useful to organize your data into multiple workfile pages. Multi-page workfiles are primarily designed for situations in which you must work with multiple datasets.

For example, you may have both quarterly and monthly data that you wish to analyze. The multi-page workfile allows you to hold both sets of data in their native frequency, and to perform automatic frequency conversion as necessary. Organizing your data in this fashion allows you to switch instantly between performing your analysis at the monthly and the quarterly level.

Likewise, you may have a panel dataset on individuals that you wish to use along with a cross-sectional dataset on state level variables. By creating a workfile with a separate page for the individual level data, and a separate page for the state level data, you can move back and forth between the individual and the state level analyses, or you can link data between the two to perform dynamic match merging.

Creating a Workfile Page

There are several ways to create a new workfile page.

Creating a Page by Describing its

Structure

First, you may describe the structure of the workfile page. This method follows the approach outlined in “Creating a Workfile by Describing its Structure” on page 51. Simply call up the new page menu by clicking on the tab labeled New Page and selecting Specify by Frequency/Range..., and EViews will display the familiar Workfile Create dialog. Simply describe the

structure of your workfile page as you would for a new workfile, and enter OK.

EViews will create a new workfile page with the specified structure and the new page will be given a default name and designated as the active workfile page. The default name will be constructed from the next available name for the given workfile structure. For example, if you create a regular frequency annual page, EViews will attempt to name the page ANNUAL, ANNUAL1, and so forth. The active page is noted visually by the tab selection at the bottom of the workfile window. With the exception of a few page-specific operations, you may generally treat the active page as if it were a standard workfile.

Multi-page Workfiles—65

Creating a Workfile Page Using Identifiers

The second approach creates a new page using the unique values of one or more identifier series. Click on the New Page tab and select Specify by Identifier Series... EViews will open a dialog for creating a new page using one or more identifier series.

At the top of the dialog is a combo box labeled Method that you may use to select between the various ways of using identifiers to specify a new page. You may choose between creating the page

using: (1) the unique ID values from the current workfile page, (2) the union of unique ID values from multiple pages, (3) the intersection of unique ID values from mulitple pages,

(4) and (5) the cross of the unique values of two ID series, (6) the cross of a single ID series with a date range.

As you change the selected method, the dialog will change to provide you with different options for specifying identifiers.

Unique values of ID series from one page

The easiest way to create a new page from identifiers is to use the unique values in one or more series in the current workfile page.

If you select Unique values of ID series from one page in the Method combo, EViews will prompt you for one or more identifier series which you should enter in the Cross-sec- tion ID series and Date series edit fields.

EViews will take the set of series and will identify the unique values

in the specified Sample. Note that when multiple identifiers are specified, the unique values are defined over the values in the set of ID series, not over each individual series.

The new page will contain identifier series containing the unique values, and EViews will structure the workfile using this information. If Date ID series were provided in the original dialog, EViews will restructure the result as a dated workfile page.

66—Chapter 3. Workfile Basics

Suppose, for example, that we begin with a workfile page UNDATED that contains 471 observations on 157 firms observed for 3 years. There is a series FCODE identifying the firm, and a series YEAR representing the year.

We first wish to create a new workfile page containing 157 observations representing the unique values of FCODE. Simply enter FCODE in the Cross-section ID series, set the sample to “@ALL”, name the new page “UNDATED1”, and click on OK.

EViews will create a new structured (undated - with identifier series) workfile page UNDATED1 containing 157 observations. The new page will contain a series FCODE with the 157 unique values found in the original series FCODE, and the workfile will be structured using this series.

Similarly, we may choose to create a new page using the series YEAR, which identifies the year that the firm was observed. There are three distinct values for YEAR in the original workfile page (“1987”, “1988”, “1989”). Click on the Click on the New Page tab and select

Specify by Identifier Series... from the menu, and

Unique values of ID series

from one page in the

Method combo. Enter “YEAR” in the Date ID range 1987–1989. Note

series field, and click on OK to create a new annual page with that EViews will structures the result as a dated workfile page.

Union of common ID series from multiple pages

In some cases, you may wish to create your new page using unique ID values taken from more than one workfile page.

Multi-page Workfiles—67

If you select Union of commmon ID series from multiple pages, EViews will find, for each source page, a set of unique ID values, and will create the new workfile page using the union of these values. Simply enter the list of identifiers in the Cross-section ID series and Date series and edit fields, and a list of pages in which the common identifiers may be found. When you click on OK, EViews will first make certain that each of the identifier series is found in each page, then will create the new workfile page using the union of the observed ID values.

We may extend our earlier example where there are three distinct values for YEAR in the original page (“1987”, “1988”, “1989”). To make things more interesting, suppose there is a second page in the workfile, ANNUAL, containing annual data for the years 1985–1988 and that this page contains also contains a series YEAR with those values (“1985”, “1986”, “1987”, “1988”).

Since we want to exploit the fact that YEAR contains date information, we create a page using the union of IDs by selecting Union of common ID series from multiple pages, entering YEAR in the Date series field, and then entering “UNDATED” and “ANNUAL” in the page field. When you click on OK, EViews will create a 5 observation, regular annual frequency workfile page for 1987–1989, formed by taking the union of the unique values in the YEAR series in the UNDATED panel page, and the YEAR series in the ANNUAL page.

Intersection of common ID series from multiple pages

In other cases, you may wish to create your new page using common unique ID values taken from more than one workfile page. If you select Intersection of commmon ID series from multiple pages, EViews willtake the specified set of series and will identify the unique values in the specified Sample. The intersection of these sets of unique values across the pages will then be used to create a new workfile page.

In our extended YEAR example, we have two pages: UNDATED, with 471 observations and 3 distinct YEAR values (“1987”, “1988”, and “1989”); and the ANNUAL workfile page containing annual data for four years from 1985–1988, with corresponding values for the series YEAR.

Suppose that we enter YEAR in the Date ID field, and tell EViews to examine the intersection of values in the Multiple pages UNDATED and

ANNUAL. EViews will create a new workfile page containing the intersection of the unique

68—Chapter 3. Workfile Basics

values of the YEAR series across pages (“1987”, “1988”). Since YEAR was specified as a date ID, the page will be structured as a dated annual page.

Cross of two ID series

There are two choices if you wish to create a page by taking the cross of the unique values from two ID series: Cross of two non-date ID series creates an undated panel page using the unique values of the two identifiers, while Cross of one date and one non-date ID series uses the additional specification of a date ID to allow for the structuring of a dated panel page.

Suppose for example, that you wish to create a page by crossing the 187 unique FCODE values in the UNDATED page with the 4 unique YEAR values in the ANNUAL page (“1985”, “1986”, “1987”, “1988”). Since the YEAR values may be used to create a dated panel, we select Cross of one date and one non-date ID from our Method combo.

Since we wish to use YEAR to date structure our result, we enter “FCODE” and “UNDATED” in the

Cross ID series and Cross page fields, and we enter “YEAR” and “ANNUAL” in the Date ID series and Date page fields.

When you click on OK, EViews will create a new page by crossing the unique values of the two ID series. The resulting workfile will be an annual dated panel for 1985–1988, with FCODE as the cross-section identifer.

It is worth noting that had we had entered the same information in the Cross of two nondate ID dialog, the result would be an undated panel with two identifier series.

Cross of ID Series with a date range

In our example of crossing a date ID series with a non-date ID, we were fortunate to have an annual page to use in construting the date ID. In some cases, the dated page may not be immediately available, and will have to be created prior to performing the crossing operation.

In cases where the page is not available, but where we wish to cross our non-date ID series with a regular frequency range, we may skip the intermediate page creation by selecting the Cross of ID series with a date range method.

Multi-page Workfiles—69

Here, instead of specifying a date ID series and page, we need only specify a page frequency, start, and end dates. In this example, the resulting annual panel page is identical to the page specified by crossing FCODE with the YEAR series from the ANNUAL page.

While specifying a frequency and range is more convenient than specifying a date ID and page, this method is obviously more restrictive since it does not allow for irregular

dated data. In these latter cases, you must explicitly specify your date ID series and page.

Creating a Page by Copying the Current Page

You may also create a new workfile page by copying data from the current page. Click on New Page or click on Proc in the main workfile menu, and select Copy/Extract from Current Page and either By Link to New Page... or By Value to New Page or Workfile....

EViews will open a dialog prompting you to specify the objects and data that you wish to copy to a new page. See “Copying from a Workfile” on page 238 for a complete discussion.

Creating a Page by Loading a Workfile or Data Source

The next method for creating a new page is to load an existing workfile or data source. Call up the new page menu by clicking on New Page and selecting Load Workfile Page... or by selecting Proc/Load Workfile Page... from the main workfile menu. EViews will present you with the File Open dialog, prompting you to select your file.

If you select an existing EViews workfile, EViews will add a page corresponding to each page in the source workfile. If you load a workfile with a single page named QUARTERLY, EViews will attempt to load the entire workfile in the new page. If your workfile contains multiple pages, each page of the workfile will be loaded into a new and separate page. The active page will be the newest page.

If you select a foreign data source as described in “Creating a Workfile by Reading from a Foreign Data Source” on page 53, EViews will load the data into a single newly created page in the workfile. This method is exactly the same as that used when creating a new workfile except that the results are placed in a new workfile page.

70—Chapter 3. Workfile Basics

Creating a Page by Pasting from the Clipboard

You may create a new workfile page by pasting the contents of the Windows Clipboard. This method is particularly useful for copying and pasting data from another application such as Microsoft Word, Excel, or your favorite web browser.

Simply copy the data you wish to use in creating your page, then click on New Page and select Paste from Clipboard as Page. EViews will first analyze the contents of the clipboard. EViews then creates a page to hold the data and then will read the data into series in the page.

Note that while EViews can correctly analyze a wide range of data representations, the results may not be as expected in more complex settings.

Working With Workfile Pages

While workfile pages may generally be thought of simply as workfiles, there are certain operations that are page-specific or fundamental to multi-page workfiles.

Setting the Active Workfile Page

To select the active workfile page, simply click on the visible tab for the desired page in the workfile window. The active page is noted visually by the tab selection at the bottom of the workfile window.

If the desired page is not visible, you may click on the small right and left arrows in the bottom left-hand corner of the work-

file window to scroll the page tab display until the desired page is visible, then click on the tab.

You should note that it is possible to hide existing page tabs. If a page appears to be missing, for example if New Page is the only visible tab, the remaining tabs are probably hidden. You should click on the left arrow located in the bottom right of the workfile window until your page tabs are visible.

Renaming a Workfile Page

EViews will give your workfile pages a default name corresponding to the workfile structure. You may wish to rename these pages to something more informative. Simply click on the tab for the page you wish to rename and right-mouse-button click to open the workfile page menu. Select Rename Workfile Page... from the menu and enter the page name.

Соседние файлы в папке Docs