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

Contracting a Workfile—237

The optional Workfile ID series identifies the source of the observation in the combined workfile: observations in the original target page are assigned the value 0, while observations in the appended portion of the target will be given the value 1.

Contracting a Workfile

Samples are an important tool for restricting the set of observations used by EViews when performing calculations. You may, for example, set an estimation sample to restrict the observations used in a regression to only include females, or to only use the observations with dates between 1990 and 2003. An important advantage to working with samples is that the exclusion of observations is temporary, and may be reset simply by providing a new sample specification. Note also that even as they are excluded from calculations, out- of-sample observations still exist, and are used for lag processing.

There may be times, however, when you wish to drop or remove observations from a workfile page. For example, if you have daily data on stock trades and want lags to skip holidays, you must permanently remove holidays from the workfile. Similarly, if the focus of your analysis is on female labor force participation, you may wish to subset your workfile by excluding all males. Contracting the workfile in this fashion both reduces the size of the workfile and makes it easier to work with, since you no longer have to remember to set all samples to exclude males.

To contract a workfile page in place, you should click on the Proc button on the workfile toolbar and select Contract Current Page..., or select Proc/Contract Current Page... from the main menu.

EViews will open the Workfile Contract dialog prompting you to input a valid sample specification. Simply enter a sample specification and EViews will drop all observations in the current page that do not meet the specified criteria. Here, we drop all observations where the ID series is greater than 7 or where K lies between 100 and 200 (inclusive).

We emphasize that the workfile contraction occurs in place so that the existing workfile page will no longer exist. If you wish to keep the original page, you should make a copy of the page, or save it to disk.

238—Chapter 9. Advanced Workfiles

Copying from a Workfile

EViews provides you with convenient tools for copying or extracting subsamples of observations and series objects from existing workfiles and creating new pages containing the extracted data or links to the data. You may, for example, wish to create separate workfile pages for the males and females in your cross-section workfiles, or to keep only non-holi- day dates from your regular frequency daily-7 data. Similarly, you may wish to create a page containing a small subset of the series found in your original workfile.

Copying or extracting the series object data may be performed in two distinct ways: by creating links in a new page in the same workfile, or by copying the series objects into a new page in the existing or an alternate workfile.

The first method uses link objects to create memory efficient, dynamically updating copies of the data in your series, link, and alpha objects, but requires that the new destination page be in the same workfile.

The second method copies the actual values in the objects. Since links are not involved, you may use this approach to copy data into new pages in different workfiles. In addition, when copying by value, you may copy other types of EViews objects and you will have access to built-in tools for creating random samples of the observations in the source workfile.

Copying by Link

To copy all or part of the data in a workfile by creating links, you should select Proc/“Copy Extract from Current Page”/By Link to New Page.... EViews will open the Workfile Copy By Link dialog in which you will specify the data to be copied.

There are two principal ways that you can specify a subset of the data to be copied: you may specify a subsample of observations in the workfile or you may specify a subset of the series objects.

EViews will copy all of the observations in the sample specified in the edit box labeled Sample - observations to copy. To specify a subsample of observations, you should replace the default “@ALL” with a valid EViews sample.

You may elect to copy all series, alphas, and valmaps, or you may select the

Copying from a Workfile—239

Listed Series - Alphas - Valmaps radio button and enter a list of the series to be copied, with wildcards, if desired.

If the Include Links checkbox is selected, EViews will copy series and alpha links along with ordinary series and alphas. If you uncheck Include Links, EViews will drop all link objects from the copy list.

The copy by link procedure will create the links in a new page in the existing workfile. By default, the page will be given a name based on the page structure (e.g., “Annual”, or “Daily5”). You may provide a name for this destination page by clicking on the Page Destination tab and enter the desired name. If a page with that name already exists in the workfile, EViews will create a new page using the next available name. Note that since we are copying by link, you may not create a page in a different workfile.

When you click on OK to accept the dialog settings, EViews first examines your source workfile and the specified sample, and then creates a new page with the appropriate number of observations.

Next, EViews will copy, by value, the ID series used to structure the source workfile page for the specified sample of observations. Using the new series, EViews will structure the new workfile in a manner similar to the source workfile page. If, for example, you have an undated workfile that is structured using an ID series COUNTRIES, EViews will create a series in the destination page, copy the relevant values, and structure the page as an undated workfile using the new ID series COUNTRIES. Similarly, if the original page has an annual panel structure that is defined using multiple ID series, all of the ID series will be copied to the new page, and the page will be structured as an annual panel using these new series.

Lastly, EViews will create links in the new page for all of the specified series objects. The links will be defined as general match merge links using the source and destination ID series. Since the new page is a subset of the original page, the contraction methods will be set to No contractions allowed (see “Link calculation settings” on page 193).

240—Chapter 9. Advanced Workfiles

Copying by Value

To copy all or part of the workfile by value, you should select Proc/“Copy Extract from Current Page”/By Value to New Page or Workfile.... EViews will open the Workfile Copy By Value dialog.

You should first specify an EViews sample describing the observations to be copied. By default, EViews will use the sample “@ALL”.

Next, you should use the combo box to select a Random subsample method. By default, all of the observations in the sample will be used (No random subsampling), but you may choose to extract a random sample in one of three ways:

You may extract a subsample with a fixed number of observations (Fixed subsample size - number of observations). If the specified

subsample size is larger than the number of observations, the entire sample is used.

You may select a subsample with a fixed size, where the number of observations is specified as a percent of the total number of observations (Fixed subsample size - % of observations).

You may take a simple random sample in which every observation has a fixed probability of being selected (Random subsample size - % applied to each obs). As the label suggests, the number of observations in the resulting subsample is itself random.

In the remainder of the dialog page you should specify the objects to be copied. There are two parts to the object specification: a list of object names, and a set of modifiers for object types.

By default, the All objects radio button is selected so that the list of object names provided to EViews will include every object in the source workfile. You may instead provide an explicit list by clicking on the Listed objects radio button and entering the names of objects (using wildcards if appropriate).

The type matching checkboxes (Series - Alphas - Valmaps, Links, Estimation & Model Objects, All others) may be used to restrict the object list on the basis of broad classifica-

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