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

Managing Objects—13

db c:\evdata\usdb

opens the USDB database in the specified directory if it already exists. If it does not, EViews creates a new database named USDB, opens its window, and makes it the default database.

You can also use dbopen (p. 266) to open an existing database and to make it the default database. For example:

dbopen findat

opens the database named FINDAT in the default directory. If the database does not exist, EViews will error indicating that the specified database cannot be found.

You may use dbrename (p. 269) to rename an existing database. Follow the dbrename keyword by the current (old) name and a new name:

dbrename temp1 newmacro

To delete an existing database, use the dbdelete (p. 266) command. Follow the dbdelete keyword by the name of the database to delete:

dbdelete c:\data\usmacro

dbcopy (p. 264) makes a copy of the existing database. Follow the dbcopy keyword with the name of the source file and the name of the destination file:

dbcopy c:\evdata\macro1 a:\macro1

dbpack (p. 267), dbrepair (p. 269), and dbrebuild (p. 268) are database maintenance commands. See also Chapter 10, “EViews Databases”, beginning on page 259 of the User’s Guide for a detailed description.

Managing Objects

In the course of a program you will often need to manage the objects in a workfile by copying, renaming, deleting and storing them to disk. EViews provides a number of auxiliary commands which perform these operations. The following discussion introduces you to the use of these commands; a full description of each command is provided in

Appendix B, “Command Reference”, on page 195.

Copying Objects

You may create a duplicate copy of one or more objects using the copy (p. 249) command. The copy command is an auxiliary command with the format:

14—Chapter 2. Object and Command Basics

copy source_name dest_name

where source_name is the name of the object you wish to duplicate, and dest_name is the name you want attached to the new copy of the object.

The copy command may also be used to copy objects in databases and to move objects between workfiles and databases.

Copy with Wildcard Characters

EViews supports the use of wildcard characters (“?” for a single character match and “*” for a pattern match) in destination specifications when using the copy and rename commands. Using this feature, you can copy or rename a set of objects whose names share a common pattern in a single operation. This can be useful for managing series produced by model simulations, series corresponding to pool cross-sections, and any other situation where you have a set of objects which share a common naming convention.

A destination wildcard pattern can be used only when a wildcard pattern has been provided for the source, and the destination pattern must always conform to the source pattern in that the number and order of wildcard characters must be exactly the same between the two. For example, the patterns:

Source Pattern

Destination Pattern

 

 

x*

y*

 

 

*c

b*

 

 

x*12?

yz*f?abc

 

 

conform to each other. These patterns do not:

Source Pattern

Destination Pattern

 

 

a*

b

 

 

*x

?y

 

 

x*y*

*x*y*

 

 

When using wildcards, the destination name is formed by replacing each wildcard in the destination pattern by the characters from the source name that matched the corresponding wildcard in the source pattern. Some examples should make this principle clear:

Managing Objects—15

Source Pattern

Destination Pattern

Source Name

Destination Name

 

 

 

 

*_base

*_jan

x_base

x_jan

 

 

 

 

us_*

*

us_gdp

gdp

 

 

 

 

x?

x?f

x1

x1f

 

 

 

 

*_*

**f

us_gdp

usgdpf

 

 

 

 

??*f

??_*

usgdpf

us_gdp

 

 

 

 

Note, as shown in the second example, that a simple asterisk for the destination pattern does not mean to use the unaltered source name as the destination name. To copy objects between containers preserving the existing name, either repeat the source pattern as the destination pattern,

copy x* db1::x*

or omit the destination pattern entirely:

copy x* db1::

If you use wildcard characters in the source name and give a destination name without a wildcard character, EViews will keep overwriting all objects which match the source pattern to the name given as destination.

For additional discussion of wildcards, see Appendix B, “Wildcards”, on page 943 of the

User’s Guide.

Renaming Objects

You can give an object a different name using the rename (p. 417) command. The rename command has the format:

rename source_name dest_name

where source_name is the original name of the object and dest_name is the new name you would like to give to the object.

rename can also be used to rename objects in databases.

You may use wildcards when renaming series. The name substitution rules are identical to those described above for copy.

Deleting Objects

Objects may be removed from the workfile using the delete (p. 272) command. The delete command has the format:

16—Chapter 2. Object and Command Basics

delete name_pattern

where name_pattern can either be a simple name such as “XYZ”, or a pattern containing the wildcard characters “?” and “*”, where “?” means to match any one character, and “*” means to match zero or more characters. When a pattern is provided, all objects in the workfile with names matching the pattern will be deleted. Appendix B, “Wildcards”, on page 943 of the User’s Guide describes further the use of wildcards.

delete can also be used to remove objects from databases.

Saving Objects

All named objects will be saved automatically in the workfile when the workfile is saved to disk. You can store and retrieve the current workfile to and from disk using the wfsave (p. 540) and wfopen (p. 532) commands. Unnamed objects will not be saved as part of the workfile.

