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

pagecontract—385

takes only the INCOME and CONS series from the PAGE1 of the NEWDATA workfile, and appends them to the current workfile page.

pageappend(alltypes, suffix="_1") mydata

appends all objects from MYDATA, merging series with matching names, and renaming other matching objects by appending “_1” to the end of the name.

Cross-references

See “Appending to a Workfile” on page 232 of the User’s Guide for discussion.

See also pagecopy (p. 386).

pagecontract Command

Contract the active workfile page according to the specified sample.

Syntax

Command: pagecontract smpl_spec

where smpl_spec is a sample specification. Contraction removes observations not in specified sample from the active workfile page. Note that since this operation is performed in place, you may wish to backup your original page (see pagecopy (p. 386)) prior to contracting.

Examples

pagecontract if income<50000 and race=2

removes all observations with INCOME values less than or equal to 50000 and RACE not equal to 2.

pagecontract 1920 1940 1945 2000

removes observations for the years 1941 to 1944.

Cross-references

See “Contracting a Workfile” on page 235 of the User’s Guide for discussion.

See also pagecopy (p. 386).

386—Appendix B. Command Reference

pagecopy Command

Copies all or part of the active workfile page to a new workfile, or to a new page within the default workfile.

Syntax

Command: pagecopy(options) [object_list]

where the optional object_list specifies the workfile objects to be copied. If object_list is not provided, all objects will be copied subject to the option restrictions discussed below.

If copying objects to a new page within the default workfile, you may choose to copy series objects (series, alphas, and links) by value or by link (by employing the “bylink” option). If you elect to copy by value, links in the source page will converted to ordinary series and alpha objects when they are copied. If you copy by link, series and alpha objects in the source page are converted to links when copied. The default is to copy by value.

If you copy objects to a new workfile, data objects must be copied by value.

Options

bylink

Specifies that series and alpha objects be copied as

 

links to the source page. This option is not available if

 

you use the “wf=” option, since linking requires that

 

the destination page be in the same workfile as the

 

source page. Automatically sets the “dataonly” option

 

so that only series, alphas, links, and valmaps will be

 

copied.

 

 

smpl=smpl_spec

Specifies an optional sample identifying which observa-

 

tions from the source page are to be copied. Either pro-

 

vide the sample range in double quotes or specify a

 

named sample object. The default is “@all”.

 

 

rndobs=integer

Copy only a random subsample of integer observations

 

from the specified sample. Not available with “bylink”

 

or “rndpct”.

 

 

rnpct=arg

Copy only a random subsample of arg (a number

 

between 0 and 1) of the specified sample. Not available

 

with “bylink” or “rndobs”.

 

 

pagecopy—387

 

 

 

 

 

 

 

 

dataonly

Only series, alphas, links, and valmaps should be cop-

 

 

 

ied. The default is to copy all objects (unless the

 

 

 

“bylink” option is specified, in which case only series

 

 

 

objects are copied).

 

 

 

 

 

 

nolinks

Do not copy links from the source page.

 

 

 

 

wf=wf_name

Optional name for the destination workfile. If not pro-

 

 

 

vided, EViews will create a new untitled workfile. Not

 

 

 

available if copying using the “bylink” option.

 

 

 

 

 

 

page=page_name

Optional name for the newly created page. If not pro-

 

 

vided, EViews will use the next available name of the

 

 

form “Untitled##”, where ## is a number.

Examples

pagecopy(page=allvalue, wf=newwf)

will first create a new workfile named NEWWF, with a page ALLVALUE that has the same structure as the current page. Next, all of the objects in the active workfile page will be copied into the new page, with the series objects copied by value. In contrast,

pagecopy(bylink, page=alllink)

will instead create a page ALLLINK in the existing workfile, and will copy all series objects by creating links in the new page.

pagecopy(page=partcopy, bylink, smpl="1950 2000 if gender=""male""") a* *z

will create a new page named PARTCOPY in the existing workfile containing the specified subsample of observations, and will copy all series objects in the current page beginning with the letter “A” or ending with the letter “Z”. The objects will be copied by creating links in the new page.

pagecopy(page=rndcopy, smpl="1950 2000 if gender=""male""", rndobs=200, dataonly, nolinks)

creates a new workfile and page RNDCOPY containing a 200 observation random sample from the specified subsample. Series and alpha objects only will be copied by value from the source page.

Cross-references

See “Copying from a Workfile” on page 236 of the User’s Guide for discussion.

See also pageappend (p. 383).

388—Appendix B. Command Reference

pagecreate Command

Create a new page in the default workfile. The new page becomes the active page.

Syntax

Command: pagecreate(options) freq start_date end_date [num_cross_sections]

Command: pagecreate(options) u num_observations

Command: pagecreate(id_method[,options]) id_list [@srcpage page_list]

Command: pagecreate(idcross[,options]) id1 id2 [@srcpage page1 page2]

Command: pagecreate(idcross[,options]) id1 @range(freq, start_date, end_date) [@srcpage page1]

These different forms of the pagecreate command encompass three distinct approaches to creating a new workfile page: (1) regular frequency description or unstructured data description; (2) using the union or intersection of unique values from one or more ID series in existing workfile pages; (3) using the cross of unique values from two identifier series or from an identifier series and a date range. Each of these approaches is described in greater detail below.

Regular Frequency or Unstructured Description

The first two forms of the command permit you to create a new workfile page using a regular frequency or unstructured description:

pagecreate(options) freq start_date end_date [num_cross_sections]

pagecreate(options) u num_observations

