EXTRACT - Access to contents of DISTRIB operator

The DISTRIB operator contains information about the distribution for a variable. Various statistics of the distribution may be of interest, as well as the list of values that make up the distribution.

EXTRACT.gif (16179 bytes)

Access to the distribution is provided through an EXTRACT function. Control can also be exerted over the distribution by controlling one of its statistics through the EXTRACT function. The format of the function is

    EXTRACT(Variable, Option$, Reduce)

where:

Variable is the variable having the distribution. An error will be returned if the variable does not have a distribution.
Option$ describes the particular value to be returned.
Reduce is used to control whether the full distribution or the currently valid members are used for calculation, or whether a range of possible values is output.

The available settings for Option$ are:

"MEAN" - the mean of the distribution
"MEDIAN" - the median of the distribution
"HITRANGE" - the range of occurrences (hits)
"RANGE" - the (numeric) range of the distribution
"HITS" - a list of the number of occurrences for each segment of the distribution. This list carries with it a pointer to the base set, so it can be used in VECTOR calculations.
"LIST" - a list of the values for the segment of the distribution - the base set

The available settings for Reduce are :

Full (0) - Use full distribution, put out single value
Part (1) - Use constrained distribution, put out single value where appropriate (not for RANGE, etc.). The distribution can be constrained by external cutting, by setting or constraining of the variable, or by varying the DISTRIB probability setting.
Constrain Full (2) - Constrain bidirectionally. Use full distribution for calculation of range
Constrain Part (3) - Constrain bidirectionally. Use partial distribution for calculation of range

The output of the EXTRACT function is either a number or a list, making it multi-type. The base set of the distribution can only be constrained if the output is a number. An example:

The distribution has the form

Value Occurrence
5 2
8 4
11 5
15 4
21 2

Reduce is set to Constrain Full.

The MEAN option would have an output 5<->21, indicating that a mean can be found anywhere from 5 to 21, depending on which members of the distribution are valid. The output of the EXTRACT function is constrained to be 5<->9. The valid members of the distribution are therefore constrained by the DISTRIB operator to be 5,8,11.

The HITRANGE option would have an output 2..5. Constraining the range to 4..5 would change the valid distribution range to 8..15. This has a similar effect to the probability control of the DISTRIB operator. HITRANGE can be more precise, in that you could control the HITRANGE range to be 2,5, causing DISTRIB to have an output of 5,11,21.

Usage Notes

The Constrain Part setting for Reduce will very easily turn recursive, eliminating all members of the distribution by repeated cutting.

The EXTRACT function is normally inserted into the model using the PieceWise Approximation window.