BookmarkSubscribeRSS Feed
kdonohue
Calcite | Level 5

Is there a way to conduct a bivariate Kolmogorov-Smirnov test in SAS?  That is, I want to know if two or more samples differ in their bivariate probability distributions. For example, do genotypes differ in the *combinations* of temperature and moisture that they germinate in?  NPAR1way allows comparisons of temperature distributions or moisture distributions separately, but I'd like to compare the bivariate distributions.  

Thanks!

8 REPLIES 8
Rick_SAS
SAS Super FREQ

I don't think bivariate K-S tests are available, but there are other options, mostly from the field of spatial data analysis.  If you can upload your data, we might have more to suggest.

 

I assume you have a set of (x,y) pairs for each sample. There are many ways to analyze spatial point patterns in SAS. The SPP procedure in SAS/STAT enables you to graph the empirical distribution of nearest-neighbor distances between points in a point pattern. There are many distance functions that you can choose to compute. PROC SPP also enables you to model the intensity (=density) of the points.  However, the GOF tests in PROC SPP tend to be for comparing data to theoretical models, rather than the nonparametric comparison of two patterns.

 

 

kdonohue
Calcite | Level 5

Thanks a lot.  I'll look into these methods of spatial statistics.  Need a non-parametric test, though....

Ksharp
Super User

It seems that you want perform MANOVA .

Check the example of GLM in documentation.

 

proc glm;

class group;

model temperature   moisture =group/ nouni;

quit;

kdonohue
Calcite | Level 5

Thanks!  The data are highly non-normal, though (and can't be transformed to normality), so I need a non-parametric test.  Otherwise, GLM would be OK for some analyses.  Also, I'm interested in the higher moments of the distribution as much as the first.

Rick_SAS
SAS Super FREQ

The best way to get answers that are appropriate is to upload data that demonstrates the problem you are trying to solve.

ballardw
Super User

Have you looked at Proc NPAR1Way and the Exact test statement with the EDF option?

EDF produces Kolmogorov-Smirnov D statistic for two-sample data.

JacobSimonsen
Barite | Level 11

I have never heard about a two-dimensional K-S test. I dont think there is any theory on the distribution of the test statistic.But don't give up!

Lets say you want to make a K-S test of whether a set of coordinates comes from a bivariate N(0,I) distribution. You can then simulate the distribution of the test statistic. You simply simulate n bivarite N(0,I) distribution, find the max value of the difference from the empirical distribution function distribution function of a twodimensional bivarite N(0,I) . Do that many times (1000 at least) and you then have the distribution of the test-statistic. Then compare your value with the simulated distribution to get a p-value.

Ksharp
Super User
Emm. Maybe you need some data simulation skill.
Check this and you can expand it into multiple variables scenario  easily  .


http://blogs.sas.com/content/iml/2014/11/21/resampling-in-sas.html

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 2613 views
  • 0 likes
  • 5 in conversation