You can also save objects for later use by storing them in a database. The store (p. 490) command has the format:

store(option_list) object1 object2 …

where object1, object2, ..., are the names of the objects you would like to store in the database. If no options are provided, the series will be stored in the current default database (see Chapter 10 of the User’s Guide for a discussion of the default database). You can store objects into a particular database by using the option “d=db_name” or by prepending the object name with a database name followed by a double colon “::”, such as:

store db1::x db2::x

Fetch Objects

You can retrieve objects from a database using the fetch (p. 291) command. The fetch command has the same format as the store command:

fetch(option_list) object1 object2 …

To specify a particular database use the “d=” option or the “::” extension as for store.

Basic Command Summary

The following list summarizes the EViews basic commands. The full descriptions of these commands are given in Appendix B, “Command Reference”, beginning on page 195.

A list of views and procedures available for each object may be found in Appendix A, “Object, View and Procedure Reference”, on page 153. Commands for working with matrix

Basic Command Summary—17

objects are listed in Chapter 3, “Matrix Language”, on page 23, and EViews programming expressions are described in Chapter 6, “EViews Programming”, beginning on page 83.

Command Actions

do.........................

execute action without opening window (p. 276).

freeze ...................

create view object (p. 303).

print .....................

print view (p. 409).

show ....................

show object window (p. 470).

Global Commands

cd.........................

change default directory (p. 234).

exit.......................

exit the EViews program (p. 290).

output ..................

redirect printer output (p. 380).

param ...................

set parameter values (p. 404).

rndseed ................

set the seed of the random number generator (p. 425).

smpl .....................

set current workfile sample (p. 474).

setconvert .............

set the default frequency conversion method (p. 448).

Object Creation Commands

alpha ....................

alpha series (p. 204).

coef ......................

coefficient vector (p. 243).

equation ...............

equation object (p. 286).

frml ......................

numeric or alpha series object with a formula for auto-updating

 

(p. 306).

genr......................

numeric or alpha series object (p. 308).

graph....................

graph object—create using a graph command or by merging exist-

 

ing graphs (p. 316).

group....................

group object (p. 317).

link ......................

series or alpha link object (p. 338).

logl.......................

likelihood object (p. 344).

matrix ..................

matrix object (p. 366).

model ...................

model object (p. 370).

pool......................

pool object (p. 408).

rowvector .............

rowvector object (p. 427).

sample..................

sample object (p. 429).

scalar....................

scalar object (p. 433).

series....................

numeric series (p. 442).

sspace...................

sspace object (p. 482).

18—Chapter 2. Object and Command Basics

sym .....................

sym object (p. 496).

system .................

system object (p. 497).

table ....................

table object (p. 482).

text ......................

text object (p. 508).

valmap.................

valmap object (p. 527).

var.......................

var estimation object (p. 528).

vector ..................

vector object (p. 527).

Object Container, Data, and File Commands

ccopy ...................

copy series from DRI database (p. 234).

cfetch...................

fetch series from DRI database (p. 239).

clabel...................

display DRI series description (p. 242).

close ....................

close object, program, or workfile (p. 243).

create...................

create a new workfile (p. 260).

db........................

open or create a database (p. 263).

dbcopy.................

make copy of a database (p. 264).

dbcreate ...............

create a new database (p. 265).

dbdelete ...............

delete a database (p. 266).

dbopen ................

open a database (p. 266).

dbpack.................

pack a database (p. 267).

dbrebuild .............

rebuild a database (p. 268).

dbrename.............

rename a database (p. 269).

dbrepair ...............

repair a database (p. 269).

driconvert ............

convert the entire DRI database to an EViews database (p. 280).

expand.................

expand workfile range (p. 290).

fetch ....................

fetch objects from databases or databank files (p. 291).

hconvert ..............

convert an entire Haver Analytics database to an EViews database

 

(p. 318).

hfetch ..................

fetch series from a Haver Analytics database (p. 319).

hlabel ..................

obtain label from a Haver Analytics database (p. 322).

load .....................

load a workfile (p. 344).

open ....................

open a program or text (ASCII) file (p. 373).

pageappend..........

append observations to workfile page (p. 383).

pagecontract.........

contract workfile page (p. 385).

pagecopy..............

copy contents of a workfile page (p. 386).

pagecreate............

create a workfile page (p. 388).

pagedelete............

delete a workfile page (p. 392).

 

Basic Command Summary—19

 

 

pageload ...............

load one or more pages into a workfile from a workfile or a foreign

 

data source (p. 392).

pagerename ..........

rename a workfile page (p. 393).

pagesave...............

save page into a workfile or a foreign data source (p. 394).

pageselect .............

make specified page active (p. 395).

pagestack..............

reshape the workfile page by stacking observations (p. 396).

pagestruct.............

