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

EViews 5.1 Command Reference Update Summary—79

bar(l, x, o=mybar1) pop gdp cons

The bar graph is scaled on the left, while the line graphs are scaled on the right. The graph uses options from graph MYBAR1 as a template.

group mygrp oldsales newsales

mygrp.bar(s)

The first line defines a group of series and the second line displays a stacked bar graph view of the series in the group.

mygrp.bar(o=midnight, b)

creates an bar graph of the group G1, using the settings of the predefined template “midnight”, applying the bold modifier.

Cross-references

See “Graph Templates” on page 38 for a discussion of graph templates.

See graph for graph declaration and additional graph types.

copy

Command

 

 

Copy an object, or a set of objects matching a name pattern, within and between workfiles, workfile pages, and databases. Data in series objects may be frequency converted or match merged.

Syntax

Command: copy(options) src_spec dest_spec [src_id dest_id]

Command: copy(options) src_spec dest_spec [@src src_ids @dest dest_id]

where src_spec and dest_spec are of the form:

[ctype][container::][page\]object_name

There are three parts to the copy command: (1) a specification of the location and names of the source objects; (2) a specification of the location and names of the destination objects; (3) optional source and destination IDs if the copy operation involves match merging.

The source and destination objects are specified in multiple (optional) parts: (1) the container specification is the name of a workfile or database; (2) the page specification is the name of a page within a workfile or a subdirectory within a database; and (3) the object_name specification is the name of an object or a wildcard pattern corresponding to multiple objects.

80—Chapter 6. EViews 5.1 Command Reference Update Summary

The ctype specification is rarely required, but permits you to specify precisely your source or destination in cases where a database and workfile share the same name. In this case, ctype may be used to indicate the container to which you are referring by prefixing the container name with “:” to indicate the workfile, or “::” to indicate the database with the common name.

When parts of the source or destination specification are not provided, EViews will fill in default values where possible. The default container is the active workfile, unless the “::” prefix is used in which case the default container is the default database. The default page within a workfile is always the active page. The default name for the destination object is the name of the object within the source container.

If ID series are not provided in the command, then EViews will perform frequency conversion when copying data whenever the source and destination containers have different frequencies. If ID series are provided, then EViews will perform a general match merge between the source and destination using the specificed ID series. In the case where you wish to copy your data using match merging with special treatment for date matching, you must use the special keyword “@DATE” as an ID series for the source or destination. If “@DATE” is not specified as an identifier in either the source or destination IDs, EViews will perform an exact match merge using the given identifiers.

If ID series are not specified, but a conversion option requiring a general match merge is used (e.g., “c=med”), “@DATE @DATE” will be appended to the list of IDs and a general date match merge will be employed.

See linkto (p. 106) for additional discussion of the differences embodied in these choices.

The general syntax described above covers all possible uses of the copy command. The following paragraphs provide examples of the specific syntax used for some common cases of the command.

Copying Within a Workfile

Copy an object within the default workfile page as a new object with a different name:

• copy(options) src_name dest_name

Copy an object from the src_page page into the default workfile page using the specified name:

• copy(options) src_page\src_name dest_name

Copy an object from the src_page page into the dest_page page, keeping the same name:

• copy(options) src_page\src_names dest_page\

EViews 5.1 Command Reference Update Summary—81

Copy an object from the src_page page to the default workfile page, match merging any series data using a single src_id and a single dest_id identifier series:

• copy(options) src_page\src_name dest_name src_id dest_id

Copy an object from the src_page page to the dest_page match merging any series data using multiple source and destination identifier series:

copy(options) src_page\src_name dest_page\dest_name @src src_id1 src_id2 ...

src_id_n @dest dest_id1 dest_id2 ... dest_id_n

Copying Between Containers (Workfiles and Databases)

Copy one or more objects from the src_page of the workfile src_workfile to the dest_page of the workfile dest_workfile, using the name or name pattern given in src_names:

• copy(options) src_workfile::src_page\src_names dest_workfile::dest_page\

Copy an object from database src_database to the default page in the container dest_container:

