1. Home
  2. SETOPTION directive

SETOPTION directive

Sets or modifies defaults of options of Genstat directives or procedures.

Option

DIRECTIVE = string token Directive (or procedure) to be modified

Parameters

NAME = string tokens Option names
DEFAULT = identifiers New default values

Description

The SETOPTION directive changes the default settings of options of a directive or procedure for the remainder of the current job. If you use this directive in your start-up file you can make the changed default apply in all your use of Genstat.

To achieve any effect, the option and both parameters of the directive must be set. The DIRECTIVE option specifies the name of the directive or procedure that is affected, and the NAME parameter indicates the option whose default is to be changed. The settings are strings, so need not be quoted because all directive and procedure names are valid as unquoted strings. The DEFAULT parameter is then set to a data structure to provide the new default that you want to be assumed. For example, the following statement modifies the PRINT option of the FIT directive.

SETOPTION [DIRECTIVE=FIT] PRINT; DEFAULT='deviance'

The usual default of the PRINT option in FIT is to print a statement of the model, a summary of the analysis, and the parameter estimates: this corresponds to the setting PRINT=model,summary,estimates. This SETOPTION statement therefore redefines the default so that any subsequent FIT statement in the job will report only the residual deviance unless you explicitly set the PRINT option.

The defined mode of the PRINT option of FIT is “strings” (8.1.2). However, the DEFAULT parameter of SETOPTION expects a data structure (to allow for all the other modes that might occur), and so it must be set to a text structure containing the string (or strings) that you want to be the default. Similarly, if the defined mode of the option is “numbers”, “expression” or “formula”, you must supply a variate, an expression structure or a formula structure containing the new default. If the defined mode is “identifier”, the setting of DEFAULT is simply an identifier, which must be of the required type if this is specified in the definition of the directive or procedure.

To reset the PRINT option of FIT back to its usual default, you would need to give the statement

SETOPTION [DIRECTIVE=FIT] PRINT; DEFAULT=!t(model,summary,\

  estimates)

The SETOPTION directive can also be used to change defaults of any procedure: this may be a procedure in the standard Procedure Library, the Site Library or a personal library that you have already opened in the current program, or it may be a procedure that you have defined explicitly in the job.

Option: DIRECTIVE.

Parameters: NAME, DEFAULT.

See also

Directives: OPTION, PROCEDURE.

Commands for: Program control.

Updated on March 5, 2019

Was this article helpful?