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

Appendix C. Special Expression Reference

This Appendix provides an alphabetical listing of special expressions that may be used in series assignment and generation, or as terms in estimation specifications.

ar

Equation Expression

 

 

Autoregressive error specification.

The AR specification can appear in an ls (p. 345) or tsls (p. 515) specification to indicate an autoregressive component. ar(1) indicates the first order component, ar(2) indicates the second order component, and so on.

Examples

The command:

ls m1 c tb3 tb3(-1) ar(1) ar(4)

regresses M1 on a constant, TB3, and TB3 lagged once with a first order and fourth order autoregressive component. The command:

tsls sale c adv ar(1) ar(2) ar(3) ar(4) @ c gdp

performs two-stage least squares of SALE on a constant and ADV with up to fourth order autoregressive components using a constant and GDP as instruments.

Cross-references

See Chapter 17, “Time Series Regression”, on page 491 of the User’s Guide for details on ARMA and seasonal ARMA modeling.

See also sar (p. 571), ma (p. 567), and sma (p. 572).

@expand

Equation Expression

 

 

Automatic dummy variables.

The @expand expression may be added in estimation to indicate the use of one or more automatically created dummy variables.

Syntax

Expression: @expand(ser1[, ser2, ser3, ...][, drop_spec]))

566—Appendix C. Special Expression Reference

creates a set of dummy variables that span the unique values of the input series ser1, ser2, etc.

The optional drop_spec may be used to drop one or more of the dummy variables. drop_spec may contain the keyword “@DROPFIRST” (indicating that you wish to drop the first category), “@DROPLAST” (to drop the last category), or a description of an explicit category, using the syntax:

@DROP(val1[, val2, val3,...])

where each argument corresponds to a category in @EXPAND. You may use the wild card "*" to indicate all values of a corresponding category.

Example

For example, consider the following two variables:

SEX is a numeric series which takes the values 1 and 0.

REGION is an alpha series which takes the values “North”, “South”, “East”, and “West”.

The command:

eq.ls income @expand(sex) age

regresses INCOME on two dummy variables, one for “SEX=0” and one for “SEX=1” as well as the simple regressor AGE.

The @EXPAND statement in,

eq.ls income @expand(sex, region) age

creates 8 dummy variables corresponding to : sex=0, region="North"

sex=0, region="South" sex=0, region="East" sex=0, region="West" sex=1, region="North" sex=1, region="South" sex=1, region="East" sex=1, region="West"

The expression:

ma—567

@expand(sex, region, @dropfirst)

creates the set of dummy variables defined above, but no dummy is created for “SEX=0, REGION="North"”. In the expression:

@expand(sex, region, @droplast)

no dummy is created for “SEX=1, REGION="WEST"”.

The expression:

@expand(sex, region, @drop(0,"West"), @drop(1,"North")

creates a set of dummy variables from SEX and REGION pairs, but no dummy is created for “SEX=0, REGION="West"” and “SEX=1, REGION="North"”.

@expand(sex, region, @drop(1,*))

specifies that dummy variables for all values of REGION where “SEX=1” should be dropped.

Cross-references

See “Automatic Categorical Dummy Variables” on page 464 of the User’s Guide for further discussion.

ma

Equation Expression

 

 

Moving average error specification.

The ma specification may be added in an ls (p. 345) or tsls (p. 515) specification to indicate a moving average error component. ma(1) indicates the first order component, ma(2) indicates the second order component, and so on.

Examples

ls(z) m1 c tb3 tb3(-1) ma(1) ma(2)

regresses M1 on a constant, TB3, and TB3 lagged once with first order and second order moving average error components. The “z” option turns off backcasting in estimation.

Cross-references

See “Time Series Regression” on page 491 of the User’s Guide for details on ARMA and seasonal ARMA modeling.

See also sma (p. 572), ar (p. 565), and sar (p. 571).

568—Appendix C. Special Expression Reference

na

Series Expression

 

 

Not available code. “NA” is used to represent missing observations.

Examples

smpl if y >= 0

series z = y

smpl if y < 0

z = na

generates a series Z containing the contents of Y, but with all negative values of Y set to “NA”.

NA values will also be generated by mathematical operations that are undefined:

series y = nrnd

y = log(y)

will replace all positive value of Y with log(Y) and all negative values with “NA”.

series test = (yt <> na)

creates the series TEST which takes the value one for nonmissing observations of the series YT. A zero value of TEST indicates missing values of the series YT.

Note that the behavior of missing values has changed since EViews 2. Previously, NA values were coded as 1e-37. This implied that in EViews 2, you could use the expression:

series z = (y>=0)*x + (y<0)*na

to return the value of Y for non-negative values of Y and “NA” for negative values of Y. This expression will now generate the value “NA” for all values of Y, since mathematical expressions involving missing values always return “NA”. You must now use the smpl statement as in the first example above, or the @recode or @nan function.

Cross-references

See “Missing Values” on page 132 of the User’s Guide for a discussion of working with missing values in EViews.

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