Login  Register

Re: saving MATRIX output to SAV file

Posted by Kirill Orlov on Feb 22, 2015; 7:31am
URL: http://spssx-discussion.165.s1.nabble.com/saving-MATRIX-output-to-SAV-file-tp5728761p5728769.html

Did you mean to do this?

DATA LIST FREE/rYX1 rYX2 rYpdct rX1X2 rX1pdct rX2pdct SAMPLE_.
BEGIN DATA.
 .59      .41      .71     -.05      .67      .70     1.00
 .49      .35      .62     -.06      .79      .55     2.00
 .55      .38      .67     -.06      .78      .56     3.00
END DATA.
MATRIX.
GET data/FILE=*.
LOOP i=1 TO NROW(data).
comp R=MAKE(4,4,0).
COMPUTE R(2,1)=data(i,1).
COMPUTE R(3,1)=data(i,2).
COMPUTE R(4,1)=data(i,3).
COMPUTE R(3,2)=data(i,4).
COMPUTE R(4,2)=data(i,5).
COMPUTE R(4,3)=data(i,6).
comp r= r+t(r).
call setdiag(r,1).
PRINT R.
SAVE {I,DET(R)} /OUTFILE= * /VARIABLES=SAMPLE_ DET.
END LOOP.
END MATRIX.

22.02.2015 0:53, Beckstead, Jason пишет:
David and others,
thanks for your suggestions. I tried adapting your code but I must be missing something with the LOOP in MATRIX procedure. I keep getting an undefined error. My file structure is wide, rather than tall so all 6 vars are on the same line for each sample, but I don't think that is the problem. I think it is with the LOOP because I can't even get the code to print 3 R mtxs. Here is the set up for the first 3 of 10,000 samples. 


===================== 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