FCLASSIFICATION directive

Forms a classification set for each term in a formula, breaks a formula up into separate formulae (one for each term), and applies a limit to the number of factors and variates in the terms of a formula.


Options

FACTORIAL = scalar
Limit on the number of factors and variates in each term; default * i.e. no limit

NTERMS = scalar
Outputs the number of terms in the formula

CLASSIFICATION = pointer
Saves a list of all the factors and variates in the TERMS formula

OUTFORMULA = formula structure
Identifier of a formula to store a new formula, omitting terms with too many factors and variates

INCLUDEFUNCTIONS = string
Whether or not to include functions in the formulae saved by the OUTFORMULA option or the OUTTERMS parameter (yes, no); default no

REORDER = string
Whether to reorder the terms in the model, so that any term that is marginal to an earlier term will be moved to come before it, rather than being deleted (yes, no); default no


Parameters

TERMS = formula
Formula from which the classification sets, individual model terms and so on are to be formed

CLASSIFICATION = pointers
Identifiers giving a pointer to store the factors and variates composing each model term of the TERMS formula

OUTTERMS = formula structures
Identifiers giving a formula to store each individual term of the TERMS formula


Description

If you are writing procedures, for example for statistical analyses, the model to be fitted will often be specified by a GenStat formula structure. Unless the algorithm within the procedure merely involves straightforward use of one of GenStat's statistical directives, you may wish to know more about the formula: how many model terms does it contain, which factors do they involve, and so on. The FCLASSIFICATION directive is designed to provide the answers to these questions. The formula is specified using the TERMS parameter.

   When GenStat uses a formula in a statistical analysis, it is expanded into a series of model terms, linked by the operator +. FCLASSIFICATION allows you to save this expanded form, in another formula, using the OUTFORMULA option.

   You can use the FACTORIAL option to apply a limit to the number of factors and variates in the resulting terms, similarly to the FACTORIAL option in the ANOVA, FIT or REML directives. The number of terms in the formula can be saved (in a scalar) using the NTERMS option, and a list of the factors that occur in the formula can be saved (in a pointer) using the CLASSIFICATION option.

   The other parameters allow you to save information about the individual model terms in the formula. The identifiers in the lists that they specify are taken in parallel with the model terms in the expanded form of the formula. For each model term, the corresponding identifier in the list for the CLASSIFICATION parameter is defined as a pointer storing the factors that occur in the term; and the identifier in OUTTERMS list is defined as a formula containing just that model term.

   By default any functions such as POL or REG are omitted from the formulae saved by OUTFORMULA or OUTTERMS, but these will be included if you set option INCLUDEFUNCTIONS=yes.

   Model terms involving several factors are regarded by GenStat as representing all the joint effects of these factors that are not removed by earlier terms in the formula. So, in the formula

A + B + A.B

A.B is the interaction of factors A and B, as both main effects occur earlier in the formula. Alternatively, in the formula

A.B + A + B

A.B still represents all the joint effects of factors A and B, and the later terms A and B are redundant as they are now "contained" in A.B. Thus FCLASSIFICATION usually deletes any term in the model that is contained in an earlier term. However, if you set option REORDER=yes, the model is reordered instead, so that each term comes before any term that would contain it. So the model would again be

A + B + A.B

 

Options: FACTORIAL, NTERMS, CLASSIFICATION, OUTFORMULA, INCLUDEFUNCTIONS.

Parameters: TERMS, CLASSIFICATION, OUTTERMS.