Department of Zoology

Southern Illinois University Carbondale Home College of Science


A Handy Nonparametric Test
This page contains data associated with a paper published in Ecology entitled "From star charts to stoneflies:  detecting relationships in continuous bivariate data" (J. E. Garvey, E.A. Marschall, and R.A. Wright.  1998.  Ecology 79(2):442-447).  This test is useful for detecting nonrandom patterns in bivariate data, especially when relationships between controlling factors and associated response variables are complex and functional relationships are not continuous.  Here's an example:
 
 

To download a program that runs a one-sample test, click here.  You will have to unzip this file using a version of WinZip.  The program is easy to run.  It will query you for an ASCII file containing two columns of space-delimited data (1st column=x, 2nd column=y).  In Microsoft Excel, this can be accomplished by clicking "Save As" and then saving two columns of data in a spreadsheet as "formatted, space-delimited text", which will have a *.prn extension.  The data file must be in the same directory as the program file.  The program will then ask you for the number of observations.  The program tests the null hypothesis that the x and y data are distributed independently.  If P < 0.05, you can reject the null hypothesis, concluding that the x and y data are not distributed independently.  The program also provides you with D, the test statistic, and with the (x, y) pair where the maximum difference between the actual data and the independently-distributed data occurs.  The P value is generated by comparing the actual test statistic to a distribution of test-statistics created by re-randomizing your data set 5,000 times.  This may take some time for large (N > 100) data sets!  Also included with the program is an example data set (example.prn) which contains 25 x,y pairs.  If the program is running properly, you should get the following output for the example data set (D = 0.148; P = 0.0074; x = 21.9; y = 66.1).  If you want to compare two bivariate distributions, you will have to write your own program.  E-mail me at jgarvey@siu.edu if you have further questions.

NEW - This version of the 2DKS test will handle larger files (up to 1,000 points).  Again, the bigger the file, the longer the randomizations.

If you decide to build your own program, you can test if it is working properly using data from the Ecology paper (or the example data set above).  Data from the three example data sets (x,y pairs) are included below.  Data can be easily pasted into a spreadsheet, one column at a time.  Your results and our results might differ a little due to differences in rounding and re-randomizations.
 

 
Fig. 1.  Ameletus Density
Fig. 1 
Leuctra Density
Fig. 4a
Shad
Density
Fig. 4a
Bluegill
Density
Fig. 4b
Morning Nectar
Volume
Fig. 4b
Nectar Production
6
1
2
1
0
5
0
1
0
0
0
1
3
0
0
0
0
0
3
2
11
14
9
7
0
5
0
0
3
0
0
0
0
2
0
1
0
0
1
0
4
0
5
3
0
0
0
0
0
1
0
1
0
0
2
5
4
2
1
1
1
0
1
0
8
7
1
0
0
0
1
1
 
 




















































10 



















 
 
 
61.4 
84.0 

8.8 
35.3 
37.3 
75.8 
2.3 
14.2 
22.8 
27 
22.1 

34.4 
4.9 

.01 
1.7 
18.26 
15.7 
11.3 
5.4
.28 
.58 
4.3 
1.0 
.06 
.11 
.48 
2.2 
.05 
.36 
.10 
.05 
1.9 
.46 
.08 
1.9 
3.0 
1.5 
.06 
.19 
.23 
.07
4.5 

1.7 
2.9 
1.9 
2.3 
3.9 
1.1 
2.0 
1.4 
1.1 

3.6 
1.1 
2.3 
2.2 
4.1 
3.1 
3.4 
3.1 
.31 
4.1 
3.6 
4.7 
3.1 
.94 
2.5 
.47 

.78 
1.7 
.47 
4.4 
2.7 
.94 
1.7 
1.6 
3.8 
.94 
1.9 
2.0 
.31 

1.9 
4.1 
3.1 
3.1 
.78 
.31 
.31 
.78 
2.5 
4.5 
.63 
.47 
.94 
.16 
1.6 
2.0 
3.3 
1.7 
1.9 
3.8 
.94 
2.3 
1.1 
1.4 
1.6 
.47 

4.8 
.47 
1.1 
.47 
1.6 
.47 

2.0 
.63 
2.7 
1.4 
1.9 
1.6 
.94 
.47 
1.4 

.63 
.16 
.78 

2.5 
.31 

.16 
1.6 
1.7 
.63 
2.8 
1.9 
2.3 
1.3 
2.0 
1.4 
.47 
.63 
2.66 
.94 
.31 
.31 
.78 


.16
.16 
3.8 
.78 
.16 
1.6 
.78 




.16 
1.7 
1.7 
.78 

.94 


.16 
.63 
1.3 




1.4 
.63 
1.4 
2.2 
3.3 
4.8 
2.2 


.47 
.16 

.16 
.47 
.31 
.31 
.16 


1.3 
.16 
.94 
.47 
.63 
.63 
.47 
.31 
1.1 

.47 
1.4 
.47 
1.1 
.47 

.78 



.16 
.78 
.63 
.63 


.78 
.63 
.16 
2.3 
.94 
1.1 
.78 
1.1 
.47 
.16 

.47 
.78 
.63 
1.25 
.78 

.47 

1.1 
.78 
.47 
.31 
1.1 
3.4 
.31 
.31 
.31 
.94 
.94 
1.3 
1.7 
1.4 
.47 
.31 
2.0 
.47 
1.9 

1.1 
1.4 
.31 
.31 
.47 
 


Department of Zoology
Comments and questions: jgarvey@siu.edu
Department of Zoology e-mail: zoology@zoology.siu.edu
Comments and questions related to web server: webmaster@science.siu.edu


SIUC / College of Science / Zoology / Faculty / James Garvey
URL: http://www.science.siu.edu/zoology/materials/zool466/index.html
Last updated: 15-Aug-05 /jeg