Aggregation Example


You may wish to print out this help topic to help you follow the instructions below.

An example HAR file is supplied with ViewHAR to demonstrate mappings and aggregation.

The file is AGGEXM.HAR and should be located in the same directory as VIEWHAR.EXE. That directory will often be C:\GP.

Use ViewHAR to open the file. Examine some of the headers and verify that they show data relating to 23 commodities (2 of which are margin commodities) and 22 industries.

The file also contains 6 headers which allow it to be aggregated.

Header ACOM defines a set AGGCOM of 9 aggregated industries and header MCOM shows how the 23 members of COM map to the 9 elements of AGGCOM.

Similarly, header AIND defines a set AGGIND of 9 aggregated industries and header MIND shows how the 22 members of IND map to the 9 elements of AGGIND.

Headers AMAR and MMAR do the same job for the margin commodities.

Headers AND2 and MND2 define an alternative mapping for IND, this time to just 3 sectors.

To illustrate different techniques, we have made header MIND an array of integers; the other mappings are arrays of strings. You can specify a mapping in either way.

Now use Aggregation...Choose Mappings to launch the mappings dialog. You should see a list of the 4 mappings ComAgg, IndAgg, MarAgg, and IndAgg2. Click on them to see the contents of each mapping.

Try using the Copy button to put the currently selected mapping on the clipboard; from there paste it into a spreadsheet.

Each mapping has a check box; which, by default, is not selected. Click the check box for ComAgg so that a tick appears within it. Then click Create Aggregated File. The dialog will close and a new Contents screen will appear.

In the new Contents list all COM dimensions have been replaced by AGGCOM. If you click on individual items to examine them you will see that each matrix which had a COM dimension has now been aggregated.

Click Aggregation...View Original File to see the unaggregated file again, and then Aggregation...View Aggregated File to return to the aggregated file. ViewHAR keeps both files open at once and you can toggle between them.

Return to Aggregation...Choose Mappings and activate all three mappings (ComAgg, IndAgg and MarAgg) by ticking the check box box for each of them. Again click Create Aggregated File. Now COM is replaced by AGGCOM, IND by AGGIND, and MAR by AGGMAR. Again toggle between aggregated and original views of the file, examining individual items.

Return to Aggregation...Choose Mappings and activate the IndAgg2 mapping. Notice you cannot simultaneously activate both the IndAgg and IndAgg2 mappings, since both operate on the same original set IND. Again click Create Aggregated File, and examine the aggregated file.

Two check boxes in the Choose Mappings dialog can be used to control:

(a) whether matrices in the original file which are not affected by currently active mappings are copied unchanged to the aggregated file; and

(b) whether sets in the aggregated file retain their old names (even though they have fewer elements).

You can perform almost the same range of operations on the aggregated file as on the original file. You can import, modify or delete headers. However, any such changes will be lost next time you use the Choose Mappings dialog to Create Aggregated File. Use the Aggregation...Save Aggregated File command to save the aggregated version if you wish.

See also:

Choose Mappings

View Original File

View Aggregated File

Save Aggregated File

Save Mappings to file

How mappings are stored on HAR files

Create new mapping



URL of this topic: www.copsmodels.com/webhelp/viewhar/hc_aggregexm.htm

Link to full GEMPACK Manual

Link to GEMPACK homepage