• copy(options) src_database::src_name dest_container::dest_name

Note that if both a workfile and database exist matching the name provided in dest_container, EViews will favor the workfile unless the “::” prefix is used to specify explicitly that the database should be used.

Options

Basic Options

overwrite / o

Overwrite any existing object with the destination name

 

in the destination container. Error only if a non-editable

 

series is encountered in the destination location.

 

 

merge / m

If the source object is a series, merge the data from the

 

source series into any existing destination series, pre-

 

serving any values in the destination series that are not

 

present in the source. For all other object types, over-

 

write any existing object with the source object. Error if

 

a non-editable series is encountered in the destination

 

location.

 

 

protect / p

Protect objects in the destination location from over-

 

writing or merging. If there is an existing object in the

 

destination container, cancel the copy operation for that

 

object, but do not generate an error.

 

 

82—Chapter 6. EViews 5.1 Command Reference Update Summary

noerr

Suppress errors that are generated during the copy. For

 

example, if the overwrite option is used, suppress any

 

error caused by attempting to overwrite a non-editable

 

series such as an index series used in the workfile struc-

 

ture.

Group Copy Options

When copying a group object from workfile to database:

g=arg

Method for copying group objects from a workfile to

 

database: “s” (copy group definition and series as sepa-

 

rate objects), “t” (copy group definition and series as

 

one object), “d” (copy series only as separate objects),

 

“l” (copy group definition only).

 

 

When copying a group object from a database to a workfile:

g=arg

Method for copying group objects from a database or

 

workfile to a workfile: “b” (copy both group definition

 

and series), “d” (copy only the series), “l” (copy only

 

the group definition).

 

 

Note that copying a group object containing expressions or auto-updating series between workfiles only copies the expressions, and not the underlying series.

Frequency Conversion Options

If the copy command does not specify identifier series, EViews will perform frequency conversion of the data contained in series objects whenever the source and destination containers do not have the same frequency.

The following options control the frequency conversion method when copying series and group objects into a workfile page and converting from low to high frequency:

c=arg

Low to high conversion methods: “r” (constant match

 

average), “d” (constant match sum), “q” (quadratic

 

match average), “t” (quadratic match sum), “i” (linear

 

match last), “c” (cubic match last).

 

 

The following options control the frequency conversion method when copying series and group objects into a workfile page and converting from high to low frequency:

 

 

EViews 5.1 Command Reference Update Summary—83

 

 

 

 

 

 

 

 

c=arg

High to low conversion methods removing NAs: “a”

 

 

 

(average of the nonmissing observations), “s” (sum of

 

 

 

the nonmissing observations), “f” (first nonmissing

 

 

 

observation), “l” (last nonmissing observation), “x”

 

 

 

(maximum nonmissing observation), “m” (minimum

 

 

 

nonmissing observation).

 

 

 

High to low conversion methods propagating NAs: “an”

 

 

 

or “na” (average, propagating missings), “sn” or “ns”

 

 

 

(sum, propagating missings), “fn” or “nf” (first, propa-

 

 

 

gating missings), “ln” or “nl” (last, propagating miss-

 

 

 

ings), “xn” or “nx” (maximum, propagating missings),

 

 

 

“mn” or “nm” (minimum, propagating missings).

 

 

 

 

 

Note that if no conversion method is given in the command, the conversion method specified within the series object will be used as the default. If the series does not contain an explicit conversion method, the global option settings will used to determine the method.

Match Merge Options

These options are available when ID series are specified in the copy commmand.

smpl=

Sample to be used when computing contractions during

smpl_spec

copying using match merge. Either provide the sample

 

range in double quotes or specify a named sample

 

object. By default, EViews will use the entire workfile

 

sample “@ALL”.

 

 

84—Chapter 6. EViews 5.1 Command Reference Update Summary

c=arg

Set the match merge contraction method.

 

If you are copying a numeric source series by general

 

match merge, the argument can be one of: “mean”,

 

