I would like to ask two questions. First, from which version does SPSS support the command

*MATRIX*and matrix computation? By 'matrix computation', I mean doing something like this:

Code: Select all

```
MATRIX.
COMPUTE A={1,2;3,4}.
PRINT A.
COMPUTE B=CSUM(RSUM(A)).
PRINT B.
END MATRIX.
```

I tried to use the matrix command

*SAVE*to save matrix results as new variables in the active dataset for the use of generating other new variables. However, it seems that SPSS can only save matrix results in a new SAV file, instead of appending matrix results to the active SAV as new variables, when the active SAV already contains data. Surely, I can merge the new SAV file back to the active SAV, but I am just wondering whether there is a more efficient way. More concretely, for example, if I want to use the matrix B (which is a scalar in the previous toy example) to generate a new variable named B2 in the active SAV for all of respondents (cases), how should I do? Is there any syntax like:

*COMPUTE B2= MATRIX(B).*

Code: Select all

```
MATRIX.
COMPUTE A={1,2;3,4}.
PRINT A.
COMPUTE B=CSUM(RSUM(A)).
PRINT B.
END MATRIX.
COMPUTE B2= MATRIX(B).
EXECUTE.
```

Kirin