Programming the statistical procedures from SAS

Can I conduct a bivariate Kolmogorov-Smirnov test in SAS?

Reply
New Contributor
Posts: 3

Can I conduct a bivariate Kolmogorov-Smirnov test in SAS?

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!

SAS Super FREQ
Posts: 3,306

Re: Can I conduct a bivariate Kolmogorov-Smirnov test in SAS?

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.

 

 

New Contributor
Posts: 3

Re: Can I conduct a bivariate Kolmogorov-Smirnov test in SAS?

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

Grand Advisor
Posts: 9,451

Re: Can I conduct a bivariate Kolmogorov-Smirnov test in SAS?

It seems that you want perform MANOVA .

Check the example of GLM in documentation.

 

proc glm;

class group;

model temperature   moisture =group/ nouni;

quit;

New Contributor
Posts: 3

Re: Can I conduct a bivariate Kolmogorov-Smirnov test in SAS?

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.

SAS Super FREQ
Posts: 3,306

Re: Can I conduct a bivariate Kolmogorov-Smirnov test in SAS?

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

Grand Advisor
Posts: 10,043

Re: Can I conduct a bivariate Kolmogorov-Smirnov test in SAS?

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.

Super Contributor
Posts: 271

Re: Can I conduct a bivariate Kolmogorov-Smirnov test in SAS?

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.

Grand Advisor
Posts: 9,451

Re: Can I conduct a bivariate Kolmogorov-Smirnov test in SAS?

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
Ask a Question
Discussion stats
  • 8 replies
  • 103 views
  • 0 likes
  • 5 in conversation