Stats

Popular Posts

Followers

Chi-Square Plot by SPSS

養花種魚數月亮賞星星 於 2008年3月22日星期六 下午1:23 發表
The Chi-Square Plot plots the ordered robust mahalanobis distances of the data against the quantiles of the Chi-squared distribution. If the data is normal distributed these values should approximately correspond to each other, so outliers can be detected visually. By user interaction this procedure is repeated, each time leaving out the observation with the greatest distance (the number of the observation is printed on the console). This method can be seen as an iterativ deletion of outliers until a straight line appears. I write this syntax to plot it. If you have any problem, please let me know.



SET MXLOOP =99999.
MATRIX.
GET DATA/VARIABLES=X1 to Xp/MISSING=OMIT.
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).
LOOP I=1 TO NR.
COMPUTE MD(I,1)=DATA(I,:)*INV(SIGMA)*T(DATA(I,:)).
END LOOP.
COMPUTE MD(:,2)=(RNKORDER(MD(:,1))-0.5)/NR.
SAVE MD /OUTFILE=*.
END MATRIX.
RENAME VARIABLES COL1= MD COL2= CHISQUARE.
GRAPH
/SCATTERPLOT(BIVAR)=MD WITH CHISQUARE /MISSING=LISTWISE
/TITLE= 'The chi-square plot of the ordered distances
.'.


Finally, double click the figure and add reference line into it.

spss 教學網站 spss教學講義下載 spss教學pdf spss教學網 spss教學講義下載 spss教學網站 spss教學下載 spss教學講義 spss教學pdf roc curve spss教學 manova spss教學 spss教學手冊 spss 16教學

Tags: ,

讀者回應 ( 0 意見 )

發佈留言

Please leave your name and tell me what you thought about this site. Comments, suggestions and views are welcomed.

如果這篇文章對你有幫助,那請留個訊息給我~