The Resector Command¶
The purpose of these tools is to provide a convenient way to aggregate and disaggregate data from various sectoral levels. The routine begins by reading a file that contains concordances between various sectoral aggregation schemes. The column heading on the first line must specify the number of sectors in that aggregation scheme. This number of sectors is also the “handle” that is used to refer to that column in the resector routines.
Please see the demo section of the Inforum web site for examples of the resector capabilities.
- rs create <filename> [<Number_of_Columns> <Maximum_Number_of_Sectors>]
The create function opens the key file and reads in up to 20 columns of aggregation information (6 is the default). An optional argument can be supplied to limit the reading to more or less columns than the default. In principle, the routines handle aggregation or disaggregation between any two of the schemes read from the file. With six aggregation schemes, this results in 36 possible combinations of aggregation.
The beginning of a sample file is displayed below:
575 495 360 432 85 BEA82 1 1 1 1 1 10100 Dairy farm products 2 2 2 2 1 10200 poultry and eggs 3 3 3 3 1 10301 Meat animals 4 4 3 3 1 10302 Miscellaneous livestock-horses,bees,ho 5 5 4 4 1 20100 Cotton 6 6 5 5 1 20201 Food grains: wheat,rye,rice,buckwheat 7 7 5 6 1 20202 Feed grains: corn,oats,barley,hay,sorg 8 8 5 6 1 20203 Grass seeds 9 9 6 7 1 20300 Tobacco 10 10 7 8 1 20401 Fruits 11 11 7 8 1 20402 Tree nuts 12 12 7 9 1 20501 Vegetables 13 13 7 10 1 20502 Sugar crops
- rs formagg <Number_From> <Number_To>]
This is the first function that should be called after creation. It performs the most important initialization tasks. It sets up all of the information that is needed to aggregate from the scheme indicated as <Number_From> to the scheme indicated as <Number_To>. It sets up concordance lists and “split lists” that will be used by other functions listed below. In some programs, you may need to issue this command several times, especially if you need to use some of the “cross-aggregation” techniques described below.
One of the functions of initialization is to set up lists of correspondences between sectors, as well as lists of splits, where one sector from one scheme corresponds to one or more sectors from the other scheme. Since this initialization is time and memory consuming, an explicit function called formagg performs this task, and this function is called for only needed aggregation relationships. formagg takes as its arguments the maximum sector numbers of the source and destination schemes. Until formagg has been called with a certain aggregation pair, no other functions using that pair are allowed.
- rs aggvector <Number_From> <Number_To> <Input_Vector> <Output_Vector> <Split_Vector>]
This function is designed to aggregate or split a vector from one aggregation scheme to a vector of another aggregation scheme. <Number_From> should be the number of sectors of the source vector, and <Number_To> should be the number of sectors of the destination vector, as shown in the heading in the key file that was read from the create routine. <Split_Vector> must be of the same aggregation level as the destination vector. It is used by the routine where there is a one-to-many relationship going from source to destination sectors. If you purely are aggregating, the <Split_Vector> will not be used and its values may be set to arbitrary levels.
- rs ctrlvec <Number From> <Number_To> <Detailed Vector> <Aggregate_Vector>
This function controls a detailed vector to a more aggregate vector.
- rs rdctrlvec <Number_From> <Number_To> <Detailed Vector> <Aggregate_Vector>
This function controls a detailed vector to a more aggregate vector, using right-direction scaling.
In the argument list, <Number_From> is the number of sectors of the source vector, <Number_To> is the number of sectors of the destination vector, and <Number_In_Between> is the number of sectors of the intermediary vector. <Input_Vector> is the source vector and <Output_Vector> is the destination vector. In this function, <Split_Vector> is a vector of length <<Number_In_Between>> that is used to split the source vector.