FORMULA directive

Declares one or more formula data structures.

 

Options

VALUE = formula Value for all the formulae; default *
MODIFY = string token Whether to modify (instead of redefining) existing structures (yes, no); default no
IPRINT = string tokens Information to be used by default to identify the formulae in output (identifier, extra); if this is not set, they will be identified in the standard way for each type of output

 

Parameters

IDENTIFIER = identifiers Identifiers of the formulae
VALUE = formula structures Value for each formula
EXTRA = texts Extra text associated with each identifier

 

Description

The IDENTIFIER parameter lists the identifiers of the formulae that are to be declared. The formula data structure stores a Genstat formula. This can be used to define the model to be fitted in a statistical analysis. Its main use is to give a formula as the argument of a procedure.

Values can be assigned to the formulae by either the VALUE option or the VALUE parameter. The option defines a common value for all the structures in the declaration, while the parameter allows the structures each to be given a different value. If both the option and the parameter are specified, the parameter takes precedence.

You can associate a text of extra annotation with each formula using the EXTRA parameter. If MODIFY is set to yes any existing attributes and values of the formulae are retained; otherwise these are lost.

For example:

FORMULA [VALUE=Drug*Logdose] Model

FORMULA BModel,Tmodel;\

  VALUE=!F(Litter/Rat),!F(Vitamin*Protein)

The construction !F(Litter/Rat) is an example of an unnamed formula.

The IPRINT option can be set to specify how the formulae will be identified in output. If IPRINT is not set, they will be identified in whatever way is usual for the section of output concerned. For example, the PRINT directive generally uses their identifiers (although this can be changed using the IPRINT option of PRINT itself).

Options: VALUE, MODIFY, IPRINT.

Parameters: IDENTIFIER, VALUE, EXTRA.

 

See also

Directives: FCLASSIFICATION, REFORMULATE, SET2FORMULA.

Functions: COMPARISON, POL, POLND, REG, REGND, LOESS, SSPLINE.

Commands for: Data structures, Analysis of variance,

Regression analysis, REML analysis of linear mixed models.

Example

" Example FCLA-1: Examples of the FCLASSIFICATION directive
  FCLASSIFICATION expands a formula and allows the following to be saved:
  1) the expanded version, 
  2) any individual term of the formula,
  3) the sets of variates and factors classifying the individual terms."

FACTOR A,B,C
FORMULA [VALUE=A*B] AstarB
" expand AstarB "
FCLASSIFICATION [OUTFORMULA=Expanded] #AstarB
PRINT AstarB, Expanded
" expand A*B*C imposing a limit of 2 on the number of factors or 
  variates in the resulting terms (default for FACTORIAL is 3) "
FCLASSIFICATION [FACTORIAL=2; OUTFORMULA=Expanded] A*B*C
PRINT Expanded
" calculate the number of terms N in the expanded formula, 
  then save the terms in separate formulae T[1...N] 
  and their classification sets in pointers S[1...N] "
FCLASSIFICATION [FACTORIAL=2; NTERMS=N] A*B*C
& A*B*C; CLASSIFICATION=S[1...N]; OUTTERMS=T[1...N]
FOR Si=S[1...N]; Ti=T[1...N]
PRINT Si,Ti
ENDFOR
Updated on January 15, 2018

Was this article helpful?