Professional Documents
Culture Documents
4 HYPOTHESIS
TESTING:
TWO SAMPLE
TESTS
Objectives
After studying this chapter you should
4.0
Introduction
59
Activity 1
Hand span 1
Activity 2
Hand span 2
4.1
F =
12 / 12
2 2 / 2 2
1 = n1 1 and 2 = n2 1 , written F( n 1, n
1
2 1
).
1 = 9 2 = 14
H0: 12
22
2
is true, then F = 1 2 ~ F( n 1, n 1)
1
2
2
5%
0.05
1 = 4 2 = 6
2.646
0.5%
0.005
0
12.03
61
Example
A random sample of 10 hot drinks from Dispenser A had a mean
volume of 203 ml and a standard deviation (divisor ( n 1) ) of
3 ml. A random sample of 15 hot drinks from Dispenser B gave
corresponding values of 206 ml and 5 ml. The amount
dispensed by each machine may be assumed to be normally
distributed. Test, at the 5% significance level, the hypothesis
that there is no difference in the variability of the volume
dispensed by the two machines.
Solution
H0: A2 = B2
H1: A2 B2
(two-tailed)
1 = nB 1 = 14 and 2 = n A 1 = 9
Using interpolation, the upper 2.5% point for
F(14, 9) = F(12, 9)
= 3.868
2
F
F(15, 9)
3 (12, 9)
2
(3.868 3.769)
3
= 3.802
Thus critical region is F > 3.802
Test statistic is
F =
B2 52
=
= 2.78
A2 32
This value does not lie in the critical region. Thus there is no
evidence, at the 5% level of significance, of a difference in the
variability of the volume dispensed by the two machines.
62
Critical region
reject HH00
Accept
H0
0
3.802
F
2.5%
Activity 3
Test the hypothesis that the variability in dominant hand span for
males is the same as that for females.
What assumption regarding hand span distributions did you make?
Explain why you consider the assumption to be reasonable.
Exercise 4A
1. An investigation was conducted into the dust
content in the flue gases of two types of solid-fuel
boilers. Thirteen boilers of type A and nine boilers
of type B were used under identical fuelling and
extraction conditions. Over a similar period, the
following quantities, in grams, of dust were
deposited in similar traps inserted in each of the
twenty-two flues.
Type A
Type B
73.1
78.7
53.3
60.6
53.0
58.8
46.0
56.4
75.1
55.5
55.2
39.3
41.2
56.4
82.1
48.0
61.5
63.1
55.8
66.6
58.9
67.2
730
711
698
679
712
762
686
683
724
673
Assistant
701
674
642
656
651
649
700
672
292.4
298.7
285.1
290.0
302.2
New machine
295.3
289.4
288.5
299.8
293.6
308.9
320.4
312.2
292.9
300.2
276.3
280.3
Designers 23
42
69
48
34
74
27
31
51
30
29
31
45
63
187
218
173
235
Model B
157
198
154
184
202
174
146
173
4.2
2
(a) if X ~ N , 2 , then X ~ N ,
n
(b) if X1 ~ N 1 , 12 independent of X2 ~ N 2 , 2 2 ,
then X1 X2 ~ N 1 2 , 12 + 2 2
2 2
X1 X2 ~ N 1 2 , 1 + 2
n1
n2
Hence
z =
( x1 x 2 ) (1 2 )
12 2 2
+
n1
n2
Example
The alkalinity, in milligrams per litre, of water in the upper
reaches of rivers in a particular region is known to be normally
distributed with a standard deviation of 10 mg/l. Alkalinity
readings in the lower reaches of rivers in the same region are
also known to be normally distributed, but with a standard
deviation of 25 mg/l.
65
75
91
88
94
63
86
77
71
69
68
97
64 113 108
79
62
(1 = lower, 2 = upper )
H 1: 1 > 2
(one-tailed)
( x1 x2 )
12 2 2
+
n1
n2
Calculation gives x1 =
1485
805
= 99.0 and x2 =
= 80.5 ,
15
10
so
z=
(99.0 80.5)
252 10 2
+
15
10
= 2.57
66
0
0
Critical
Critical
regionregion
reject
reject
H0H0
2.326
2.326
ZZ z
1%
1%
Accept
H0
Activity 4
Random numbers
A2 = B2 =
1
.
120
Exercise 4B
1. The mass of crisps delivered into bags by a
machine is known to be normally distributed with
a standard deviation of 0.5 g.
Prior to a minor overhaul of the machine, the
contents, in grams, of a random sample of six
bags are as follows.
151.7 152.6 150.8 151.9 152.3 151.5
1 (new)
78 87 79 82 87 81 85 80 82 83
2 (old)
74 77 78 70 87 83 76 78 81 76
67
296
300
297
299
302
306
307
306
297
297
302
299
296
299
299
304
303
299
68
6.
4.3
( x1 x2 ) (1 2 )
12 2 2
+
n1
n2
If 12 = 22 = 2 , then
z =
( x1 x2 ) (1 2 )
1
1
+
n1 n2
p2 =
(n1 1) 12 + (n2 1) 22
n1 + n2 2
69
Hence
( x1 x2 ) (1 2 )
1
1
+
n1
n2
Example
Mr Brown is the owner of a small bakery in a large town. He
believes that the smell of fresh baking will encourage customers to
purchase goods from his bakery. To investigate this belief, he
records the daily sales for 10 days when all the bakery's windows
are open, and the daily sales for another 10 days when all the
windows are closed. The following sales, in , are recorded.
Windows
open
Windows
closed
( x1 x2 )
p
1 1
+
n1 n2
Calculation gives
x1 = 202.18, 12 = 115.7284
and
70
Accept
H0
Critical region
reject H
H00
0 1.734
t
5%
Hence
9 115.7284 + 9 156.6534
p2 =
10 + 10 2
115.7284 + 156.6534
2
so
p = 11.67
Thus
t=
(mean when n1 = n2 )
202.18 188. 47
= 2.63
1
1
+
11.67
10 10
Example
Referring back to the Example in Section 4.1 concerning the two
drink dispensers, test, at the 5% level of significance, the
hypothesis that there is no difference in the mean volume dispensed
by the two machines.
Solution
H 0: A = B
H1: A B (two-tailed)
Significance level, = 0.05
2.5%
2.5%
Accept H0
Degrees of freedom, = 10 + 15 2 = 23
Using interpolation, critical region is
t < 2.07 or t > 2.07
2.07
2.07
Critical region
reject H0
( x1 x2 )
p
1
1
+
n1 n2
Hence
9 32 + 14 52
p2 =
= 18.7391 = 4.332
10 + 15 2
71
t=
Thus
203 206
= 1. 70
1
1
+
4.33
10 15
This value does not lie in the critical region so H 0 is not rejected.
Thus there is no evidence, at the 5% level of significance, to
suggest that there is a difference in the mean volume dispensed by
the two machines.
Activity 5
Activity 6
Exercise 4C
1. A microbiologist wishes to determine whether
there is any difference in the time it takes to
make yoghurt from two different starters;
lactobacillus acidophilus (A) and bulgarius (B).
Seven batches of yoghurt were made with each
of the starters. The table below shows the time
taken, in hours, to make each batch.
Starter A
Starter B
Assuming that both sets of times may be considered to be random samples from normal
populations with the same variance, test the
hypothesis that the mean time taken to make
yoghurt is the same for both starters.
2. Referring to Question 1 of Exercise 4A, test
for an equality of population means.
(AEB)
3. Referring to Question 2 of Exercise 4A, test the
hypothesis that the original and new machines
deliver the same mean mass of Korn Krispies.
(Use a 1% significance level.)
(AEB)
4. Referring to Question 3 of Exercise 4A, show
that, at the 1% significance level, the hypothesis
that the samples are from populations with equal
means is rejected.
(AEB)
72
4.4
73
2
d ~ N d , d
n
or
d d
~ N ( 0, 1)
d
n
d d
d
n
is a t statistic with degrees of freedom, = n 1.
Example
A school mathematics teacher decides to test the effect of using
an educational computer package, consisting of geometric
designs and illustrations, to teach geometry. Since the package
is expensive, the teacher wishes to determine whether using the
package will result in an improvement in the pupils'
understanding of the topic. The teacher randomly assigns pupils
to two groups; a control group receiving standard lessons and an
experimental group using the new package. The pupils are
selected in pairs of equal mathematical ability, with one from
each pair assigned at random to the control group and the other
to the experimental group. On completion of the topic the pupils
are given a test to measure their understanding. The results,
percentage marks, are shown in the table.
Pair
9 10
Control
72 82 93 65 76 89 81 58 95 91
Experimental
75 79 84 71 82 91 85 68 90 92
H 1: d > 0
(one-tailed)
Accept H0
Critical region
reject HH00
t
Degrees of freedom, v = 10 1 = 9
Critical region is t > 1.833
1.833
1.714
tt
5%
74
t =
d
d
n
Hence
d = 15 and d 2 = 317
so
Thus
t =
4 10 5
1.5
= 0.83
5.72
10
Activity 7
Exercise 4D
1. A random sample of eleven students sat a
Chemistry examination consisting of one theory
paper and one practical paper. Their marks out
of 100 are given in the table below.
Student
A B C D E F G H
J K
Theory mark
30 42 49 50 63 38 43 36 54 42 26
Practical mark
52 58 42 67 94 68 22 34 55 48 17
Sales
2.4 2.6 3.9 2.0 3.2 2.2 3.3 2.1 3.1 2.2 2.8
before
campaign
Sales
after
3.0 2.5 4.0 4.1 4.8 2.0 3.4 4.0 3.3 4.2 3.9
campaign
75
G H
Crackshot
93 99 90 86 85 94 87 91 96 79
Fastfire
87 91 86 87 78 95 89 84 88 74
Site
Ground
therm, x
Satellite
sensors, y
4.6
4.7
17.3
19.5
12.2
12.5
3.6
4.2
3rd round
76
75
72
75
79
4th round
70
73
71
68
76
6.2
6.0
14.8
15.4
11.4
14.9
14.9
17.8
9.3
9.7
10
10.4
10.5
11
7.2
7.4
A B C D E F G H
1 hr later
14 9 18 12 13 17 16 16 19 8 15 7
24 hrs later
10 6 14 6 8 10 12 10 14 5 10 5
4.5
J K L
10
Coursework 1 grade
Coursework 2 grade
The above grades are the results of a paired samples study since
the same ten students constituted both samples. However the
paired t-test of the previous Section requires the differences in
pairs to be normally distributed. This is certainly not the case here
so a non-parametric test is required. In fact since the grades are
letters, rather than numbers, differences can reasonably be listed
only as:
+
where
+
P( X 7) = 1 P( X 6 )
= 1 0.9648
= 0.0352 > 0.025
(5% two-tailed)
77
Example
On a particular day the incoming mail in each of twelve selected
towns was randomly divided into two similar batches prior to
sorting. In each town one batch was then sorted by the
traditional hand sorting method, the other by a new Electronic
Post Code Sensor Device (EPCSD). The times taken, in hours,
to complete the sorting of the batches are recorded below.
Town
4.3 4.1 5.6 4.0 5.9 4.9 4.3 5.4 5.6 5.2 6.1 4.7
EPCSD sort time 3.7 5.3 4.5 3.1 4.8 4.9 3.5 4.9 4.6 4.1 5.7 4.7
( 1 = 2 )
(one-tailed)
Activity 8
Brand preference
Obtain from your local supermarket two large bottles of cola (or
orange or lemonade); one bottle having a well-known brand
label, the other having the supermarket's own brand label.
78
Exercise 4E
1. Fifteen girls were each given an oral examination 5. To measure the effectiveness of a drug for
and a written examination in French. Their grades
asthmatic relief, twelve subjects, all susceptible
(highest = A, lowest = F) in the two examinations
to asthma, were each randomly administered
were as follows.
either the drug or a placebo during two separate
asthma attacks. After one hour an asthmatic
Girl
1
2
3
4
5
6
7
8
index was obtained on each subject with the
Oral exam
A
B
C
D
E
C
B
E
following results.
Written exam B
D
D
C
E
D
C
D
Subject
Girl
10
11
12
13
14
15
Oral exam
Written exam
E
C
C
C
D
E
C
E
E
F
C
D
B
C
9 10 11 12
Drug
28 31 17 18 31 12 33 24 18 25 19 17
Placebo 32 33 23 26 34 17 30 24 19 23 21 24
Method 2 199 230 198 253 180 209 213 137 250 82
79
4.6
Method A
11.2
8.6
6.5
17.3
14.3
10.7
9.8
13.3
Method B
10.4
12.1
9.1
15.6
16.7
10.7
12.8
15.5
Difference (A - B) +0.8
3.5
2.6
+1.7
2.4
0.0
3.0
2.2
80
and
( A B)
+0.8
3.5
2.6
+1.7
2.4
0.0
3.0
2.2
Absolute difference A B
0.8
3.5
2.6
1.7
2.4
0.0
3.0
2.2
Rank of A B
+1
+2
and hence,
T+ = 1 + 2 = 3
giving
T = 3 + 4 + 5 + 6 + 7 = 25
T = 25
(T+ + T ) = 28 = ( 7 8) 2,
and in general, ( T+ + T ) = n( n + 1) 2.
Under the null hypothesis of no real difference (i.e. A = B ),
each rank is equally likely to be associated with a positive or
negative sign. Thus in this example, the list of signed ranks
consists of all the possible combinations of
1
Value of T
Possible arrangements
(ranks of same sign)
28
all
27
rank 1
26
rank 2
25
24
Probability
Cumulative
probability
( 12 )7
( 12 )7
( 12 )7
7
2 ( 12 )
7
2 ( 12 )
0.0078125
0.0156250
0.0234375
0.0390625
0.0546875
would be
7.5 7.5
Example
An athletics coach wishes to test the value to his athletes of an
intensive period of weight training and so he selects twelve
400-metre runners from his region and records their times, in
seconds, to complete this distance. They then undergo his
programme of weight training and have their times, in seconds,
for 400 metres measured again. The table below summarises the
results.
Athlete
Before
51.0
49.8
49.5
50.1
51.6
48.9
52.4
50.6
53.1
48.6
52.9
53.4
After
50.6
50.4
48.9
49.1
51.6
47.6
53.5
49.9
51.0
48.5
50.6
51.7
82
Solution
Let
d
d
rank
s-rank
+0.4
0.6
+0.6
+1.0
0.0
+1.3
1.1
+0.7
+2.1
+0.1
+2.3
+1.7
0.4
0.6
0.6
1.0
0.0
1.3
1.1
0.7
2.1
0.1
2.3
1.7
3.5
3.5
10
11
+2
3.5
+3.5
+6
+8
+5
+10
+1
+11
+9
Hence
(Check: T+ + T = 66 = (11 12 ) 2 )
Thus
T = 55.5
Activity 9
83
Exercise 4F
1. Apply the Wilcoxon signed-rank test to the data
in Question 2 of Exercise 4D. Compare your
conclusion with those obtained previously.
(AEB)
2. Apply the Wilcoxon test to the data in Question 3
of Exercise 4D. List and discuss your three
conclusions to this set of data.
(AEB)
3. Apply the Wilcoxon test to the data in Question 5
of Exercise 4E. Compare your conclusion with
that from the sign test.
(AEB)
4. As part of her research into the behaviour of the
human memory, a psychologist asked 15
schoolgirls to talk for five minutes on 'my day at
school'. Each girl was then asked to record how
many times she thought that she had used the
word nice during this period. The table below
gives their replies together with the true values.
Girl
A
True value
12
Recorded value 9
B
20
19
C
1
3
D
8
14
E
0
4
F
12
12
G
12
16
Girl
I
True value
6
Recorded value 5
J
5
9
K
24
20
L
23
16
M
10
11
N
18
17
O
16
19
H
17
14
4.7
1
2
3
4
5
6
7
8
5.4 2.6 4.3 1.1 3.3 6.6 4.4 3.5
4.7 3.2 3.8 2.3 3.6 7.2 4.4 3.9
Soldier
Leather A
Leather B
9
10 11 12 13 14 15
1.2 1.3 4.8 1.2 2.8 2.0 6.1
1.9 1.2 5.8 2.0 3.7 1.8 6.1
Miscellaneous Exercises
84
18.2
25.8
16.8
14.9
19.6
26.5
17.5
Microfiche 68
91
71
96
97
75
13.4
18.8
20.5
6.5
22.2
15.0
12.2
On-line
69
93
79 117
79
14.3
18.0
15.1
260
185
565
375
900
310
630
240
280
215
10
No alcohol
365
400
735
430
900
Alcohol
420
405
205
255
900
No alcohol
Alcohol
Subject
85
78 102
77 121 84
73
69 123 84
67
95
85
Sum of marks
25
15
1060
819
Examiner V
Examiner W
F
32
96
Existing recipe 88
New recipe
94
35
49
67
66
17
82
24
25
Coursework (%) 68
Examination (%) 53
66
45
0
67
65
52
0
43
66
71
69
37
Taster
Existing recipe 8
New recipe
14
44
56
73
27
47
44
25
79
Coursework (%) 68
70
67
67
69
68
Examination (%) 43
68
27
34
79
57
54
Student
Student
86
M N
T U
Existing recipe 52 44 57 49 61 55 49 69 64 46
New recipe
74 65 66 47 71 55 62 66 73 59
Trainee A
Trainee B
83.7
79.6
58.8
59.2
77.7
75.8
85.1
84.3
Property
Trainee A
Trainee B
91.9
90.1
66.4
65.2
69.8
66.9
48.5
53.8
1275
705
Sum of squares
of scores
16485
9705
52 50 50 55 42 45 52 48 42 44
87
Surface
Bed
387
435
515
532
721
817
341
366
689
827
599
735
Location
10
11
12
Surface
Bed
734
812
541
669
717
808
523
622
524
476
445
387
Mean
(x)
( )
(n)
114.44
0.62
114.93
0.94
96
117
194
190
149
186
185
776
212
263
88