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

Chapter 2. Object and Command Basics

This chapter provides an overview of the command method of working with EViews and EViews objects. If you are new to EViews, you may find it useful to consult the User’s Guide (especially Chapter 1, “Introduction”, on page 15 and Chapter 4, “Object Basics”, beginning on page 71) for a more detailed introduction to EViews and a discussion of objects, their views, and procedures.

The command line interface of EViews is comprised of a set of single line commands, each of which may be classified as one of the following:

object declarations.

object commands.

object assignment statements.

auxiliary commands.

An EViews program is composed of a sequence of these commands, and may also contain the following:

control variable assignment statements.

program control statements.

The use of control variables and program control statements is discussed in detail in the programming guide in Chapter 6, “EViews Programming”, on page 83. The following sections provide an overview of the first four types of commands.

Object Declaration

The first step is to create or declare an object. A simple declaration has the form:

object_type object_name

where object_name is the name you would like to give to the new object and object_type is one of the following object types:

 

 

Alpha (p. 154)

 

Model (p. 170)

 

Sym (p. 183)

 

 

 

 

 

 

 

 

 

Coef (p. 155)

 

Pool (p. 171)

 

System (p. 184)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Equation (p. 157)

 

Rowvector (p. 174)

 

Table (p. 187)

 

 

 

 

 

 

 

 

 

Graph (p. 161)

 

Sample (p. 176)

 

Text (p. 188)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6—Chapter 2. Object and Command Basics

 

 

 

Group (p. 163)

 

Scalar (p. 176)

 

Valmap (p. 189)

 

 

 

 

 

 

 

 

 

 

 

Logl (p. 166)

 

Series (p. 177)

 

Var (p. 190)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Matrix (p. 168)

 

Sspace (p. 179)

 

Vector (p. 193)

For example, the declaration

 

 

 

 

 

 

series lgdp

 

 

 

 

creates a new series called LGDP, while the command

equation eq1

creates a new equation object called EQ1.

Matrix objects are typically declared with their dimension in parentheses after the object type. For example:

matrix(5,5) x

creates a 5 × 5 matrix named X, while

coef(10) results

creates a 10 element coefficient vector named RESULTS.

Note that in order to create an object you must have a workfile currently open in EViews. You can open or create a workfile interactively from the File Menu, or you can use the load or workfile commands to perform the same operations inside a program. See Chapter 3, “Workfile Basics”, on page 47 of the User’s Guide for details.

Object Commands

An object command is a command which accesses an object’s views and procedures (procs). Object commands have two main parts, a display action followed by a view specification. The view specification describes the view or procedure of the object to be acted upon. The display action determines what is to be done with the output from the view or procedure.

The complete syntax for an object command has the form:

action(action_opt) object_name.view_or_proc(view_proc_opt) arg_list

where:

 

action ...............

is one of the four verbs (do, freeze, print, show)

action_opt ...........

an option that modifies the default behavior of the action

 

Object Commands—7

 

 

object_name

......the name of the object to be acted upon

view_or_proc ...the object view or procedure to be acted upon

view_proc_opt .......

an option that modifies the default behavior of the view or proce-

 

dure

arg_list .................

a list of view or procedure arguments, generally separated by

 

spaces

The four possible actions are:

do executes procedures without opening a window. If the object’s window is not currently displayed, no output is generated. If the objects window is already open, do is equivalent to show.

freeze creates a table or graph from the object view window.

print prints the object view window.

show displays the object view in a window.

In most cases, some of the components of the general object command are not necessary since some views and procs do not require an argument list or options.

Furthermore, you need not explicitly specify an action. If no action is provided, the show action is assumed for views and the do action is assumed for procedures. For example, when using the command to display the series view for a line graph:

gdp.line

EViews implicitly adds a show command:

show gdp.line

Alternatively, for the equation procedure ls,

eq1.ls cons c gdp

there is an implicit do action.

do eq1.ls cons c gdp

In some cases, you may wish to modify the default behavior by explicitly describing the action. For example:

print eq1.ls cons c gdp

both performs the implicit do action and then sends the output from the proc to the printer.

show gdp.line

print(l) group1.stats

8—Chapter 2. Object and Command Basics

freeze(output1) eq1.ls cons c gdp

do eq1.forecast eq1f

The first example opens a window displaying a line graph of the series GDP. The second example prints (in landscape mode) descriptive statistics for the series in GROUP1. The third example creates a table named OUTPUT1 from the estimation results of EQ1 for a least squares regression of CONS on GDP. The final example executes the forecast procedure of EQ1, putting the forecasted values into the series EQ1F and suppressing any procedure output.

Of these four examples, only the first opens a window and displays output on the screen.

Output Control

As discussed above, the display action determines the destination for view and procedure output. Here we note in passing a few extensions to these general rules.

You may request that a view be simultaneously printed and displayed on your screen by the letter “p” as an option to the object command. For example, the expression:

gdp.correl(24,p)

is equivalent to the two commands:

show gdp.correl(24) print gdp.correl(24)

since correl is a series view. The “p” option can be combined with other options, separated by commas. So as not to interfere with other option processing, we strongly recommend that the “p” option should always be specified after any required options.

Note that the print command accepts the “l” or “p” option to indicate landscape or portrait orientation. For example:

print(l) gdp.correl(24)

Printer output can be redirected to a text file or frozen output. See the output command in Appendix B, “Command Reference”, on page 195, and the discussion in “Print Setup” on page 941 of the User’s Guide, for details.

The freeze command used without options creates an untitled graph or table from a view specification:

freeze gdp.line

You also may provide a name for the frozen object in parentheses after the word freeze. For example,

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