“med” (median), “max”, “min”, “sum”, “sumsq” (sum-

 

of-squares), “var” (variance), “sd” (standard devia-

 

tion), “skew” (skewness), “kurt” (kurtosis), “quant”

 

(quantile, used with “quant=” option), “obs” (number

 

of observations), “nas” (number of NA values), “first”

 

(first observation in group), “last” (last observation in

 

group), “unique” (single unique group value, if

 

present), “none” (disallow contractions).

 

If copying an alpha series, only the non-summary meth-

 

ods “max”, “min”, “obs”, “nas”, first”, “last”, “unique”

 

and “none” are supported.

 

For copying of numeric series, the default contraction

 

method is “c=mean”; for copying of alpha series, the

 

default is “c=unique”.

quant=number Quantile value to be used when contracting using the “c=quant” option (e.g, “quant=.3”).

nacat

Treat “NA” values as a category when copying using

 

general match merge operations.

Most of the conversion options should be self-explanatory. As for the others: “first” and “last” give the first and last non-missing observed for a given group ID; “obs” provides the number of non-missing values for a given group; “nas” reports the number of NAs in the group; “unique” will provide the value in the source series if it is the identical for all observations in the group, and will return NA otherwise; “none” will cause the copy to fail if there are multiple observations in any group—this setting may be used if you wish to prohibit all contractions.

On a match merge expansion, copying with match merging will repeat the value of the source for every observation with matching identifier values in the destination. If both the source and destination have multiple values for a given ID, EViews will first perform a contraction in the source (if not ruled out by “c=none”), and then perform the expansion by replicating the contracted value in the destination.

Examples

copy good_equation best_equation

makes an exact copy of GOOD_EQUATION and names it BEST_EQUATION.

EViews 5.1 Command Reference Update Summary—85

copy graph_1 wf2::wkly\graph1

copies GRAPH_1 from the default page of the current workfile to GRAPH1 in the page WKLY of the workfile WF2.

copy gdp usdat::

copies GDP from the current workfile to GDP in the USDAT database or workfile.

copy ::gdp macro1::gdp_us

copies GDP from the default database to either the open workfile MACRO1, or the database named MACRO1 if there is no open workfile with that name. If there is an open workfile MACRO1 you may use

copy ::gdp ::macro1::gdp_us

to specify explicitly that you wish to write to the MACRO1 database.

copy(smpl="1990 2000") page1\pop page2\ @src county @date @dest county @date

copies POP data for 1990 through 2005 from PAGE1 to PAGE2, match merge using the ids COUNTY and the date structure of the two pages.

copy(smpl="1990 2000", c=mean) panelpage\inc countypage\ county county

copies the INC data from the PANELPAGE to the COUNTYPAGE, match merging using the values of the COUNTY series, and contracting the panel data by computing means for each county using the specified sample.

copy countypage\pop panelpage\ county county

match merges the POP data from the COUNTYPAGE to the PANELPAGE using the values of the COUNTY series.

copy(c=x, merge) quarterly::page1\ser* annual::page6\*

copies all objects with names beginning with “SER” on page PAGE1 of workfile QUARTERLY into page PAGE6 of workfile ANNUAL using the existing names. Series objects with data that can be (high-to-low) frequency converted will take the maximum value within a low-frequency period as the conversion method. If destination series already exist with the same name as the source series, the data will be merged. If destination objects (non-series) exist with the same name as source series, they will be overwritten.

Note that since databases are read from disk, you may provide a path for the database in the container specification, as in:

Соседние файлы в папке EViews5
  • #
    23.03.201519.56 Кб19EV5help.cnt
  • #
    23.03.2015192.68 Кб19EV5Help.GID
  • #
    23.03.201513.28 Mб19EV5help.hlp
  • #
    23.03.20151.19 Mб71EViews 5.1 Update.pdf
  • #
    23.03.201551 б20EViews32.ini
  • #
    23.03.2015654 б19Eviews5.exe.manifest
  • #
    23.03.2015995 б18EVX11.PIF
  • #
    23.03.201540.58 Кб20F77L3.EER
  • #
    23.03.2015424.32 Кб22johtab.bin