0% found this document useful (0 votes)
7 views25 pages

Chapter 04

Chapter 4 discusses tests of dispersion and general alternatives, focusing on non-parametric tests such as the Siegel Tukey Test and the Kolmogorov-Smirnov test. It outlines the procedures for constructing test statistics to compare the spread of two independent samples and derive null distributions. Additionally, it provides examples and remarks on the application and limitations of these tests.

Uploaded by

yin lam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views25 pages

Chapter 04

Chapter 4 discusses tests of dispersion and general alternatives, focusing on non-parametric tests such as the Siegel Tukey Test and the Kolmogorov-Smirnov test. It outlines the procedures for constructing test statistics to compare the spread of two independent samples and derive null distributions. Additionally, it provides examples and remarks on the application and limitations of these tests.

Uploaded by

yin lam
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter 4

Test of Dispersion
and
General Alternative

1
Question 4.1
H0: X&Y from the same distribution
H1: Y less spread than X
How can you construct a non-parametric
test statistic so that the value of the
statistic will be “extreme” when Y is less
spread than X?
Y

2
1. Test of dispersion
Two independent samples:

X 1 , X 2 , , X m
Y1 , Y2 ,  , Y n nm

H0: X & Y from the same distribution


H1: X & Y from the same distribution except that Y is less spread
than X
Y

3
Siegel Tukey Test:
Procedure:
1. Combine the samples
2. Give smallest observation score 1
Give largest observation score 2
Give next largest observation score 3
Give next smallest observation score 4
Y

X
Example:
X (1) Y (1) X (2) Y (2) Y (3) X (3) X (4)

Score 1 4 5 7 6 3 2

3. Test statistic=Ws = Sum of the ranks for Y 4


(in the example = 4 + 7 + 6 = 17)
• If H1 is true, Ws will tend to be large.
• Under H0, the distribution of Ws is exactly the same as the
distribution of Wilcoxon Rank Sum.
• If X & Y do not have same location, may apply the test to
~ ~
X   x and Y   y ,
where ~ and ~ are estimates of the location parameters of X
& Y . E.g.
x
~ y
= median of X.
x

Parametric alternative
2
(Xi  X )
F k 2
 (Yi  Y )
F test relies on the normality assumption.
5
Question 4.2

The following sample is drawn from


the population with distribution
function F(t):
0.3 1.2 2.7 3.0 4.8
estimate the value of the distribution
function F(t) at t=1.2, t=2.7, t=2.8,
t=3.0 and t=3.5.
6
Question 4.3
We now have two random variables, two distributions and
two samples:
X with distribution F(t), a sample of size m
Y with distribution G(t), a sample of size n
Two X, one Y, m=2, n=1
Construct a test statistics for testing F=G.

7
Question 4.4
We now have two random variables, two distributions and
two samples:
X with distribution F(t), a sample of size m
Y with distribution G(t), a sample of size n
Two X, one Y, m=2, n=1
Derive the null distribution of your test statistic?

8
2. Kolmogorov-Smirnov test (General Alternative)
Reference: Lehmann

Data:
X 1 , X 2 , , X m distribution F
Y1 , Y2 ,, Yn distribution G

H 0: F = G F(t)=G(t) for all t values


H 1: F  G F(t)  G(t) for at least one t value

A natural thing to do is to approximate F by Fˆm and G by Gˆ n


then examine

Dm ,n  Max Fˆm (t )  Gˆ n (t )
t
9
where

Fˆm (t )  empirical distribution function of X


1 #
 ( X i  t )
m
ˆ 1 #
Gn (t )  ( Yi  t )
n

F̂m
1
Dm ,n
Ĝn

If F and G are different, then Dm, n will be large. 10


Example

X = 1, 5, 6
Y = 2, 7, 8
F̂m Ĝn

1
2/3 Dm, n

1/3  Dm, n = 2/3


1 2 3 4 5 6 7 8 9

From the table with m=n (Lehmann, Table E),


Pr( Dm, n  2/3 ) = 0.6 (The entry in Table E with n=3 and a=2 )
 H0 is not rejected at  = 0.05.
Note: Dm, n is a rank statistic because it is determined by the ranks
and is independent of the values of the observations that lead to the
ranks. It is also distribution free.
11
Exact distribution of D m, n
Example
Two X. One Y. m = 2, n =1.
Possible ranks:
X Y ½
1, 2 3 Dm, n = 1 X(1) X(2) Y

1, 3 2 Dm, n = ½
2, 3 1 Dm, n = 1
X(1) Y X(2)
 Pr( Dm, n = 1/2 ) = 1/3, Pr( Dm, n = 1) = 2/3.
Exact distribution of Dm,n for m = n is tabled (see Lehmann, Table E)

Limiting Distribution
 mn 
PH 0  Dm ,n  Z   K ( Z )
 mn 
where K(Z) is in Table F of Lehmann. 12
Note: it is not normal.
Example
F X: 6.8 3.1 5.8 4.5 3.3 4.7 4.2 4.9
G Y: 4.4 2.5 2.8 2.1 6.6 0.0 4.8 2.3

Ranks of X and Y in combined sample


X: 16 6 14 10 7 11 8 13
Y: 9 4 5 2 15 1 12 3

Values of Fˆm and Gˆ n :


1: Y(1) 2: Y(2) 3: Y(3) 4: Y(4) 5: Y(5) 6: X(1) 7: X(2) 8: X(3)
F̂m 0 0 0 0 0 1/8 2/8 3/8
Ĝ n 1/8 2/8 3/8 4/8 5/8 5/8 5/8 5/8

