Combine the contents of one or more variables, parameters, or
constants into a single variable.
This command is similar to the APPEND or EXTEND commands. However
it provides the additional flexibility:
- APPEND and EXTEND only work with variables. The COMBINE
command also allows parameters and constants.
The output for the COMBINE command is always a single
- APPEND and EXTEND will only combine the contents of two
variables. The COMBINE command will accept up to 30
variables, parameters, or constants.
Matrices and strings are not supported by the COMBINE command.
LET <y> = COMBINE <x1> ... <xk>
where <x1> ... <xk> is a set of one or more response
variables, parameters, or constants;
<y> is a variable that will contain the contents of
<x1> ... <xk> in a single response
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
LET Y = COMBINE Z1 Z2 Z3 Z4 Z5
The following syntax is allowed:
LET Y = DATA 1 2 3
LET Y = COMBINE Y Y Y
will contain the values 1, 2, 3, 1, 2, 3, 1, 2, 3.
The <SUBSET/EXCEPT/FOR qualification> is typically not used
with this command. However, if one is given, it will be applied
individually to all the variables on the right hand side of the equal
sign. It will be ignored for all parameters and constants.
= Save a list of constants into a variable.
= Append one variable to another variable.
= Extends a variable by another variable.
= Convert a set of response variables to a single response
variable and a group-id variable.
LET A1 = 1
LET Y1 = DATA 1 2 3 4 5
LET A2 = 2
LET Y2 = DATA 1 2 3 4 5
LET Y = COMBINE A1 Y1 A2 Y2 -99
SET WRITE DECIMALS 0
The output vector Y wiill contain the values 1, 1, 2, 3, 4, 5, 2,
1, 2, 3, 4, 5, and -99.
Date created: 9/8/2010
Last updated: 9/8/2010
Please email comments on this WWW page to