Error in MATRIX

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

Error in MATRIX

fevziesen
Hi all,

I have my variables log1,log2,lo3 in my dataset. I am getting the robust
mahalanobis scores. But I am getting error. Checked again and again but am I
missing something?

DATASET ACTIVATE h.
MATRIX.
GET DATA/VARIABLES=log1 log2 log3
COMPUTE NR=ROW(DATA).
COMPUTE NC=COL(DATA).
COMPUTE MEAN=T(CSUM(DATA)/NR).
PRINT MEAN.
COMPUTE SIGMA=(SSCP(DATA)-NR*MEAN*T(MEAN))/(NR-1).
PRINT SIGMA.
COMPUTE MD=MAKE(NR,2,-999).
COMPUTE MDTEMP=MAKE(NR,1,-999).
COMPUTE MD(I,1)=DATA(I,:)*INV(SIGMA)*T(DATA(I,:)).
COMPUTE MD(:,2)=(RNKORDER(MD(:,1))-0.5)/NR.
SAVE MD /OUTFILE=*.
END MATRIX.



--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Error-in-MATRIX-tp5728674.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
Reply | Threaded
Open this post in threaded view
|

Re: Error in MATRIX

Kirill Orlov
DATASET ACTIVATE h.
MATRIX.
GET DATA/VARIABLES=log1 log2 log3 .
COMPUTE NR=NROW(DATA).
COMPUTE NC=NCOL(DATA).
COMPUTE MEAN=T(CSUM(DATA)/NR).
PRINT MEAN.
COMPUTE SIGMA=(SSCP(DATA)-NR*MEAN*T(MEAN))/(NR-1).
PRINT SIGMA.
COMPUTE MD=MAKE(NR,2,-999).
COMPUTE MDTEMP=MAKE(NR,1,-999).
COMPUTE MD(I,1)=DATA(I,:)*INV(SIGMA)*T(DATA(I,:)). /*WHAT IS I?
COMPUTE MD(:,2)=(RNKORDER(MD(:,1))-0.5)/NR.
*SAVE MD /OUTFILE=*.
END MATRIX.


13.02.2015 16:20, fevziesen пишет:
Hi all,

I have my variables log1,log2,lo3 in my dataset. I am getting the robust
mahalanobis scores. But I am getting error. Checked again and again but am I
missing something?

DATASET ACTIVATE h.
MATRIX.
GET DATA/VARIABLES=log1 log2 log3 
COMPUTE NR=ROW(DATA).
COMPUTE NC=COL(DATA).
COMPUTE MEAN=T(CSUM(DATA)/NR).
PRINT MEAN.
COMPUTE SIGMA=(SSCP(DATA)-NR*MEAN*T(MEAN))/(NR-1).
PRINT SIGMA.
COMPUTE MD=MAKE(NR,2,-999).
COMPUTE MDTEMP=MAKE(NR,1,-999).
COMPUTE MD(I,1)=DATA(I,:)*INV(SIGMA)*T(DATA(I,:)).
COMPUTE MD(:,2)=(RNKORDER(MD(:,1))-0.5)/NR.
SAVE MD /OUTFILE=*.
END MATRIX.



--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Error-in-MATRIX-tp5728674.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