1. Home
  2. VARIATE directive

VARIATE directive

Declares one or more variate data structures.


NVALUES = scalar or vector Number of units, or vector of labels; default * takes the setting from the preceding UNITS statement, if any
VALUES = numbers Values for all the variates; 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 variates in output (identifier, extra); if this is not set, they will be identified in the standard way for each type of output


IDENTIFIER = identifiers Identifiers of the variates
VALUES = identifiers Values for each variate
DECIMALS = scalars Number of decimal places for output
EXTRA = texts Extra text associated with each identifier
MINIMUM = scalars Minimum value for the contents of each structure
MAXIMUM = scalars Maximum value for the contents of each structure
DREPRESENTATION = scalars or texts Default format to use when the contents represent dates and times


The variate is probably the structure that you will use most often in Genstat. You can think of this as being just a list of numbers – a vector, in mathematical language. Variates occur for example as the response and explanatory variables in regression, as covariates and y-variables in analysis of variance, and can be used to form the matrices of correlations, similarities or sums of squares and products required for multivariate analyses.

The IDENTIFIER parameter lists the variates that are to be declared. Values can be assigned by either the VALUES option or the VALUES parameter. The option defines a common value for all the variates in the declaration, while the parameter allows them each to be given a different value. If both the option and the parameter are specified, the parameter takes precedence.

The NVALUES option allows the number of values in the variates to be defined. If this is not set, the lengths of the variates are defined from the numbers that are supplied by the VALUES option or parameter. If these too are unset, Genstat takes the length specified by the preceding UNITS statement, if any.

The DECIMALS parameter allows you to define a number of decimal places to be used by default when each variate is printed. You can associate a text of extra annotation with each variate using the EXTRA parameter. The MINIMUM and MAXIMUM parameters allow you to define lower and upper limits on the values in each variate. Genstat then prints warnings if any values outside that range are allocated to the variate. The DREPRESENTATION parameter allows a scalar or a single-valued text to be specified for each variate to indicate that the variate stores dates and times, and to define a format to be used for these, by default, when they are printed; details are given in the description of the PRINT directive.

If the MODIFY option is set to yes any existing attributes and values of the variates are retained (if still appropriate); otherwise these are lost. The IPRINT option can be set to specify how the variates 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), while the ANOVA directive will print the identifier and the extra text for each y-variate.


See also

Directives: FACTOR, TEXT, UNITS.
Procedure: TX2VARIATE.
Commands for: Data structures.


" Example 2:2.2.3 "
" A scatter plot is drawn of blood-pressure against age for 38 women.
  Then two rugplots are added to show the distribution of ages and
  pressures along the axes."
VARIATE  [VALUES=82.17,88.19,89.66,81.45,85.16,89.77,89.11,107.96,\
  87.91,86.42,103.87,83.76,84.35,68.64,100.50,100.42] Pressure
VARIATE  [VALUES=28,46,63,36,42,59,54,77,21,57,47,34,51,27,24,41,66,\
  69,72,60,50,57,32,59,74,77,41,36,20,47,51,57,69,36,54,24,61,80] Age
DGRAPH  Pressure; Age
RUGPLOT [SCREEN=keep] Pressure
Updated on September 3, 2019

Was this article helpful?