Mappings


A mapping from one set to another specifies, for each element in the first set, the element of the second set that it it corresponds to. The second set usually has fewer members than the first.

GEMPACK allows you to read or write mappings in two ways: as a vector of element names, or as a vector of integers. In each case the length of the mapping vector is the size of the first set.

Consider the set PUPILS with elements Bob,Mary and Jack. PUPILS is to be mapped to the set GENDER with elements Girls and Boys. The following vector of strings (1C type on a HAR file) maps PUPILS to GENDER:

Boys

Girls

Boys

The same mapping could be stored as a vector of integers (2I type):

2

1

2

The numbers above mean that Jack is of GENDER type 2 (boys), Mary of GENDER type 1 (girls) and so on.

Each method (string or integer) has particular advantages. Suppose we changed the elements of GENDER from [Girls,Boys] to [Female,Male]. The string mapping would fail, while the integer mapping would be OK. Suppose we changed the order of the elements of GENDER from [Girls,Boys] to [Boys,Girls]. The integer mapping would be wrong, while the string mapping would be OK.

Within your TABLO program, you may treat the same mapping as string or integer. Given:

Mapping PUP2GEN from PUPILS to GENDER;

Subset SMART is subset of PUPILS;

Either or

Formula (all,s,SMART) PUP2GEN(s) = 1;

Formula (by_elements) (all,s,SMART) PUP2GEN(s) = "Girls";

has the same effect. Internally, the program stores mappings as integer vectors.

See also

Strange mappings

How mappings are stored on HAR files.



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

Link to full GEMPACK Manual

Link to GEMPACK homepage