We can then test if the number of positive and negative runs are distributed equally in time.



The Wald-Wolfowitz test will be performed on the variable D.
|Z|'; set runcount; mu = ( (2*n*m) / (n + m) ) + 1; sigmasq = ( (2*n*m) * (2*n*m-(n+m)) ) / ( ((n+m)**2) * (n+m-1) ); sigma=sqrt(sigmasq); drop sigmasq; if N GE 50 then Z = (Runs - mu) / sigma; else if Runs-mu LT 0 then Z = (Runs-mu+0.5)/sigma; else Z = (Runs-mu-0.5)/sigma; pvalue=2*(1-probnorm(abs(Z))); run; title 'Wald-Wolfowitz Test for Randomness'; title2 'H0: The data are random'; proc print data=waldwolf label noobs; var z pvalue; format pvalue pvalue.; run; These sample files and code examples are provided by SAS Institute Inc.
"as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose.
Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute Inc.
The appointment of George Bush's leading hawk as head of the World Bank was heading for a crisis over his relationship with a senior British employee.
is a set of sequential values that are either all above or below the mean.
To simplify computations, the data are first centered about their mean.
To carry out the test, the total number of runs is computed along with the number of positive and negative values.
A positive run is then a sequence of values greater than zero, and a negative run is a sequence of values less than zero.