apply a workfile structure to the page (p. 399).

pageunstack..........

reshape the workfile page by unstacking observations into multi-

 

ple series (p. 402).

range ....................

reset the workfile range (p. 413).

save......................

save workfile to disk (p. 430).

sort.......................

sort the workfile (p. 478).

unlink ..................

break links in series objects (p. 519).

wfcreate................

create a new workfile (p. 531).

wfopen .................

open workfile or foreign source data as a workfile (p. 532).

wfsave ..................

save workfile to disk as a workfile or a foreign data source

 

(p. 540).

wfselect ................

change active workfile page (p. 542).

workfile................

create or change active workfile (p. 545).

write ....................

write series to a disk file (p. 545).

Object Utility Commands

close .....................

close window of an object, program, or workfile (p. 243).

copy .....................

copy objects (p. 249).

delete ...................

delete objects (p. 272).

rename .................

rename object (p. 417).

Object Assignment Commands

data ......................

enter data from keyboard (p. 261).

frml ......................

assign formula for auto-updating to a numeric or alpha series

 

object (p. 306).

genr......................

create numeric or alpha series object.(p. 308).

rndint ...................

assign random integer values to object (p. 556).

rndseed ................

set random number generator seed (p. 425).

Graph Commands

area ......................

area graph (p. 211).

bar .......................

bar graph (p. 219).

20—Chapter 2. Object and Command Basics

errbar ..................

error bar graph (p. 287).

hilo......................

high-low(-open-close) graph (p. 320).

line......................

line-symbol graph (p. 334).

pie .......................

pie chart (p. 406).

scat......................

scatterplot (p. 435).

spike....................

spike graph (p. 479).

xy........................

XY graph with one or more X plotted against one or more Y

 

(p. 556).

xyline ..................

XY line graph (p. 558).

xypair ..................

XY pairs graph (p. 556).

Table Commands

setcell ..................

format and fill in a table cell (p. 446).

setcolwidth ..........

set width of a table column (p. 447).

setline..................

place a horizontal line in table (p. 464).

Programming Commands

open ....................

open a program file (p. 373).

output..................

redirects print output to objects or files (p. 380).

poff......................

turns off automatic printing in programs (p. 638).

pon......................

turns on automatic printing in programs (p. 638).

program ...............

create a new program (p. 410).

run ......................

read data from a foreign disk file (p. 428).

statusline .............

open a file (p. 488).

tic........................

reset the timer (p. 510).

toc .......................

display elapsed time (since timer reset) in seconds (p. 511).

Interactive Use Commands

arch .....................

estimate autoregressive conditional heteroskedasticity (ARCH and

 

GARCH) models (p. 206).

archtest................

LM test for the presence of ARCH in the residuals (p. 210).

auto .....................

Breusch-Godfrey serial correlation Lagrange Multiplier (LM) test

 

(p. 216).

binary..................

binary dependent variable models (includes probit, logit, gompit)

 

models (p. 222).

cause ...................

pairwise Granger causality tests (p. 233).

censored ..............

estimate censored and truncated regression (includes tobit) mod-

 

els (p. 238).

 

Basic Command Summary—21

 

 

chow ....................

Chow breakpoint and forecast tests for structural change (p. 241).

coint.....................

Johansen cointegration test (p. 245).

cor........................

correlation matrix (p. 255).

count....................

count data modeling (includes poisson, negative binomial and

 

quasi-maximum likelihood count models) (p. 258).

cov .......................

covariance matrix (p. 259).

cross.....................

cross correlogram (p. 260).

fit .........................

static forecast from an equation (p. 297).

forecast.................

dynamic forecast from an equation (p. 300).

gmm.....................

generalized method of moments estimation (p. 310).

hist.......................

histogram and descriptive statistics (p. 322).

hpf .......................

Hodrick-Prescott filter (p. 323).

logit......................

logit (binary) estimation (p. 344).

ls..........................

linear and nonlinear least squares regression (includes weighted

 

least squares and ARMAX) (p. 345).

ordered .................

ordinal dependent variable models (includes ordered probit,

 

ordered logit, and ordered extreme value models) (p. 378).

probit ...................

probit (binary) estimation (p. 410).

reset .....................

Ramsey’s RESET test for functional form (p. 420).

seas ......................

seasonal adjustment for quarterly and monthly time series

 

(p. 440).

smooth .................

exponential smoothing (p. 472).

solve.....................

solve a model (p. 475).

stats......................

descriptive statistics (p. 487).

testadd..................

likelihood ratio test for adding variables to equation (p. 500).

testdrop ................

likelihood ratio test for dropping variables from equation (p. 503).

tsls .......................

linear and nonlinear two-stage least squares (TSLS) regression

 

models (includes weighted TSLS, and TSLS with ARMA errors)

 

(p. 515).

22—Chapter 2. Object and Command Basics

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