Next: , Previous: gsmirn, Up: statistics


13.2 gsmirn2

exact Smirnov Two-Sample tests for arbitrary distributions.

Synopsis

     #include <suplib/stats.h>
     
     
     
int gsmirn2( int nx, int ny, int kind, int *m, double dstat, double *q );

Parameters

int nx
The number of observations in the first sample
int ny
The number of observations in the second sample
int kind
The hypothesis tested
int *m
The number of observations falling into each of K categories (with ascending order of category values)
double dstat
The statistic
double *q
output: p-value

Description

gsmirn2 generates the P-value for the generalized two-sample Smirnov tests. It calculates the probability of the null hypothesis (that the two samples are the same) based upon one of three statistics

  1. sup | X - Y |
  2. sup ( X - Y )
  3. sup ( Y - X )

The input parameter kind indicates which of these should be calculated. The input parameters m and dstat are calculated by the stcalc subroutine.

This version uses the method of Timonin and Chernomordik (Theor. Prob.Appl.,1985) to avoid large numbers for P instead of direct scaling adopted by published algorithm AS 288.

One-sided tests are coded separately to use the fast calculation scheme

See also gsmirn.

Returns

0
no error
1
the nx < 1 or ny < 1
2
kind != 1, 2 or 3
3
q is not positive
4
m is inconsistent with nx and ny or has non-positive elements
5
allocation of workspace failed

Author

Original by Andrei M. Nikiforov C transcription by Diab Jerius

Copyright

As there is no copyright or license notice, it is assumed to be freely redistributable with no restrictions.