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

114—Chapter 5. Basic Data Handling

Exporting Data

EViews provides you with a number of methods for getting data from EViews into other applications.

Copying and Pasting

You can click and drag in a spreadsheet view or table of statistical results to highlight the cells you want to copy. Then click Edit/Copy… in the main menu to put the data into the clipboard. You will see a dialog box asking whether to copy the numbers with the precision showing on your screen (formatted copy) or to copy the numbers at full precision (unformatted copy).

As a shortcut, you can highlight entire rows or columns of cells by clicking on the gray border that surrounds the spreadsheet. Dragging across the border selects multiple rows or columns. To copy several adjacent series from the spreadsheet, drag across their names in the top border. All of their data will be highlighted. Then click Edit/Copy… to put the data into the clipboard.

Once the data are on the clipboard, switch to the target application, and select Edit/Paste.

Exporting to a Spreadsheet or Text File

First, click on Proc/Export/Write Text-Lotus-Excel… from the workfile toolbar or main menu, then enter the name and type of the output file in the SaveAs dialog. As you fill out the SaveAs dialog, keep in mind the following behavior:

If you enter a file name with an extension, EViews will use the file extension to identify the file type. Files with common spreadsheet extensions (“.XLS”, “.WK3”, “.WK1”, and “.WKS”) will be saved to the appropriate spreadsheet type. All others will be saved as ASCII files.

If you do not enter an extension, EViews will use the file type selected in the combobox to determine the output type. Spreadsheet files will have the appropriate extensions appended to the name. ASCII files will be saved using the name provided in the dialog, without an extension. EViews will not append extensions to ASCII files unless you explicitly include one in the file name.

Note that EViews cannot, at present, write into an existing file. The file that you select will, if necessary, be replaced.

Once you have specified the output file, click OK to open the export dialog.

Tip: if you highlight the series you wish to export before beginning the export procedure, the series names will be used to fill out the export dialog.

Frequency Conversion—115

Spreadsheet Export

The dialogs for spreadsheet export are virtually identical to the dialogs for spreadsheet import. You should determine the orientation of your data, the series to export, and the sample of observations to be written.

Additionally, EViews provides you with checkboxes for determining whether to include the series names and/or the series dates in the spreadsheet. If you choose to write one or both to the spreadsheet, make certain that the starting cell for your data leaves the necessary room along the borders for the information. If the necessary room is not available, EViews will ignore the option—for example, if you choose to write your data beginning in cell A1, EViews will not write the names or dates.

ASCII Export

The ASCII export dialog is quite similar to the spreadsheet export dialog, but it contains a few additional options:

You can change the text string to be used for writing missing values. Simply enter the text string in the edit field.

EViews provides you with the option of separating data values with a tab, a space, or a comma. Click on the desired radio button.

We caution that if you attempt to write your data by series, EViews will write all of the observations for a series on a single line. If you have a reasonably long series of observations, these data may overflow the line-length of other programs.

Matrix Object Export

Exporting data from a matrix object simply reverses the matrix import (“Matrix Object Import” on page 112). To write the contents of the matrix to a file, select Proc/Export Data (ASCII, .XLS, .WK?)… from the matrix toolbar and fill in the dialog as appropriate.

Frequency Conversion

Every series in EViews has an associated frequency. When a series is in a workfile, the series is stored at the frequency of the workfile. When a series is held in a database (Chapter 10, “EViews Databases”), it is stored at its own frequency. Since all series in the same workfile page must share a common frequency, moving a series from one workfile to another or from a database to a workfile page will cause the series being moved to be converted to the frequency of the workfile page into which it is being placed.

Performing Frequency Conversion

Frequency conversion is performed in EViews simply by copying or fetching a series with one frequency into a workfile of another frequency.

116—Chapter 5. Basic Data Handling

Copy-and-Paste

Suppose that you have two workfile page (or a source database and a destination workfile page), where the source contains quarterly data on the series YQ, and the destination workfile contains annual data. Note that you may copy between pages in the same workfile or between separate workfiles.

To convert YQ from a quarterly to annual frequency, you may copy-and-paste the series from the source quarterly workfile to the annual workfile. Click on the YQ series in the quarterly workfile, press the right-mouse button and select Copy, navigate to the annual workfile, then right mouse button and select Paste or Paste Special....

If you select Paste, EViews will copy YQ to the annual page, using the default frequency conversion settings present in YQ to perform the conversion.

If you select Paste Special..., EViews will display a dialog offering you the opportunity to override the default frequency conversion settings. Before describing this dialog (“Overriding Default Conversion Methods” on page 120), we provide a background on frequency conversion methods, and describe how default conversion methods are specified in EViews.

Using Commands

You may use either the copy or fetch command to move series between workfiles or between a database and a workfile. EViews will perform frequency conversion if the frequencies of the source and destination do not match.

See copy (p. 249) and fetch (p. 291) in the Command and Programming Reference for details.

Frequency Conversion Methods

There are three types of frequency conversion: high frequency to low frequency conversion, low frequency to high frequency conversion, and frequency conversion between a dated and undated workfile.

