g08acf
g08acf
© Numerical Algorithms Group, 2002.
Purpose
G08ACF Median test on two samples of unequal size
Synopsis
[i1,i2,p,ifail] = g08acf(x,n1<,ifail>)
Description
The Median test investigates the difference between the medians
of two independent samples of sizes n and n , denoted by:
1 2
x ,x ,...,x
1 2 n
1
and
x ,x ,...,x , n=n +n .
n +1 n +2 n 1 2
1 1
The hypothesis under test, H , often called the null hypothesis,
0
is that the medians are the same, and this is to be tested
against the alternative hypothesis H that they are different.
1
The test proceeds by forming a 2*2 frequency table, giving the
number of scores in each sample above and below the median of the
pooled sample:
Sample 1 Sample 2 Total
Scores <= pooled i i i +i
median 1 2 1 2
Scores >= pooled n -i n -i n-(i +i )
median 1 1 2 2 1 2
Total n n n
1 2
Under the null hypothesis, H , we would expect about half of each
0
group's scores to be above the pooled median and about half
below, that is we would expect i, to be about n /2 and i to be
1 2
about n /2.
2
G08ACF returns:
(a) The frequencies i and i ;
1 2
(b) The probability, p, of observing a table at least as
'extreme' as that actually observed, given that H is true.
0
If n<40, p is computed directly ('Fisher's exact test');
2
otherwise a (chi) approximation is used (see G01AFF).
1
H is rejected by a test of chosen size (alpha) if p<(alpha).
0
Parameters
g08acf
Required Input Arguments:
x (:) real
n1 integer
Optional Input Arguments: <Default>
ifail integer -1
Output Arguments:
i1 integer
i2 integer
p real
ifail integer