I need to use the matrix-endmatrix command to perform matrix operations on
150 files. Not sure if I have Python with my implementation of SPSS 19,
so I think a small macro will be my best bet. Some questions I have not
been able to resolve:
1) I need to subscript my filenames with i, but I'm not sure I have the
correct syntax.
2) Not sure how to have two files open at one time in order to carry out
the product of x inverse and y.
3) If I save this file to a .sps file, can I include it to run the
commands?
Sorry if this is stupid. I can do this in about 10 minutes in SAS, but I
don't have PROC IML. Spent most of my day trying to find something that
would tell me how to do this.
compute t=0.
!do !i=1 !to 150.
matrix.
get x1_!i
/file="C:\data\".
/variables=col1 col2 col3 col4 col5 col6 col6 col7.
/names=varnames.
save x1_!i_inv=inv(x1_i).
save x_inv_y1_!i=x1_!i_inv*y1_!i.
save trace1_!i=trace(x_inv_y1_!i).
t=t+trace1_!i.
endmatrix.
!doend.
=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD