dataset1 given by index1 and the dataset2 given by index2. Thus, the array size
corresponds to size of index1 index2.
The two interacting datasets can be accessed by the method
get_dataset() which takes either 1 or 2 as an argument value for
dataset1 or dataset2.
The method get_attribute_of_dataset(name, dataset_number) returns values of
the given attribute that belongs to the dataset given by dataset_number where
only values associated to the corresponding index are included. Thus, a
call get_attribute_of_dataset("attr", 1) gives an array of size
index1, whereas a call get_dataset(1).get_attribute("attr")
gives an array containing values for all elements of dataset1.
The method compute_variables() determines from each of the fully-qualified
names of variables or expressions, to which dataset the variable belongs to. If it belongs to
the dataset1 or dataset2, it calls compute_variables() on
those datasets (the values are computed for all elements of the datasets,
regardless of the given index). If it is an interaction variable, it is
computed only for elements given by index1 and index2.
The InteractionDataset class contains several methods that are useful for variable computation on a 2-d array, such as multiply(), divide(), is_same_as(), is_less_or_equal(), is_greater_or_equal(), all of which take as arguments two interacting attribute names.
An interaction set is automatically created and used in the ChoiceModel class (see Section 24.4.3).