reading matrix data

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

reading matrix data

Maguin, Eugene
Is it possible to use spss to read matrices written in, my made-up term, 'row concantenated' format?
Example: lower triangular
1
2 3
4 5 6

Row concatenated
1 2 3
4 5 6

I don't think so using either read matrix or matrix data. Anything else?

Gene Maguin

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: reading matrix data

David Marso
Administrator
matrix data var a b c/format free /contents cov.
begin data
1 2 3
4 5 6
end data.
list.
Maguin, Eugene wrote
Is it possible to use spss to read matrices written in, my made-up term, 'row concantenated' format?
Example: lower triangular
1
2 3
4 5 6

Row concatenated
1 2 3
4 5 6

I don't think so using either read matrix or matrix data. Anything else?

Gene Maguin

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: reading matrix data

David Marso
Administrator
You could also read the data as a single column and reshape it using a few lines of code within MATRIX.
data list free/ V.
begin data
1 2 3 4 5 6
end data
MATRIX.
GET X / FILE * / VAR ALL.
COMPUTE COV=MAKE(3,3,0).
LOOP I=1 TO 3.
+  LOOP J=1 TO I.
+     COMPUTE COV(I,J)=X(I*(I-1)/2+J).
+     COMPUTE COV(J,I)=COV(I,J).
+   END LOOP.
END LOOP.
PRINT COV.
END MATRIX.

David Marso wrote
matrix data var a b c/format free /contents cov.
begin data
1 2 3
4 5 6
end data.
list.
Maguin, Eugene wrote
Is it possible to use spss to read matrices written in, my made-up term, 'row concantenated' format?
Example: lower triangular
1
2 3
4 5 6

Row concatenated
1 2 3
4 5 6

I don't think so using either read matrix or matrix data. Anything else?

Gene Maguin

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"