1. Home
  2. FTEXT procedure

FTEXT procedure

Forms a text structure from any Genstat data structure (A. Keen & J.T.N.M. Thissen).

Option

MISSING = text What to print for missing value; default '*'

Parameters

STRUCTURE = identifiers Structure (scalar, variate, factor, text, table, matrix, symmetricmatrix, diagonalmatrix, pointer) from which the text structure is to be formed
TEXT = texts Saves the text structure
DECIMALS = scalars Number of decimals to use when forming the text structure; default * uses the number required to provide 4 significant figures, but unnecessary trailing zeros are ignored
FREPRESENTATION = string tokens How factor values are to be represented in the text structure (labels, levels, ordinals); default is to use labels if available and levels otherwise

Description

Procedure FTEXT can be used to form a text structure from almost any Genstat data structure. The structure from which the text structure is to be formed must be specified using the STRUCTURE parameter, and can be a scalar, factor, variate, text, table, matrix, symmetricmatrix, diagonalmatrix or pointer. The identifier of the text structure must be specified using the TEXT parameter. For numerical structures, the number of decimal places to use when forming the text can be set by means of the DECIMALS parameter. By default the number required to provide four significant figures is used, but unnecessary trailing zeros are ignored. For example, a scalar containing the number 3.250 will be printed with two decimal places, not three. If the STRUCTURE parameter is set to a factor, parameter FREPRESENTATION can be used to control the way in which factor values are represented in the text structure. The default is to use labels if available and levels otherwise. If FREPRESENTATION is set to ordinals, the DECIMALS parameter is always set to zero for the corresponding factor.

The MISSING option allows you to specify a string to be used instead of the default asterisk symbol to represent missing values. For example, you could set MISSING='unknown' or MISSING=' '.

Option: MISSING.

Parameters: STRUCTURE, TEXT, DECIMALS, FREPRESENTATION.

Method

The text is formed using the PRINT directive with option CHANNEL=TEXT. The calculation of a default number of decimals places uses the same method as in the DECIMALS procedure.

Action with RESTRICT

If the STRUCTURE parameter has been restricted (as is possible only for a variate, factor or text) the length of the text structure will be the length of the restricted structure. The number of decimal places is determined from the values not excluded by the restriction.

See also

Directive: TXCONSTRUCT.

Commands for: Calculations and manipulation.

Example

CAPTION  'FTEXT example'; STYLE=meta
VARIATE  [VALUES=1...10] vari
FACTOR   [LEVELS=!(2.5,5); VALUES=2(2.5,5)] factlev
FACTOR   [LABELS=!t(a,b); VALUES=2(1,2)] factlab
FTEXT    STRUCTURE=vari,factlev,factlab; TEXT=text,textlev,textlab
PRINT    vari,text
PRINT    factlev,textlev,factlab,textlab
Updated on June 19, 2019

Was this article helpful?