delete values -matrix

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

delete values -matrix

drfg2008
on an other SPSS-platform some expert (desperately) needs a syntax to delete a lower triangular matrix. The matrix is m=n=100. The main diagonal only consists of 1,1, ... and the lower triangular matrix mirrors the upper one (as far as I understand).

I only find a solution in python, but python obviously seems not to be installed on that expert's computer. My non-python syntax-trials delete everything but the right values and I gave up.

I'm sure he would appreciate a solution. (Couldn't find any myself)

Thanks
Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: delete values -matrix

Marta Garcia-Granero
Could you please give more details?. I don't fully understand what you
try to do. Maybe if you give a small example (a 5x5 matrix) with the
initial and final states...

Marta

El 26/08/2011 17:29, drfg2008 escribió:

> on an other SPSS-platform some expert (desperately) needs a syntax to delete
> a lower triangular matrix. The matrix is m=n=100. The main diagonal only
> consists of 1,1, ... and the lower triangular matrix mirrors the upper one
> (as far as I understand).
>
> I only find a solution in python, but python obviously seems not to be
> installed on that expert's computer. My non-python syntax-trials delete
> everything but the right values and I gave up.
>
> I'm sure he would appreciate a solution. (Couldn't find any myself)
>
> Thanks
>
> -----
> Dr. Frank Gaeth
> FU-Berlin
>
> --
> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/delete-values-matrix-tp4738401p4738401.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> 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
>

=====================
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: delete values -matrix

drfg2008
Example:

1 8 9 7 4
8 1 3 2 8
9 3 1 7 7
7 2 7 1 8
4 8 7 8 1


All values in the lower triangular matrix shall be set on missing or 0.

1
8 1
9 3 1
7 2 7 1
4 8 7 8 1

nothing complex actually (if m>n).

cheers
Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: delete values -matrix

David Marso
Administrator
Frank,
Say Variables are called V001 TO V100.
COMPUTE #=$CASENUM.
VECTOR V=V001 TO V100.
LOOP ##=#+1 TO 100.
+  COMPUTE V(##)=$SYSMIS.
END LOOP.
EXE.
HTH, David
--
drfg2008 wrote
Example:

1 8 9 7 4
8 1 3 2 8
9 3 1 7 7
7 2 7 1 8
4 8 7 8 1


All values in the lower triangular matrix shall be set on missing or 0.

1
8 1
9 3 1
7 2 7 1
4 8 7 8 1

nothing complex actually (if m>n).

cheers
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: delete values -matrix

drfg2008
yes, it helps. Thanks David.
Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: delete values -matrix

drfg2008
Hi David,

the 'expert' says thank you


"Absoluter Hammer.
Vielen Dank für deine Hilfe!
MEGA!"


(I find no propper English translation for that.)

Dr. Frank Gaeth