User’s Guide : EViews Fundamentals : Series Links : Creating a Link
  
Creating a Link
 
Creating a link using copy-and-paste or drag-and-drop
General match merge links
Destination name
Destination type
Match merge options
Match ID information
Link calculation settings
Date match merge links
Frequency conversion links
Creating a link by command
Links may be created interactively either by copying-and-pasting or drag-and-dropping a series from the source to the destination page, or by issuing a link declaration in the destination page.
Creating a link using copy-and-paste or drag-and-drop
To define a link using copy-and-paste, first select one or more source series in the source workfile page, and either click on the right mouse button and select Copy, or select Edit/Copy from the main EViews menu. Next, switch to the destination page by clicking on the appropriate tab, and either click on the right mouse button and select Paste Special..., or select Edit/Paste Special... from the main menu.
Alternately, you may right-click to select the source series, then drag-and-drop to the destination page. EViews will display the Paste Special dialog.
General match merge links
Here we have used Paste Special... to copy-and-paste the series TAXRATE from the source page into a destination page. If neither the source nor the destination series are dated pages, EViews will display a dialog prompting you to merge by date or by match merge. Select General match merge criteria in the bottom left to specify match merge options.
Destination name
The field in the upper left-hand portion of the dialog should be used for specifying the name of the destination object. Here, we have the default wildcard value of “*” indicating that the series named TAXRATE in the source page will be used in the destination page. We may modify the name by typing an explicit name such as “NEWTAX”, or by entering an expression containing the wildcard character. For example, if we wish to use the name “NEWTAXRATE” in the destination page, we may enter “NEW*” in the edit field.
The wildcard processing is particularly useful if you are copying multiple series into a new page since it facilitates batch renaming of series.
Destination type
Next, you will choose between pasting the series by value, or pasting the series as a link. If you paste by value, EViews will create an ordinary series in the destination page, and will fill it with the values from the link evaluation. If you paste your series as a link, EViews will create an actual link object containing the desired specification. As you might expect, there are significant differences between the two methods of copying your series.
In the first method, the link computations are performed immediately and the destination series values are assigned at the time the series is created. This behavior follows the traditional model of match merging and frequency conversion in which the operation is performed once to compute static values.
When you paste your series as a link, EViews defines a link object containing a specification of the match merge or frequency conversion. At creation, the link object is not evaluated and uses no memory. Then, whenever you access the values in the link series, EViews will determine whether the object needs evaluation and if so, will allocate memory and perform the link calculations.
With links, you gain the benefits of efficient memory use and dynamic updating of the values in the destination, at the cost of some speed since the link calculations may be performed more than once. Along these lines, it is worth pointing out that links may be converted into ordinary series at any time. Once a series is created, however, it may not be converted back into a link.
Match merge options
Whether you elect to create a new series with fixed values or to create a new link series, you must specify link options.
Match ID information
First, you must specify the information that EViews will use to identify matches between observations in the two pages.
In the Source ID and Destination ID edit fields, you will enter the names of one or more source ID series and one or more destination ID series. The number and order of the names in the two fields should match. Thus, if you wish to match both CXID1 and PERIOD1 in the source page to CXID2 and PERIOD2 in the second page, you should enter the sets of names in parallel. Here, we choose to match observations using the values of the STATE1 series in the source page and the values of the STATE2 series in the destination page.
Next, there is a checkbox labeled Treat NA as ID category for whether to use observations which have NA values in the source and destination ID values. By default, observations are ignored if there are NAs in the ID series; by selecting this option, you instruct EViews to match observations with NA ID values from the source page to observations with NA ID values in the destination page.
Link calculation settings
The remaining options are used when computing the link values.
First, you should specify a source series contraction method. As described in “Linking by general match merging”, the first step in every match merge is to perform a contraction to ensure uniqueness of the source values. Since contraction is always performed, you should pay attention to your contraction method even when the source IDs are unique, since some settings will not yield the original source data.
There is an extensive list of contractions from which you may choose. For links involving numeric series you may choose to employ obvious methods such as the Mean (default) or the Median of the observations, or less obvious summary statistics such as the Variance (population), Std. Deviation (sample), Kurtosis, Quantile, Number of obs, or Number of NAs.
For links involving alpha series, you must select from a subset of the numeric contractions: Unique values (default), No contractions allowed, First, Last, Maximum, Minimum, Number of obs, Number of NAs.
Most of these options are self-explanatory, though a few comments about the choice of method may prove useful.
First, there are two options at the bottom of the list which deserve additional explanation. The last choice, No contractions allowed, may be used to ensure that contractions are never performed prior in the first step of a link match merge. The option is designed for cases where you believe that your source ID values are unique, and wish the link to generate an error if they are not.
The Unique values option provides a less strict version of the No contractions allowed setting, allowing for non-unique source ID values so long as any observations with matching IDs share the same source series value. In this case, the contraction will simply identify the unique source value associated with each unique source ID value. If there are observations with a single ID that have more than one source series value, the link will generate an error.
To see the difference between the two settings, note that contracting the following SOURCE and ID series
 