The first form of the command should be employed to create a regular frequency page with the specified frequency, start, and end date. The freq argument may be specified as “a” (annual), “s” (semi-annual), “q” (quarterly), “m” (monthly), “w” (weekly), “d” (5-day daily), “7” (7-day daily). If you include the optional argument num_cross_sections, EViews will create a balanced panel page using integer identifiers for each of the cross-sections. Note that more complex panel structures may be defined using pagestruct (p. 399).

The second form of the command creates an unstructured workfile with the specified number of observations.

Note that these forms of the command are analogous to wfcreate (p. 531) except that instead of creating a new workfile, we create a new page in the default workfile.

pagecreate—389

Unique Values from a Set of Identifier Series

The next form of the command allows for creating pages from the unique values of one or more identifier series found in one or more workfile pages:

• pagecreate(id_method[,options]) identifier_list [@srcpage page_list]

The identifier_list should include one or more ID series. If more than one ID series is provided, EViews will use the values that are unique across all of the series. If you wish to create a page with a date structure, you should specify one of your identifiers using the special “@DATE” keyword identifier, enclosing the series (or the date ID component series) inside parentheses. If you wish to use the date ID values from the source workfile page, you may use the “@DATE” keyword without arguments.

The id_method describes how to handle unique ID values that differ across multiple pages:

byid

Use the observed values of the series in the

 

identifier_list in specified page.

 

 

idunion / byid

Use the union of the observed values of the series in the

 

identifier_list in the specified pages.

 

 

idintersect

Use the intersection of the observed values of the series

 

in the identifier_list in the specified pages.

 

 

If the optional source page or list of source pages is not provided, EViews will use the default workfile page. Note that if a single workfile page is used, the two ID methods yield identical results.

Cross of Unique Values from Two Identifier Series or from an Identifier Series and a Date Range

The last two forms of the command create a new page by crossing the unique values in two ID series located in one or more pages, or by crossing an ID series from one page with a date range. First, you may specify a pair of identifiers, and optionally source pages where they are located,

• pagecreate(idcross[,options]) id1 id2 [@srcpage page1 page2]

You may instruct EViews to create a date structured page by specifying one of your two identifiers using a “@DATE” specification as described above.

Alternately, you may provide a single identifier and a range specification using the “@RANGE” keyword with a freq, start_date, and end_date, and optionally, the location of the identifier series.

pagecreate(idcross[,options]) id1 @range(freq, start_date, end_date) [@srcpage page1]

390—Appendix B. Command Reference

Options

smpl=smpl_spec Specifies an optional sample identifying which observations to use when creating a page using the id_method option. Either provide the sample range in double quotes or specify a named sample object. The default is “@all”. When multiple source workfiels are involved, the specified sample must be valid for all workfiles.

page=page_name Optional name for the newly created page. If not provided, EViews will use the next available name of the form “Untitled##”, where ## is a number.

Examples

Regular Frequency or Unstructured Description

The two commands:

pagecreate(page=annual) a 1950 2005

pagecreate(page=unstruct) u 1000

create new pages in the existing workfile. The first page is an annual page named ANNUAL, containing data from 1950 to 2005; the second is a 1000 observation unstructured page named UNSTRUCT.

pagecreate(page=mypanel) a 1935 1954 10

creates a new workfile page named MYPANEL, containing a 10 cross-section annual panel for the years 1935 to 1954.

Unique Values from a Set of Identifier Series

pagecreate(id, page=statepage) state

creates a new page STATEIND using the distinct values of STATE in the current workfile page.

pagecreate(id, page=statepage) state industry

creates a new page named STATEIND, using the distinct STATE/INDUSTRY values in the active page.

pagecreate(id, page=stateyear) state @date(year)

pagecreate(id, page=statemonth) @date(year, month)

use STATE, along with YEAR, and the YEAR and MONTH series respectively, to form identifiers that will be used in creating the new dated workfile pages.

pagecreate—391

pagecreate(id, smpl="if sex=1") crossid @date

creates a new page using CROSSID and existing date ID values of the active workfile page. Note that only observations in the subsample defined by “@all if sex=1” are used to determine the unique values.

pagecreate(id, page=AllStates, smpl="if sex=""Female""") stateid @srcpage north south east west

creates a new page ALLSTATES structured using the union of the unique values of STATEID from the NORTH, SOUTH, EAST and WEST workfile pages that are in the sample “if sex="Female"”. Note the use of the double quote escape character for the double quotes in the sample string.

pagecreate(idintersect, page=CommonStates, smpl="1950 2005") stateid @srcpage page1 page2 page3

creates a new page name COMMONSTATES structured using the intersection of the unique values of STATEID taken from the pages PAGE1, PAGE2, and PAGE3.

Cross of Unique Values from Two Identifier Series or from an Identifier Series and a Date Range

pagecreate(idcross,page=UndatedPanel) id1 id2 @srcpage page1 page2

will add the new page UNDATEDPANEL to the current workfile. UNDATEDPANEL will be structured as an undated panel using values from the cross of ID1 from PAGE1 and ID2 from PAGE2.

To create a dated page using the “idcross” option, you must tag one of the identifiers using an “@DATE” specification:

pagecreate(idcross,page=AnnualPanel) id1 @date(year) @srcpage page1 page2

You may also specify the cross of an identifier with a date range:

pagecreate(idcross,page=QuarterlyPanel) id1 @range(q, 1950, 2006) @srcpage page1

creates a quarterly panel page named QUARTERLYPANEL using the cross of ID1 taken from PAGE1, and quarterly observations from 1950q1 to 2006q4.

Cross-references

See “Creating a Workfile Page” on page 62 of the User’s Guide for discussion.

See also wfcreate (p. 531) and pagedelete (p. 392).

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