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

Groups—145

“Groups” on page 145 below describes other useful techniques for working with auto-series.

Using Auto-Series in Estimation

One method of using auto-series in estimation is to allow expressions as right-hand side variables. Thus, you could estimate an equation with log(x) or exp(x+z) as an explanatory variable.

EViews goes a step beyond this use

of auto-series, by allowing you to use auto-series as the dependent variable in estimation. Thus, if you want to regress the log of Y on explanatory variables, you don’t have to create a new variable LOGY. Instead, you can use the expression log(y)as your dependent variable.

When you forecast using an equation with an auto-series dependent variable, EViews will, if possible, forecast the untransformed dependent variable and adjust the estimated confidence interval accordingly. For example, if the dependent variable is specified as log(y), EViews will allow you to forecast the level of Y, and will compute the asymmetric confidence interval. See Chapter 18, “Forecasting from an Equation”, on page 543 for additional details.

Groups

EViews provides specialized tools for working with groups of series that are held in the form of a group object. In “Importing Data” on page 105 we used groups to import data from spreadsheets into existing workfiles. Briefly, a group is a collection of one or more series identifiers or expressions. Note that a group does not contain the data in the individual series, only references to the data in the series.

To create a group, select Object/New Object.../Group and fill in the dialog with names of series and auto-series. Or you may select Show from the workfile toolbar and fill out the dialog. Alternatively, type the command group in the command window, followed by a name to be given to the group and then the series and auto-series names:

group macrolist gdp invest cons

creates the group MACROLIST containing the series GDP, INVEST and CONS. Similarly,

146—Chapter 6. Working with Data

group altlist log(gdp) d(invest) cons/price

creates the group ALTLIST containing the log of the series GDP, the first difference of the series INVEST, and the CONS series divided by the PRICE series.

There are a few features of groups that are worth keeping in mind:

A group is simply a list of series identifiers. It is not a copy of the data in the series. Thus, if you change the data for one of the series in the group, you will see the changes reflected in the group.

If you delete a series from the workfile, the series identifier will be maintained in all groups. If you view the group spreadsheet, you will see a phantom series containing NA values. If you subsequently create or import the series, the series values will be restored in all groups.

Renaming a series changes the reference in every group containing the series, so that the newly named series will still be a member of each group.

There are many routines in EViews where you can use a group name in place of a list of series. If you wish, for example, to use X1, X2 and X3 as right-hand side variables in a regression, you can instead create a group containing the series, and use the group in the regression.

We describe groups in greater detail in Chapter 12, “Groups”, on page 363.

Accessing Individual Series in a Group

Groups, like other EViews objects, contain their own views and procedures. For now, note that you can access the individual elements of a named group as individual series.

To refer the n -th series in the group, simply append “( n )” to the group name. For example, consider the MACROLIST group, defined above. The expression MACROLIST(1) may be used to refer to GDP and MACROLIST(2) to refer to INVEST.

You can work with MACROLIST(1) as though it were any other series in EViews. You can display the series by clicking on the Show button on the toolbar and entering MACROLIST(1). You can include GDP in another group directly or indirectly. A group which contains:

macrolist(1) macrolist(2)

will be identical to a group containing

gdp invest

We can also use the individual group members as part of expressions in generating new series:

Groups—147

series realgdp = macrolist(1)/price

series y = 2*log(macrolist(3))

or in modifying the original series:

series macrolist(2) = macrolist(2)/price

Note that in this latter example the series keyword is required, despite the fact that the INVEST series already exists. This is true whenever you access a series as a member of a group.

Other tools allow you to retrieve the number of series in a group using the “@COUNT” group data member:

scalar numgroup = macrolist.@count

To retrieve the names of each of the series, you may use the group data member “@SERIESNAME”. These tools are described in greater detail in “Group Data Members” on page 164 of the Command and Programming Reference.

An Illustration

Auto-series and group processing provides you with a powerful set of tools for working with series data. As we saw above, auto-series provide you with dynamic updating of expressions. If we use the auto-series expression:

log(y)

the result will be automatically updated whenever the contents of the series Y changes.

A potential drawback of using auto-series is that expressions may be quite lengthy. For example, the two expressions:

log(gdp)/price + d(invest) * (cons + invest)

12345.6789 * 3.14159 / cons^2 + dlog(gdp)

are not suited to use as auto-series if they are to be used repeatedly in other expressions.

You can employ group access to make this style of working with data practical. First, create groups containing the expressions:

group g1 log(gdp)/price+d(invest)*(cons+invest)

group g2 12345.6789*3.14159/cons^2+dlog(gdp)

If there are spaces in the expression, the entire contents should be enclosed in parentheses.

You can now refer to the auto-series as G1(1) and G2(1). You can go even further by combining the two auto-series into a single group:

148—Chapter 6. Working with Data

group myseries g1(1) g2(1)

and then referring to the series as MYSERIES(1) and MYSERIES(2). If you wish to skip the intermediate step of defining the subgroups G1 and G2, make certain that there are no spaces in the subexpression or that it is enclosed in parentheses. For example, the two expressions in the group ALTSERIES,

group altseries (log(gdp)/price) 3.141*cons/price

may be referred to as ALTSERIES(1) and ALTSERIES(2).

Scalars

Scalar objects are different from series and groups in that they hold a single number instead of data for each observation in the sample. In addition, scalar objects have no window views, and may only be used in calculations or displayed on the status line. Scalars are created by commands of the form:

scalar scalar_name = number

where you assign a number to the scalar name. The number may be an expression or special functions that return a scalar.

To examine the contents of a scalar, you may enter the command show, followed by the name of the scalar. EViews will display the value of the scalar in the status line at the bottom of the EViews window, in the left-hand corner of the status line. For example:

scalar logl1 = eq1.@logl

show logl1

stores the log likelihood value of the equation object named EQ1 in a scalar named LOGL1, and displays the value in the status line. Likewise, double clicking on the scalar name in the workfile window displays the value in the status line.

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