Next: gsmirn2, Previous: statistics, Up: statistics
exact Smirnov Two-Sample tests for arbitrary distributions.
#include <suplib/stats.h>int gsmirn( int nx, int ny, int kind, int *m, double dstat, double *q );
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
gsmirn
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
The input parameter kind
indicates which of these should be
calculated. The input parameters m
and dstat
are
calculated by the stcalc
subroutine.
See Applied Statistics, Vol. 43, No. 1 (1994), 265-270.
0
1
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
This code returns incorrect values for large nx
and ny
for nx != ny
for various ratios. See gsmirn2
for a
slower version which does not suffer from these problems.
Original by Andrei M. Nikiforov C transcription by Diab Jerius