9: Y(6) 10: X(4) 11: X(5) 12: Y(7) 13: X(6) 14: X(7) 15: Y(8) 16: X(8)
F̂m 3/8 4/8 5/8 5/8 6/8 7/8 7/8 1
Ĝ n 6/8 6/8 6/8 7/8 7/8 7/8 1 1
13
5
 Dm ,n  Max Fˆm (t )  Gˆ n (t ) 
t 8
5 From Table E of
PH 0 ( Dm ,n  )  0.0870 Lehmann
8
 Do not reject H0 at  = 0.05.

If use large sample approximation

5 mn mn 5
PH 0 ( Dm ,n  )  PH 0 ( Dm ,n  )
8 mn mn 8
mn
 PH 0 ( Dm ,n  1.25)
mn
From Table F
 0.0879
of Lehmann
 0.087
14
Question 4.5

15
Remarks:
1. Kolmogorov-Smirnov test is designed for general alternatives, so
it will sacrifice power against subclass of alternatives.

2. In the presence of ties, using the null distribution (assuming no ties)


is incorrect. However, it is OK because the test is conservative.
*
i.e. PH 0 ( Dm ,n  d )  PH 0 ( Dm ,n  d )

with ties

Type I error () for Dm* ,n smaller. (see Lehmann for reference)

3. Kolmogorov -Smirnov test statistic as a goodness-of-fit test


statistic
Test H0: F = F0 (known)
H1: F  F0 Distribution of Dn different
from that of Dm, n
Use Dn  sup Fˆn (t )  F0 (t ) 16
t
3. Kolmogorov-Smirnov test statistic as a Goodness-of-fit
test statistic

Test H0: F = F0 (known, continuous)


vs H1: F  F0

Dn  sup Fˆn ( x )  F0 ( x )
  x 

Reject H0 in favor of H1 for large values of Dn.

Note: Distribution of Dn does not depend on F0.

17
Fact 1: if X is a continuous r.v. with distribution F0(x), then Y =
F0(X) has a uniform distribution U(0, 1).

Proof:

Recall, for U ~ U(0, 1)


F (u) = Pr ( U  u) = u.
Now
F ( y )  Pr (Y  y )
 Pr ( F0 ( X )  y )
 Pr ( X  F01 ( y )) F0 is strictly increasing

 Distribution function of X evaluated at the point F01 ( y )


 F0 ( F01 ( y ))  y

 Distribution of Y = F0(X) is U (0, 1). 18


Fact 2: Let X(1) < X(2) <  < X(n) be the ordered statistics. Dn
can be computed from

(i  1) 
Dn  max i max   F0 X ( i ) , F0 X ( i )  
i

 n n 

F0 ( x)
F0 ( X (i ) )

i/n
(i – 1)/n
1/n

X(1) X(2) X(i)

19
F0(x)
(1)
i/n Fˆn ( x ) i  1
sup = max i  F ( X
0 (i ) ), F0 ( X (i ) )  
n n 
(i – 1)/n F0 (X(i))
X(i)

i/n Fˆn ( x )
(2)
F0(x)
sup achieve at x  X (i)
(i – 1)/n
F0 ( X ( i ) ) max = i/n - F0 (X(i))
X(i)

F0 ( X (i ) ) F0(x)
(3)
i/n Fˆn ( x ) Get sup as x X (i)
(i – 1)/n max = F0 (X(i)) – (i – 1)/n
X(i)

Since F0(x) increasing, maximum difference must occur at X(i).


20
depends on distribution of F0(X(i))
i.e. order statistics of U(0, 1).

 Exact distribution of Dn: very tedious.


(Reference: Gibbons, Nonparametric statistical inference, p.77)

 For large sample, Kolmogorov (1933) derived the following:


If F0 is any continuous distribution function, then for every z  0
z
lim P( Dn  )  L( z )
n  n
where

i 1  2i 2 z 2
L( z )  1  2 ( 1) e .
i 1

 The distribution has been tabulated.


(Table F from Siegel and Castelan.)
21
Example
n = 35
Exact: Pr(Dn  0.18) = 0.2
Large sample: 1.07 Table F of
Pr(Dn   0.181)  0.2
35 Siegel and Castellan
Example
Are 0.72, 0.63, 0.45 coming from the U(0, 1) distribution?
X(1) = 0.45, X(2) = 0.63, X(3) = 0.72
For U(0, 1), F0(x)= x.
i i 1
i  F0 ( X (i ) ) F0 ( X ( i ) )  Max
n n
1 1/3 – 0.45 = – 0.12 0.45 0.45
2 2/3 – 0.63 = 0.037 0.63 – 1/3 = 0.297 0.297
3 1 – 0.72 = 0.28 0.72 – 2/3 = 0.05 0.28

 Dn = 0.45 Table F of
For n = 3, p-value = Pr(Dn  0.45) > 0.2 Siegel and Castellan
 Do not reject H0. 22
Example
Test X1, , Xn come from N( , 2), , 2 unknown.
 x 
Dn  sup Fˆn ( x)   
x   
i  X (i )     X ( i )    i  1
 max i max    ,    
 n       n 
 Dn (  ,  2 ).

When , 2 unknown:


Dn*  Dn ( ˆ , ˆ 2 )  Dn ( X , S 2 )
 x X 
 sup Fˆn ( x )   
x  S 
 i  X (i )  X   X (i )  X  i  1
 max i max    ,  
 

 n .
 n  S   S   23
• Dn* does not have the same distribution as Dn and no simple
closed form for this distribution is known.

• However, under H0, n Dn* has a limiting distribution as n  .

• The following figures are from Stephens(1974, JASA):


(These figures are also approximation).
 0.15 0.10 0.05 0.025 0.01
0.85 *
( n  0.01  ) Dn 0.775 0.819 0.895 0.995 1.035
n

24
4 Online information
On line calculator for two sample K-S test (n and m at least 10):
[Link]

General description (one-sample K-S test):


[Link]

25

You might also like