ID
Source
1
80
1
80
1
80
2
100
2
100
generates an error with the Unique values setting, but not with the No contractions allowed setting. Alternatively, the SOURCE and ID series
 
ID
Source
1
80
1
80
1
50
2
100
2
100
generate errors with both contractions.
Second, you should note that if you select First or Last, EViews will contract the source series by selecting the first or last observation in each set of observations with repeated source IDs. First or Last is defined here as depending on the order in which the observations appear in the original source workfile. Thus, selecting First means that the contracted value for each source ID value will be taken from the first observation in the workfile with that ID value.
Lastly, you should bear in mind that unless you select No contractions allowed or Unique values, EViews will perform a first stage contraction of the data using the specified settings. In cases where the source ID values are not unique, this contraction is a necessary step; in cases where the source ID values are unique, the contraction is not necessary for the resulting one-to-one or one-to-many match merge, but is performed so that EViews can support more complicated many-to-many merge operations.
For most of the choices, performing a contraction on the unique source data has no practical effect on the outcome of a one-to-one or one-to-many match merge. For example, a choice of any of the data preserving options: Mean, Median, Maximum, Minimum, Sum, First, Last, Unique values, or No contractions allowed will create a link that performs the standard one-to-one or one-to-many match merge of the values of the original source series into the destination page.
On the other hand, selecting a contraction method that alters the source values will create a link that performs a match merge of the summary values into the destination page. Thus, selecting Sum of Squares, Variance (population), Std. Deviation (sample), Skewness, Kurtosis, Quantile, Number of obs, or Number of NAs, will generate link values that differ from those obtained in a traditional one-to-one or one-to-many match merge.
It is worth emphasizing that the default contraction setting, Mean, preserves values for data with unique source IDs. Thus, unless you specifically set the contraction method to a non-preserving method, a one-to-one or one-to-many match merge will link the original values into the destination page. You may also ensure that EViews performs the traditional one-to-one or one-to-many match merge by selecting any of the other value preserving transformation methods, or even better by selecting No contractions allowed or Unique values to validate the IDs.
Finally, in the Source sample edit field, you should enter a description of the source sample to be used when constructing link values. By default, the full sample keyword “@ALL” is entered in the field so that EViews will use all of the observations in the source page.
One important application involving sample settings is to restrict the observations over which the contraction is performed prior to performing the match merge. Suppose, for example, that we have a workfile with observations on individuals with state of residence. Then we could construct two links from the individual page to a state page, one of which computes the mean INCOME for males in each state, and another which computes the mean INCOME for females.
Date match merge links
Dates may be used in matching in two ways: exact matching or date matching (see “Linking by date match merging” for details).
Suppose we have a workfile containing the quarterly data on PROFITS described earlier. The quarterly PROFITS data is contained in a regular frequency quarterly workfile page. Also contained in the page is a date series DT generated by taking the first instance in each quarter (“series dt=@date”). We show here DT formatted to show the day-month-year, alongside the PROFIT series.
Contained in a separate, unstructured page are advertising data ADVERT, and another series DT showing the corresponding irregular dates.
If we attempt to match merge these data using the DT date series as identifiers, EViews will use the first method, exact matching, to identify common observations. Thus, if we try to link the PROFIT data into the advertising page using the DT series as the identifiers, we will find that there are no observations in the quarterly source page that match observations in the irregular daily destination page. The resulting link values will all be NAs.
When one or both of the pages follow a regular frequency, we may instruct EViews to employ date matching. We may do so by using the special ID keyword “@DATE” as an ID in the regular frequency page ID to indicate that we wish to use date matching with the built-in date identifiers given by the structure of the page. In this case, we will use “@DATE” as the ID for the regular frequency quarterly page, and match it against the values in the DT series in the destination page.
In this example, we use the Paste Special dialog to instruct EViews to copy the quarterly PROFIT series to a link named PROFIT1 in the destination page. We select General match merge criteria and employ date matching to match the quarters in the source page to the values in the DT series in the destination page, rounding to the lowest common frequency.
We first compute a Mean contraction of the source data for all observations, then match merge the contracted results into the destination. Note that since the match merge in this example is one-to-many, the Mean contraction method is irrelevant since it leaves the source data unchanged. If we wish to guarantee that the source IDs are unique, we may change the Contraction method to No contractions allowed.
In the special case where you have two dated structured pages, you may construct the link using the “@DATE” keyword for both page identifiers. Here, where the advertising page is structured as an (irregular) daily dated page, we could replace DT in the destination index field with the keyword “@DATE”.
If “@DATE” is used as an ID in both pages, EViews will use the observation date identifiers associated with the structure of each page, round them to the lowest common frequency, and then find matching observations.
Frequency conversion links
In the special case where we link numeric series between two regular frequency pages, we may copy-and-paste to define a link (or a by value copy of the source series) that employs frequency conversion (“Linking by date with frequency conversion”). In this setting, the Paste Special dialog offers you an additional choice between linking by general match merge, or linking by date using frequency conversion.
If you select General match merge criteria in the Merge by section of the dialog, the right side of the dialog will change to show the standard match merge version described in “General match merge links”.
Alternately, to define a frequency conversion link, click on the Date with frequency conversion selection. The dialog will change to display the frequency conversion options for converting data both from high to low, and low to high frequency.
By default, EViews will use the high to low and the low to high conversion methods specified in the original source series.
If you wish to change the high to low conversion methods, simply select the desired setting from the drop-down menu. In addition, if you select one of the non-default methods, choose whether to select the No conversion of partial periods checkbox. If this setting is selected, EViews will propagate NAs when performing the frequency conversion so that the average of observations with an NA value will not drop the observation, and will instead generate an NA.
Note that the last conversion method, No down conversions, may be used to disallow down frequency conversion of the data. This setting allows you to ensure that when evaluated, the link involves same frequency (one-to-one) or low to high (one-to-many) frequency conversion, otherwise the link evaluation will generate an error.
To set the low to high conversion method, select the desired method from the drop-down menu. Once again, the last frequency conversion method, No up conversions, allows you to inform EViews that you expect the link to work only for same frequency, or high-to-low frequency linking, and that the link evaluation should generate an error if it encounters data requiring up conversion.
Creating a link by command
While the copy-and-paste interface is the easiest approach to specifying a link, we note that you may also create links using the link declaration statement and the linkto procedure.
You may, at the command line, enter the keyword link followed by the name of a new link object. EViews will create a new, incompletely specified, link object in the current (destination) workfile page. The destination page should be active when you enter the command.
You may modify a link specification, defining link IDs, as well as contraction and in some cases, expansion methods using the linkto proc.
Consider our earlier example where we link the TAXRATE data from the state page to the individual page. The following command creates a link object in the current workfile page:
link taxrate2
You may modify the TAXRATE2 link by providing a link definition using the linkto procedure. The linkto keyword should be followed by the name of the source series and the source and destination IDs, with the latter separated by @src and @dest keywords. For example, if the link object TAXRATE2 exists in our individual page, the link proc:
taxrate2.linkto state::taxrate @src state1 @dest state2
instructs EViews to define the link TAXRATE2 so that it uses the TAXRATE series in the source page named “STATE” as the source series, and matches the source page STATE1 values to the current page STATE2 values.
In the special case where there is only one ID series in each page, we may, without introducing ambiguity, omit the @src and @dest keywords. Here, we may shorten our link definition statement to:
taxrate2.linkto state::taxrate state1 state2
Lastly, we may combine these declaration and definition statements into one. The command
link taxrate2.linkto state::taxrate state1 state2
both creates a link object in the active workfile page and defines the source and link ID series.
In this one-to-many example where we link state data to individuals, we need not consider contraction methods as the default (mean) contraction method preserves the original data. If you wish to disallow contractions, or to limit them to cases where the values of the source data are unique, you may use contraction options as in:
link taxrate2.linkto(c=none) state::taxrate state1 state2
or
link taxrate2.linkto(c=unique) state::taxrate state1 state2
Conversely, linking the SALES data from the individual page to the state page yields a many-to-one conversion in which the contraction method is important. In this setting, we may optionally specify a contraction method so that when the state page is active, the statement
link sales2.linkto(c=sum) indiv::sales state2 state1
links the SALES data from the “INDIV” source page, matching the source page STATE2 values to the current page STATE1 values, and contracting observations using the sum transformation. If the contraction option is not provided, EViews will use the mean contraction default.
In the special case where you wish to link your data using date matching, you must use the special keyword @date as an ID series for the regular frequency page. For example, when linking from our quarterly to our advertising page, we may specify:
link profit1.linkto quarterly::profit @date dt
to tell EViews to link the quarterly page PROFIT data, matching the built-in identifier for the quarter with the date series DT in the destination advertising page.
As in the copy-and-paste interface, the presence of the special @date keyword tells EViews that you wish to perform date matching using the date structure of the corresponding regular frequency page. If @date is not specified as an ID, EViews will employ a general match merge using the specified identifiers.
When linking data between dated regular frequency workfile pages, the linkto proc will perform a frequency conversion link between the two pages unless ID series are explicitly provided, or a general match merge specific conversion method (such as variance or kurtosis) is specified. Thus, issuing the command
link profit2.linkto quarterly::profit
in an annual page, creates a frequency conversion link PROFIT2 using the PROFIT data from the quarterly page. Since no conversion options are provided, EViews will use the default frequency conversion method specified in the quarterly PROFIT series.
If ID series are provided, EViews will perform the link using general match merging. Thus, the closely related command
link profit2a.linkto quarterly::profit @date @date
will produce a link named PROFIT2A that employs date match merging using the dates in the workfile page structures. Since no conversion options are provided. EViews will use the default match merge contraction method, taking means, to perform the conversion.
If no ID series are specified, but a match merge specific option is provided, “@DATE @DATE” is appended to the ID list, and general match merging is assumed. Thus, the command
link profit2b.linkto(c=med) quarterly::profit
is equivalent to
link profit2b.linkto(c=med) quarterly::profit @date @date
since “c=med” is a match merge specific conversion option. This link is evaluated using general match merging, with date matching.
For additional details see Link and linkto .