FRESTRICTEDSET procedure
Forms vectors with the restricted subset of a list of vectors (R.W. Payne).
Options
Parameters
Description
The RESTRICT directive can be used in GenStat to associate a "restriction" with a vector, so that subsequent directives operate on only a subset of its units (see the Guide to GenStat, Part 1, Section 4.4.1). This is very convenient, as the full set of data is still available and can be reinstated by cancelling the restriction. However, there are also occasions when it may be preferable to form a vector that contains only the restricted units. This is particularly true within procedures that may themselves need to apply restrictions, in addition to those already applied to their input vectors.
The OLDVECTOR parameter specifies the list of possibly-restricted vectors, and the NEWVECTOR parameter specifies a list of vectors to store the values from their unrestricted units. FRESTRICTEDSET first checks whether any of the old vectors is restricted and, if more than one is restricted, it prints a warning if the restrictions are not same. The unrestricted set is defined to contain the units that are not restricted on any of the vectors. The RESTRICTED option can be set to a scalar which will be set to one or zero according to whether or not any OLDVECTOR was restricted, and the METHOD option controls whether the new vectors are formed irrespective of whether or not the old vectors are restricted, or only if they are restricted.
Options: METHOD, RESTRICTED. Parameters: OLDVECTOR, NEWVECTOR.
Method
FRESTRICTEDSET first uses directives such as GETATTRIBUTE, CALCULATE and GROUPS to check whether any vector is restricted, whether the restrictions are compatible and to form a logical variable to indicate which units are not excluded by the restriction. It then calls SUBSET to form the new vectors.
Action with
RESTRICT
Restrictions on the old vectors are used to determine which of their units should be copied to the new vectors.