EViews provides you with the ability to specify methods for all types of conversion. In addition, there are settings that control the handling of missing values when performing the conversion.

High Frequency to Low Frequency

If a numeric series being imported has a higher frequency than the workfile, you may choose between a number of different conversion methods:

Average observations

Sum observations

Frequency Conversion—117

First observation

Last observation

Maximum observation

Minimum observation

No down conversions

with the latter setting permitting you to disallow high to low conversions. In this case, EViews will generate an error if you attempt to convert from high to low frequency.

In addition, you may specify how EViews handles missing data when carrying out the calculations. You may elect to propagate NAs so that whenever a missing value appears in a calculation, the result for the corresponding period will be an NA. Alternatively, you may elect not to propagate NAs so that calculations will be performed ignoring the missing values (though if all values for a period are missing, the corresponding result will still be an NA).

Low Frequency to High Frequency

EViews also provides a number of different interpolation methods for dealing with the case where the series being brought into the workfile has a lower frequency than the workfile. Since observing a series at a lower frequency provides fundamentally less information than observing the same series at a higher frequency, it is generally not possible to recover the high frequency series from the low frequency data. Consequently, the results from EViews’ interpolation methods should be considered to be suggestive rather than providing the true values of the underlying series.

EViews supports the following interpolation methods:

Constant: Constant with sum or average matched to the source data.

Quadratic: Local quadratic with sum or average matched to the source data.

Linear: Linear with last observation matched to the source data.

Cubic: Cubic spline with last observation matched to the source data.

No conversion: Do not allow up conversion.

Using an interpolation method which matches the average means that the average of the interpolated points for each period is equal to the source data point for that period. Similarly if the sum is matched, the interpolated points will sum to the source data point for the period, and if the last observation is matched, the last interpolated point will equal the source data point for the period.

118—Chapter 5. Basic Data Handling

For all methods, all relevant data from the low frequency series is used when forming the high frequency series, even if the destination observations are a subset of the observations available in the source.

The following describes the different methods in greater detail:

Constant: match average, Constant: match sum—These two methods assign the same value to all observations in the high frequency series associated with a particular low frequency period. In one case, the value is chosen so that the average of the high frequency observation matches the low frequency observation (the value is simply repeated). In the other case, the value is chosen so that the sum of the high frequency observations matches the low frequency observation (the value is divided by the number of observations).

Quadratic: match average, Quadratic: match sum—These two methods fit a local quadratic polynomial for each observation of the low frequency series, then use this polynomial to fill in all observations of the high frequency series associated with the period. The quadratic polynomial is formed by taking sets of three adjacent points from the source series and fitting a quadratic so that either the average or the sum of the high frequency points matches the low frequency data actually observed. For most points, one point before and one point after the period currently being interpolated are used to provide the three points. For end points, the two periods are both taken from the one side where data is available.

This method is a purely local method. The resulting interpolation curves are not constrained to be continuous at the boundaries between adjacent periods. Because of this, the method is better suited to situations where relatively few data points are being interpolated and the source data is fairly smooth.

Linear: match last—This method assigns each value in the low frequency series to the last high frequency observation associated with the low frequency period, then places all intermediate points on straight lines connecting these points.

Cubic: match last—This method assigns each value in the low frequency series to the last high frequency observation associated with the low frequency period, then places all intermediate points on a natural cubic spline connecting all the points.

A natural cubic spline is defined by the following properties:

1.Each segment of the curve is represented by a cubic polynomial.

2.Adjacent segments of the curve have the same level, first derivative and second derivative at the point where they meet.

3.The second derivative of the curve at the two global end points is equal to zero (this is the “natural” spline condition).

Frequency Conversion—119

Cubic spline interpolation is a global interpolation method so that changing any one point (or adding an additional point) to the source series will affect all points in the interpolated series.

Undated Conversion

If you fetch or copy a series to or from an undated or unstructured workfile into or from a dated workfile, the data will be copied sequentially, beginning at the starting observation number of the undated or unstructured series (generally the first observation).

Specifying Default Conversion Methods

When performing frequency conversion of one or more series, EViews uses the default settings in each series to perform the conversion. These settings may be specified in each series using the Freq Convert tab of the Properties dialog. To access the dialog, select View/Properties... from the series main menu, or click on the Properties button on the series toolbar.

If the series default setting is set to EViews default, the series will take its frequency conversion setting from the EViews global options (see “Dates & Frequency Conversion” on page 939 in Appendix A, “Global Options”). Here, the high to low conversion is set to Sum observations, overriding the global setting, while the low to high uses the EViews default global setting.

This two level default system allows you to set global default settings for frequency

conversion that apply to all newly created series, while allowing you to override the default settings for specific series.

As an example of controlling frequency conversion using default settings, suppose you have daily data consisting of HIGH, LOW, and CLOSE series for a particular stock, from which you would like to construct a monthly workfile. If you use the default frequency conversion methods, the monthly workfile will contain series which use the series defaults, which is not likely to be what you want. By setting the frequency conversion method of the HIGH series to Max observation, of the LOW series to Min observation, and of the CLOSE series to Last observation, you may use conversion to populate a monthly workfile with converted daily data that follow the desired behavior.

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