LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2009)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 1 Oct 2009 16:42:27 +0200
Reply-To:   García-Granero <>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   García-Granero <>
Subject:   Runs test: cut point at mean or median
Content-Type:   text/plain; charset=ISO-8859-1; format=flowed

Hi everybody

I am using a very simple dataset (serum Fe levels with an automatic analyzer) to explain the concept of randomness and runs test:

DATA LIST FREE /Fe (F8.2). BEGIN DATA 2.6 2.4 2.7 3.2 3.4 3.5 3.2 3.6 3.4 3.5 END DATA.

If I run the test using as cut-off the median, the test is non significant. If I use the mean, the result is significant.


Moreover, using Hart's (*) modification of the mean square successive difference test (assumes normally distributed variables), the result is also significant. Since I know the question my students will ask is: which cut-point is better, mean or median? I'm trying to get an answer before the class. Suggestions and comments are welcome and very appreciated..

(*) Ref:

* Macro for Hart's randomness test *. DEFINE HART(!POS !TOKENS(1)). MATRIX. PRINT/TITLE='HART (mean square successive difference) TEST'. GET X /VAR=!1 /NAME=vname /MISSING=OMIT. COMPUTE N=NROW(x). COMPUTE Diff2=MAKE(N-1,1,0). LOOP i=1 TO N-1. . COMPUTE Diff2(i)=(x(i)-x(i+1))**2. END LOOP. COMPUTE SC=CSSQ(x)-(CSUM(x))**2/N. COMPUTE H=CSUM(Diff2)/SC. COMPUTE Sigma=2*SQRT((n-2)/(n**2-1)). COMPUTE ZValue=(H-2)/Sigma. COMPUTE PValue=1-CDFNORM(ABS(ZValue)). PRINT {H,ZValue,PValue,2*PValue} /FORMAT='F8.3' /CLABEL='H','Z','1-tail P','2-tail P' /RNAME=vname /TITLE='Statistics'. END MATRIX. !ENDDEFINE.


Best regards, Marta GG

-- For miscellaneous SPSS related statistical stuff, visit:

===================== To manage your subscription to SPSSX-L, send a message to LISTSERV@LISTSERV.UGA.EDU (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

Back to: Top of message | Previous page | Main SPSSX-L page