Sheet10 Solution
Sheet10 Solution
s x <− 0 . 5 ; s y <− 0 . 6
x <− c ( 5 . 4 6 , 5 . 3 4 , 4 . 3 4 , 4 . 8 2 , 4 . 4 0 , 5 . 1 2 , 5 . 6 9 , 5 . 5 3 , 4 . 7 7 , 5 . 8 2 )
y <− c ( 5 . 4 5 , 5 . 3 1 , 4 . 1 1 , 4 . 6 9 , 4 . 1 8 , 5 . 0 5 , 5 . 7 2 , 5 . 5 4 , 4 . 6 2 , 5 . 8 9 , 5 . 6 0 ,
5.19 ,3.31 ,4.43 ,5.30 ,4.09)
nx <− l e n g t h ( x ) ; ny <− l e n g t h ( y )
t e s t . s t a t <− ( mean ( y)− mean ( x ) ) / s q r t ( s x ˆ2/ nx + s y ˆ2/ ny )
a l p h a <− 0 . 0 5
• Group 1:
7.06, 11.84, 9.28, 7.92, 13.5, 3.98, 3.82, 7.34, 8.7, 9.24, 4.86, 3.32,
12.78, 12, 5.24, 11.4, 6.56, 9.04, 7.72, 9.26, 7.88, 8.6, 9.3, 8.42, 8.54
• Group 2:
8.68, 6, 6.3, 10.24, 10.88, 5.36, 7.82, 4.7, 9.02, 9.78, 6.9, 5.8, 13.56,
10.32, 13.3, 11.38, 7.94, 10.74, 13.68, 14.92, 7.42, 10.36, 10.54,
5.22, 13.74, 12.98, 10.34, 10.02, 17.8, 13.04, 5.2, 9.4, 11.18, 12.68,
12.36
Which hypothesis do you have to test if you want to show that the
Method B is better than Method A? Perform an corresponding test at
the level α = 0.05. Assume that the values obtained are a realization
of independent in the group i N(µi , σi2 )-distributed random variables
(i=1,2).
Answer: 2 unpaired sample t-test resp Welsh test: reject H0
##########################################################################
# E x e r c i s e : 2 sam p l e t − t e s t , Welsh− t e s t
#
# f i l e : i n f s t a t 2 s a m p l e s t e s t i n g j a v e l i n t h r o w .R
##########################################################################
# H0 : mu . x >= mu . y , H1 : mu . x < mu . y
##########################################################################
# case : equal variances
a l p h a <− 0 . 0 5
t . t e s t ( x , y , a l t e r n a t i v e =” l e s s ” ,mu=0 , p a i r e d=FALSE , v a r . e q u a l=TRUE,
c o n f . l e v e l =1− a l p h a )
# r e j e c t H0 , s i n c e p−v a l u e = 0 . 0 1 8 1
##########################################################################
# case : equal variances
a l p h a <− 0 . 0 5
t . t e s t ( x , y , a l t e r n a t i v e =” l e s s ” ,mu=0 , p a i r e d=FALSE , v a r . e q u a l=FALSE ,
c o n f . l e v e l =1− a l p h a )
# r e j e c t H0 , s i n c e p−v a l u e = 0 . 0 1 5 9 6
water alcohol
16 13
15 13
11 10
20 18
19 17
14 11
13 10
15 15
14 11
16 16
# 2 d ep en d en t random v a r i a b l e w i t h unknown b u t e q u a l v a r i a n c e s
# A ( h y p o t h e t i c a l ) e x p e r i m e n t i s c o n d u c t e d on t h e e f f e c t o f
# a l c o h o l on p e r c e p t u a l motor a b i l i t y . Ten s u b j e c t s a r e e a c h t e s t e d
# t w i c e , o n c e a f t e r h a v i n g two d r i n k s and o n c e a f t e r h a v i n g two
# g l a s s e s o f w a t e r . The two t e s t s wer e on two d i f f e r e n t d ays t o g i v e
# t h e a l c o h o l a c h a n c e t o wear o f f . H a l f o f t h e s u b j e c t s wer e g i v e n
# a l c o h o l f i r s t and h a l f wer e g i v e n w a t e r f i r s t . The s c o r e s o f t h e 10
# s u b j e c t s a r e shown b el ow . The f i r s t number f o r e a c h s u b j e c t i s t h e i r
# performance i n the ” water ” c o n d i t i o n . Higher s c o r e s r e f l e c t b e t t e r
# p e r f o r m a n c e . Test t o s e e i f a l c o h o l had a s i g n i f i c a n t e f f e c t . R ep or t
# t h e t and p v a l u e s .
w a t e r <− c ( 1 6 , 1 5 , 1 1 , 2 0 , 1 9 , 1 4 , 1 3 , 1 5 , 1 4 , 1 6 )
a l c <− c (13 ,13 ,10 ,18 ,17 ,11 ,10 ,15 ,11 ,16)
# H0 : mu = 0 , H1 : mu <> 0
a l p h a <− 0 . 0 5
t . t e s t ( wat er , a l c , a l t e r n a t i v e =”two . s i d e d ” , p a i r e d=TRUE, c o n f . l e v e l =1− a l p h a )
# r e j e c t H0 , s i n c e p−v a l u e = 0 . 0 0 0 7 2 0 5
A=X B=Y
1 102,4 1 98,4
2 101,3 2 101,7
3 97,6 3 100,5
4 98,2 4 99,3
5 102,3 5 100,6
6 99,1 6 99,6
7 97,8 7 102,2
8 103,9 8 101,1
9 101,6 9 99,9
10 100,1 10 101
# F− t e s t : H0 : si gm a . x <= si gm a . y
var . t e s t ( x , y , a l t e r n a t i v e = ” g r e a t e r ” , con f . l e v e l =0.95)
# r e j e c t H0 , s i n c e p−v a l u e = 0 . 0 3 4 0 4
x <− c ( 7 . 2 , 4 . 1 , 5 . 5 , 4 . 5 , 5 . 7 , 3 . 8 , 4 . 6 , 6 . 0 , 5 . 2 , 5 . 4 )
y <− c ( 5 . 3 , 4 . 4 , 5 . 0 , 3 . 5 , 3 . 9 , 4 . 9 , 5 . 6 , 2 . 5 , 4 . 0 , 3 . 6 )
# Assuming t h a t w e i g h t g a i n can be d e s c r i b e d by i n d e p e n d e n t
# random v a r i a b l e s t h a t a r e i d e n t i c a l l y n o r m a l l y d i s t r i b u t e d i n
# b ot h c a s e s , u s e an a p p r o p r i a t e t e s t a t l e v e l $ \ a l p h a =0.1 $ t o
# t e s t wh et h er t o r e j e c t t h e a s s u m p t i o n t h a t w e i g h t g a i n fr om
# a d m i n i s t r a t i o n o f c o m p o s i t i o n A c o n c e n t r a t e h as t h e same
# d i s p e r s i o n a s w e i g h t g a i n fr om a d m i n i s t r a t i o n o f t h e
# conventional composition B d ie t .
mean ( x ) ; v a r ( x )
mean ( y ) ; v a r ( y )
a l p h a <− 0 . 1
# Assuming t h a t w e i g h t g a i n can be d e s c r i b e d by i n d e p e n d e n t
# random v a r i a b l e s w i t h e q u a l v a r i a n c e , i d e n t i c a l l y n o r m a l l y
# d i s t r i b u t e d i n e a c h o f t h e two c a s e s , u s e an a p p r o p r i a t e t e s t a t
# t h e l e v e l $ \ a l p h a = 0. 025 $ t o t e s t wh et h er t h e h y p o t h e s i s t h a t
# weight gai n with a d m i n i s t r a t i o n o f c o n c e n t r a t e o f comp osi ti on A
# i s n ot g r e a t e r t h an w e i g h t g a i n w i t h a d m i n i s t r a t i o n o f t h e
# conventional di e t of composition B i s c o r r e c t .
a l p h a <− 0 . 0 5
t . t e s t ( x , y , a l t e r n a t i v e =” l e s s ” , p a i r e d=FALSE , v a r . e q u a l=TRUE,
c o n f . l e v e l =1− a l p h a )
# r e j e c t H0 , t h a t t h e mu . x < mu . y s i n c e p−v a l u e = 0 . 0 1 8 1
# A company p r o d u c i n g c l o t h i n g o f t e n f i n d s d e f i c i e n t T− s h i r t s among
# i t s production .
# The company ’ s c o n t r o l l i n g d ep ar t m en t d e c i d e s t h a t t h e p r o d u c t i o n i s no l o n g e r
# p r o f i t a b l e when t h e r e a r e more t h an 10% d e f i c i e n t T− s h i r t s . A sam p l e o f 230
# s h i r t s y i e l d 35 s h i r t s wh i ch c o n t a i n d e f i c i e n c i e s . Use t h e a p p r o x i m a t e
# b i n o m i a l t e s t and t h e e x a c t b i n o m i a l t e s t t o d e c i d e wh et h er t h e s h i r t
# p r o d u c t i o n i s p r o f i t a b l e o r n ot ( a l p h a = 0 . 0 5 ) .
n <− 2 3 0 ; d e f <− 31
# H0 : p <= 0 . 1 , H1 : p > 0 . 1
p0 <− 0 . 1 ; r <− d e f /n
# on e sam p l e t e s t f o r p : n or m al a p p r o x i m a t i o n
# test st a t i s ti cs
t . x <− ( r −p0 ) / s q r t ( p0 ∗ (1 − p0 ) / n )
# d e c i s i o n : r e j e c t H0 , i f t . x > 1− a l p h a q u a n t i l e of t h e N( 0 , 1) − d i s t r .
a l p h a <− 0 . 0 5
t . x > qnorm(1 − a l p h a )
# r e j e c t i o n o f H0
# on e sam p l e t e s t f o r p : e x a c t b i n o m i a l t e s t
binom . t e s t ( x = d e f , n = n , p = p0 ,
a l t e r n a t i v e = ” g r e a t e r ” , c o n f . l e v e l = 1− a l p h a )
n1 <− 2 3 0 ; d e f 1 <− 31
n2 <− 1 1 6 ; d e f 2 <− 7
p h at <− ( d e f 1+d e f 2 ) / ( n1+n2 )
# H0 : p2 >= p1 , H1 : p2 < p1
# two sam p l e t e s t f o r p : n or m al a p p r o x i m a t i o n
# test st a t i s ti cs
T <− ( d e f 2 / n2 − d e f 1 / n1 ) / s q r t ( p h at ∗ (1 − p h at ) ∗ ( 1 / n1 + 1/ n2 ) )
# d e c i s i o n : r e j e c t H0 , i f T < a l p h a q u a n t i l o f N( 0 , 1 )
T < qnorm ( a l p h a ) # r e j e c t i o n o f H0
# two sam p l e t e s t f o r p : f i s h e r ’ s e x a c t t e s t
# contingency ta ble : m ach i n e2 m ach i n e1
# def 7 31
# ok 109 199
c o n t . t ab <− m a t r i x ( c ( d e f 2 , d e f 1 , n2−d e f 2 , n1− d e f 1 ) ,
nrow = 2 , n c o l = 2 , byrow = TRUE)
f i s h e r . t e s t ( c o n t . tab , a l t e r n a t i v e = ” l e s s ” , c o n f . l e v e l = 1− a l p h a )
# r e j e c t i o n o f H0 , s i n c e p− v a l u e = 0 . 0 2 4 6 5
Does this finding correspond to the hypothesis that the variable “num-
ber of girls in families with four children each” follows a Binomial dis-
tribution with n = 4 and p = 0.5? Test this hypothesis at a significance
level of 0.1!
Answer: χ2 goodness of fit test: do not reject Ho
##########################################################################
# E x e r c i s e : c h i ˆ2 g o o d n e s s o f f i t t e s t : d i s c r e t e d i s t r o b u t i o n
#
# f i l e : i n f s t a t 2 s a m p l e s t e s t i n g g i r l s f a m i l y .R
##########################################################################
# I n 380 r an d om l y s e l e c t e d f a m i l i e s w i t h f o u r c h i l d r e n e a c h
# i t i s i n v e s t i g a t e d how many o f them a r e g i r l s . The r e s u l t i s t h e
# following findings :
g i r l s <− 0 : 4
fam <− c ( 2 5 , 9 5 , 1 5 0 , 8 0 , 3 0 )
# Does t h i s f i n d i n g c o r r e s p o n d t o t h e h y p o t h e s i s t h a t t h e v a r i a b l e
# ‘ ‘ number o f g i r l s i n f a m i l i e s w i t h f o u r c h i l d r e n each ’ ’ f o l l o w s a
# B i n o m i a l d i s t r i b u t i o n w i t h n = 4 and p = 0 . 5 ? Test t h i s
# h y p o t h e s i s at a s i g n i f i c a n c e l e v e l o f 0 . 1 !
# H0 : fam ˜ B( n=4 ,p = 0 . 5 )
a l p h a <− 0 . 1
c h i s q . t e s t ( fam , p = dbinom ( 0 : 4 , s i z e = 4 , p r ob = 0 . 5 ) )
# do n ot r e j e c t H0 , s i n c e p−v a l u e = 0 . 3 4 5 7
class frequency
150 to 155 20
155 to 160 30
160 to 165 55
165 to 170 60
170 to 175 85
175 to 180 80
180 to 185 50
185 to 190 40
190 to 195 30
195 to 200 15
200 to 205 10
# e s t i m a t i o n o f mean and sd
e s t . mean <− mean ( r e p ( x=r e s u l t s $ m i d , t i m e s=r e s u l t s $ n o ) )
e s t . sd <− sd ( r e p ( x=r e s u l t s $ m i d , t i m e s=r e s u l t s $ n o ) )
# e x p e c t e d number o f o b s e r v a t i o n
e s t . p <− pnorm ( r e s u l t s $ t o , mean = e s t . mean , sd = e s t . sd ) −
pnorm ( r e s u l t s $ f r o m , mean = e s t . mean , sd = e s t . sd )
e s t . no <− e s t . p ∗ sum ( r e s u l t s $ n o )
# H0 : no n o r m a l l y d i s t r i b u t e d
c h i 2 <− sum ( ( r e s u l t s $ n o − e s t . no ) ˆ 2 / e s t . no )
# d e c i s i o n : r e j e c t H0 , i f c h i ˆ2 (1 − a l p h a ) q u a n t i l e o f c h i ˆ2
# d i s t r i b u t i o n w i t h k = number o f c l a s s e s − 2 −1
c h i 2 > q c h i s q ( 1 − 0 . 1 , d f = l e n g t h ( r e s u l t s $ f r o m ) − 2 − 1)
1− p c h i s q ( c h i 2 , d f = l e n g t h ( r e s u l t s $ f r o m ) − 2 − 1)
# r e j e c t H0 , s i n c e p−v a l u e = 0 . 0 5 9 8
9. Some parents of the West Bay little leaguers think that they are notic-
ing a pattern. There seems to be a relationship between the number
on the kids’ jerseys and their position. These parents decide to record
what they see. The hypothetical data appear below. Conduct a Chi
c o n t t a b %>% ad d m ar gi n s ( )
# c h i ˆ2 t e s t : a s s o c i a t i o n o f two q u a l i t a t i v e v a r i a b l e s
# H0 : no a s s o c i a t i o n
r e s <− c h i s q . t e s t ( x=c o n t t a b )
res
# contingencytable
r e s $ o b s e r v e d %>% ad d m ar gi n s ( )
# indifferenctable
r e s $ e x p e c t e d %>% ad d m ar gi n s ( )
# Chi ˆ2
res$statistic
# d e c i s i o n : r e j e c t H0 , i f c h i ˆ2 > (1 − a l p h a ) q u a n t i l e o f c h i ˆ2
# d i s t r i b u t i o n w i t h k = (3 − 1)(3 − 1)=4
r e s $ s t a t i s t i c > q c h i s q ( 0 . 9 5 , d f =4)
# r e j e c t H0 , s i n c e p−v a l u e = 0 . 0 3 6 7 9
1− p c h i s q ( 1 0 . 2 2 5 7 3 , d f =4)
10. Two therapies for a specific febrile illness are to be be compared. For
this purpose, 4 and 6 randomly selected randomly selected patients
and the duration of treatment in hours required for the patient to be
necessary for the patient to be free of fever.
Therapie 1 Therapie 2
X Y
89,75 89
94,5 91
98,75 94
101,5 96,75
99,5
101,25
# D e t e r m i n i n g o f R . T1 and R . T2
sam p l e %>% f i l t e r ( gr p == ”T1 ” ) %>% su m m ar i se ( sum ( r a n g ) ) %>%
a s . n u m er i c ( ) −> R . T1 # 24
sam p l e %>% f i l t e r ( gr p == ”T2 ” ) %>% su m m ar i se ( sum ( r a n g ) ) %>%
a s . n u m er i c ( ) −> R . T2 # 31
# test s t a ti s t i c
U . T1 <− n1 ∗ n2 +n1 ∗ (1+ n1 ) ∗ 0 . 5 − R . T1 # 10
U . T2 <− n1 ∗ n2 +n2 ∗ (1+ n2 ) ∗ 0 . 5 − R . T2 # 14
t . xy <− (U −n1 ∗ n2 ∗ 0 . 5 ) / s q r t ( n1 ∗ n2 ∗ ( n1+n2 + 1) /12)
t . xy
a l p h a <− 0 . 0 5
# D i s t r i b u t i o n o f t h e W i l coxon Rank Sum S t a t i s t i c
q w i l c o x ( c ( a l p h a /2 ,1 − a l p h a / 2 ) , n1 , n2 ) # 3 ; 2 1
# d e c i s i o n : H0 : l o c a t i o n s h i f t = 0
( q w i l c o x ( a l p h a / 2 , n1 , n2 ) < U . T2 ) & (U . T2 < q w i l c o x (1 − a l p h a / 2 , n1 , n2 ) ) # t r u e −> no r e j e c t i o n
w i l c o x . t e s t ( T1 , T2 , a l t e r n a t i v e = ” two . s i d e d ” , p a i r e d = FALSE ,
c o n f . l e v e l = 1− a l p h a ) # p−v a l u e = 0 . 7 6 1 2
i b s <− 1 6 . 9 5
o s <− t i b b l e ( noa = c ( 1 8 . 1 9 , 1 6 . 9 8 , 1 9 . 9 7 , 1 6 . 9 8 , 1 8 . 1 9 , 1 5 . 9 9 , 1 3 . 7 9 , 1 5 . 9 0 ,
15.90 , 15.90 , 15.90 , 15.90 , 19.97 , 17.72) ,
au c = c ( 1 0 . 5 0 , 1 2 . 0 0 , 9 . 5 4 , 1 0 . 5 5 , 1 1 . 9 9 , 9 . 3 0 , 1 0 . 5 9 , 1 0 . 5 0 ,
10.01 , 11.89 , 11.03 , 9.52 , 15.49 , 11.02)
)
# C a l c u l a t e and i n t e r p r e t t h e t h e a r i t h m e t i c mean , v a r i a n c e ,
# s t a n d a r d d e v i a t i o n and t h e c o e f f i c i e n t o f v a r i a t i o n f o r t h e t h e
# o n l i n e , b ot h f o r t h e a u c t i o n and non− a u c t i o n .
o s %>% su m m ar i se (
# Test t h e h y p o t h e s i s t h a t t h e mean p r i c e a t t h e o n l i n e s t o r e
# ( no a u c t i o n ) i s u n e q u a l 1 6 . 9 5 Euro ( a l p h a = 0 . 0 5 ) .
a l p h a <− 0 . 0 5
t . t e s t ( x = os $ n oa , a l t e r n a t i v e = ” two . s i d e d ” , mu = i b s , c o n f . l e v e l = 1− a l p h a )
# One Sample t − t e s t : t = − 0. 003112 9 , d f = 1 3 , p− v a l u e = 0 . 9 9 7 6
# c o n c l u s i o n : t h e r e i s no e v i d e n c e , t h a t t h e o n l i e s t o r e d i f f e r fr om 1 6 . 9 5
# C a l c u l a t e a c o n f i d e n c e i n t e r v a l f o r t h e mean p r i c e a t t h e
# o n l i n e s t o r e ( no a u c t i o n ) and i n t e r p r e t you r f i n d i n g s i n t h e
# l i g h t of the h y p ot h esi s in b ) .
# 95 p e r c e n t c o n f i d e n c e i n t e r v a l : 15.95714 17.94001
# Test t h e h y p o t h e s i s t h a t t h e mean p r i c e a t t h e o n l i n e s t o r e
# ( a u c t i o n ) i s l e s s t h an 1 6 . 9 5 Euro ( a l p h a = 0 . 0 5 ) .
t . t e s t ( x = os $ au c , a l t e r n a t i v e = ” l e s s ” , mu = i b s , c o n f . l e v e l = 1− a l p h a )
# One Sample t − t e s t : t = − 14. 203 , d f = 1 3 , p−v a l u e = 1 . 3 5 2 e −09
# c o n c l u s i o n : t h e mean a u c t i o n p r i c e s a r e l o w e r t h an t h e p r i c e fr om t h e
# book s t o r e
# Test t h e h y p o t h e s i s t h a t t h e v a r i a n c e o f t h e non
# a u c t i o n −p r i c e i s u n e q u a l t o t h e v a r i a n c e o f t h e a u c t i o n p r i c e
# ( alpha = 0. 05).
v a r . t e s t ( x = o s . noa , y = o s . auc , a l t e r n a t i v e = ” two . s i d e d ” , c o n f . l e v e l = 1− a l p h a )
# F t e s t t o compare two v a r i a n c e s : F = 1 . 2 5 7 7 , num d f = 1 2 , denom d f = 1 3 ,
# p− v a l u e = 0 . 6 8 5 6
# c o n c l u s i o n : no e v i d e n c e , t h a t t h e v a r i a n c e s a r e d i f f e r e n t ; t h i s j u s t i f i e s t h e
# u s e o f 2 sam p l e t . t e s t w i t h e q u a l v a r i a n c e s . I n p r a c t i c e , i t i s b e s t t o u s e t h e
# Welsh− t e s t r a t h e r t h an t h e t − t e s t
1 2 3 4 5 6 7 8 9 10
Player 1 91 101 112 99 108 88 99 105 111 104
Player 2 261 47 40 29 64 6 87 47 98 351
P1 <− c ( 9 1 , 1 0 1 , 1 1 2 , 9 9 , 1 0 8 , 8 8 , 9 9 , 1 0 5 , 1 1 1 , 1 0 4 )
P2 <− c ( 2 6 1 , 4 7 , 4 0 , 2 9 , 6 4 , 6 , 8 7 , 4 7 , 9 8 , 3 5 1 )
# P l a y e r 2 i n s i s t s t h a t he i s a b e t t e r p l a y e r and s u g g e s t s t o
# compare t h e i r p e r f o r m a n c e . Use an a p p r o p r i a t e t e s t
# ( a l p h a = 0. 05 $ ) t o t e s t t h i s h y p o t h e s i s .
# 2 sam p l e Welsh t e s t
a l p h a <− 0 . 0 5
t . t e s t ( x = P1 , y = P2 , a l t e r n a t i v e = ” l e s s ” , p a i r e d = FALSE ,
v a r . e q u a l = FALSE , c o n f . l e v e l = 1− a l p h a )
# p−v a l u e = 0 . 4 8 6 9
# c o n c l u s i o n : no e v i d e n c e t o t h a t P2 i s b e t t e r t h an P1
# P l a y e r 1 i n s i s t s t h a t he i s a b e t t e r p l a y e r . He p r o p o s e t o
# n ot f o c u s on t h e mean and t o u s e t h e Wlicoxon −Mann−Whitney
# U− t e s t f o r c o m p a r i s o n ( a l p h a = 0 0 . 5 ) . What a r e t h e a d v a n t a g e s
# and d i s a d v a n t a g e s o f u s i n g t h i s t e s t compared w i t h a ) ?
w i l c o x . t e s t ( x = P1 , y = P2 , a l t e r n a t i v e = ” g r e a t e r ” , c o n f . l e v e l = 1− a l p h a )
# p−v a l u e = 0 . 0 1 8 7 5
# c o n c l u s i o n : e v i d e n c e t h a t P1 i s b e t t e r t h an P2
# The U− t e s t h as t h e a d v a n t a g e o f n ot b e i n g f o c u s e d t o t h e mean . The two
# sam p l e a r e c l e a r l y d i f f e r e n t : P2 s c o r e s w i t h much more v a r i a b i l i t y and
# h i s d i s t r i b u t i o n i s n ot sym m et r i c and n o r m a l l y d i s t r i b u t e d . S i n c e t h e
# sam p l e i s s m a l l , and t h e a s s u m p t i o n o f a n or m al d i s t r i b u t i o n i s l i k e l y
# n ot met , i t makes no s e n s e t o u s e a t − t e s t . Moreover , b e c a u s e t h e
# d i s t r i b u t i o n i s skewed t h e mean may n ot be a s e n s i b l e m easu r e o f
# c o m p a r i s o n . A drawback o f t h e U− t e s t i s t h a t i t u s e s o n l y t h e r a n k s and
# n ot t h e raw d a t a : i t t h u s u s e s l e s s i n f o r m a t o n t h an t h e t h e t − t e s t ,
# wh i ch would be p r e f e r r e d when com p ar i n g means o f a r e a s o n a b l y s i z e d sam p l e .
# Check w i t h an a p p r o b r i a t e t e s t wh et h er t h e ‘ ‘ r e s c u e s t a t u s ’ ’ and t h e
# ‘ ‘ t r a v e l c l a s s ’ ’ a r e i n d e p e n d e n t and wh et h er t h e c o n d i t i o n a l
# p r o b a b i l i t i e s of ‘ ‘ rescue status ’ ’ given ‘ ‘ t r a v e l c la ss ’ ’ d i f f e r
# by ‘ ‘ t r a v e l c l a s s ’ ’ .