Command Reference : Command Reference
  
 
pagestack
Create a panel structured workfile page using series, alphas, or links from the default workfile page (convert repeated series to repeated observations).
Series in the new panel workfile may be created by stacking series, alphas, and links whose names contain a pattern (series with names that differ only by a “stack identifier”), or by repeating a single series, alpha, or link, for each value in a set of stack identifiers.
Syntax
pagestack(options) stack_id_list [@ series_to_stack]
pagestack(options) pool_name [@ series_to_stack]
pagestack(options) series_name_pattern [@ series_to_stack]
The resulting panel workfile will use the identifiers specified in one of the three forms of the command:
stack_id_list includes a list of the ID values (e.g., “US UK JPN”).
pool_name is the name of a pool object that contains the ID values.
series_name_pattern contains an expression from which the ID values may be determined. The pattern should include the “?” character as a stand in for the parts of the series names containing the stack identifiers. For example, if “CONS?” is the series_name_pattern, EViews will find all series with names beginning with “CONS” and will extract the IDs from the trailing parts of the observed names.
The series_to_stack list may contain two types of entries: stacked series (corresponding to sets of series, alphas, and links whose names contain the stack IDs) and simple series (other series, alphas, and links).
To stack a set of series whose names differ only by the stack IDs, you should enter an expression that includes the “?” character in place of the IDs. You may list the names of a single stacked series (e.g., “GDP?” or “?CONS”), or you may use expressions containing the wildcard character “*” (e.g., “*?” and “?C*”) to specify multiple series.
By default, the stacked series will be named in the new workfile using the base portion of the series name (if you specify “?CONS” the stacked series will be named “CONS”), and will contain the values of the individual series stacked one on top of another. If one of the individual series associated with a particular stack ID does not exist, the corresponding stacked values will be assigned the value NA.
Individual (simple) series may also be stacked. You may list the names of individual simple series (e.g., “POP INC”), or you can specify your series using expressions containing the wildcard character “*” (e.g., “*”, “*C”, and “F*”). A simple series will be stacked on top of itself, once for each ID value. If the target workfile page is in the same workfile, EViews will create a link in the new page; otherwise, the stacked series will contain (repeated) copies of the original values.
When evaluating wildcard expressions, stacked series take precedence over simple series. This means that simple series wildcards will be processed using the list of series not already included as a stacked series.
If the series_to_stack list is not specified, the expression “*? *”, is assumed.
Options
 
?=name_patt, idreplace = name_patt
Specifies the characters to use instead of the identifier, ”?”, in naming the stacked series.
By default, the name_patt is blank, indicating, for example, that the stacked series corresponding to the pattern “GDP?” will be named “GDP” in the stacked workfile page. If pattern is set to “STK”, the stacked series will be named GDPSTK.
interleave
Interleave the observations in the destination stacked workfile (stack by using all of the series values for the first source observation, followed by the values for the second observation, and so on). The default is to stack observations by identifier (stack the series one on top of each other).
wf=wf_name
Optional name for the new workfile. If not provided, EViews will create a new page in the default workfile.
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
Consider a workfile that contains the seven series: GDPUS, GDPUK, GDPJPN, CONSUS, CONSUK, CONSJPN, CONSFR, and WORLDGDP.
pagestack us uk jpn @ *?
creates a new, panel structured workfile page with the series GDP and CONS, containing the stacked GDP? series (GDPUS, GDPUK, and GDPJPN) and stacked CONS? series (CONSUS, CONSUK, and CONSJPN). Note that CONSFR and WORLDGDP will not be copied or stacked.
We may specify the stacked series list explicitly. For example:
pagestack(page=stackctry) gdp? @ gdp? cons?
first determines the stack IDs from the names of series beginning with “GDP”, the stacks the GDP? and CONS? series. Note that this latter example also names the new workfile page STACKCTRY.
If we have a pool object, we may instruct EViews to use it to specify the IDs:
pagestack(wf=newwf, page=stackctry) countrypool @ gdp? cons?
Here, the panel structured page STACKCTRY will be created in the workfile NEWWF.
Simple series may be specified by adding them to the stack list, either directly, or using wildcard expressions. Both commands:
pagestack us uk jpn @ gdp? cons? worldgdp consfr
pagestack(wf=altwf) us uk jpn @ gdp? cons? *
stack the various GDP? and CONS? series on top of each other, and stack the simple series GDPFR and WORLDGDP on top of themselves.
In the first case, we create a new panel structured page in the same workfile containing the stacked series GDP and CONS and link objects CONSFR and WORLDGDP, which repeat the values of the series. In the second case, the new panel page in the workfile ALTWF will contain the stacked GDP and CONS, and series named CONSFR and WORLDGDP containing repeated copies of the values of the series.
The following two commands are equivalent:
pagestack(wf=newwf) us uk jpn @ *? *
pagestack(wf=newwf) us uk jpn
Here, every series, alpha, and link in the source workfile is stacked and copied to the destination workfile, either by stacking different series containing the stack_id or by stacking simple series on top of themselves.
The “?=” option may be used to prevent name collision.
pagestack(?="stk") us uk jpn @ gdp? gdp
stacks GDPUS, GDPUK and GDPJPN into a series called GDPSTK and repeats the values of the simple series GDP in the destination series GDP.
Cross-references
For additional discussion, see “Stacking a Workfile”. See also pageunstack.