Professional Documents
Culture Documents
Hypothesis Testing: Comparing Two Populations
Hypothesis Testing: Comparing Two Populations
Hypothesis Testing: Comparing Two Populations
Chapter 13
Hypothesis testing:
Comparing two populations.
13.1 Testing the difference between two
population means: Independent samples
13.2 Testing the difference between two
population means: The matched pairs
experiment
13.3 Testing the difference between two
population proportions
1
1
A. Testing a hypothesis about
1 – 2 when the population
variances are known
If the sampling distribution of x1 x 2 is normal or
approximately normal, then
( X 1 X 2 ) ( )
Z
s s
n1 n2
2
Example 13.1 (contd.)
3
Annual household income (see page 523 for details)
Logan City Ipswich Using Excel D.A.
55840 44360 z-Test: Two Sample for Means
53840 44460
53940 43460
Logan City Ipswich
52940 44810
54290 44260 Mean 54180 45340
53740 44810 Known Variance 28783252 55353600
54290 45010 Observations 100 100
54490 45010 Hypothesized Mean Difference 0
54490 47360
z 9.637383377
56840 46360
55840 44560 P(Z<=z) one-tail 0
54040 44660 z Critical one-tail 1.644853627
54140 43660 P(Z<=z) two-tail 0
53140 45010 z Critical two-tail 1.959963985
54490 44460
53940 45010
At the 5% significance level, there is
. . sufficient evidence to reject the null
. . hypothesis. (We use p value =
. . P(Z9.64) one tail= 0 < 5% to make
. . the decision)
4
Case I: Unequal variances
(x1 x 2 ) ( 1 2 )
T
s12 s 22
( )
n1 n2
(s12 n1 s 22 /n 2 ) 2
with d.f. 2
(s12 n1 ) 2 (s 22 n 2 )
n1 1 n 2 1
5
Solution, pages 525– 526: Three steps to follow
1. Set up the hypotheses and state the test: Calculate 𝑥1 -
𝑥2 = 2383.2 – 2644.4<<0 , and according to the question
given we have to perform the following hypothesis testing (a
left tail test): H0 : - 2= 0 and HA : - 2<0 . Also,
calculate: s1 = 142.75 and s2 = 462.61 and hence
variances appear to be unequal.
2. Calculate value of the test statistic, d.f and t,d.f.
((𝒙
x 𝟏−𝒙
x𝟐 )2 −(𝝁 𝟐) = ) 𝟐𝟑𝟖𝟑.𝟐−𝟐𝟔𝟒𝟒.𝟒
) 𝟏( −𝝁 ( 2383.2 −𝟎 2644 4) 0
= .-2.31
t𝒛 = 1 𝟏𝟒𝟐.𝟕𝟓𝟐 𝟒𝟔𝟐.𝟔 𝟐 2.31
𝒔𝟏s𝟐 𝒔𝟐 𝟐s 142+.75 2
462.612
+
𝒏𝟏
𝟏𝟎 𝟐𝟎
𝒏𝟐
n1 n2 10 20
6
Case II: Equal variances
n1 n2 2
• Construct the equal-variances t-statistic as follows:
( x1 x 2 ) ( )
t
1 1
s p2 ( )
n1 n2
d.f . n1 n2 2
7
Assembly times in minutes
Design-A Design-B
6.8 5.2 Remarks
5.0 6.7 –The data are numerical.
7.9 5.7 –There are two
5.2 6.6 independent samples.
7.6 8.5
5.0 6.5
–The parameter of
5.9 5.9 interest is the difference
5.2 6.7 between two population
6.5 6.6 means.
. . –The claim to be tested is
. .
. . whether a difference
. . between the two designs
exists.
8
Design-A Design-B
6.8 5.2
5.0 6.7 Assembly times
7.9 5.7
5.2 6.6
7.6 8.5
5.0 6.5
5.9 5.9 Use Excel D.A.
5.2 6.7
6.5 6.6 t-Test: Two-Sample Assuming Equal Variances
. .
. . Design-A Design-B
. . Mean 6.288 6.016
. . Variance S 12 0.847766667 1.3030667 S 22
Observations 25 25
At the 5% significance Pooled Variance 1.075416667 Sp 2
6 is robust, we can be
4 confident
2
about the results.
0
4 5 6 7 8 9 More
Design B
10
Checking the 8
9
13.2 Testing the difference
between two population means:
Matched pairs experiment
Example 13.5, page 541:
• To determine whether a new steel-belted radial tyre
lasts longer than a current model, the manufacturer
designs the following matched pairs experiment (to
make the comparison without any side effects).
• One of each type of tyre is installed on the rear
wheels of 20 randomly selected cars.
• Drivers drive in their usual way until the tyres are
worn out.
• The number of kilometres driven by each driver are
recorded.
10
Solution, pages 542– 543
Three steps to follow:
1. Set up the hypotheses and state the test:
Calculate 𝑋𝐷 = 4.55 >> 0 , and according to the
question given we have to perform the following
hypothesis testing (a right tail test): H0 : D = 0 and HA:
D > 0 . Calculate also the S.D sD = 7.22.
11
13.3 Testing the difference
between two population proportions
• In this section we deal with two populations whose
data are nominal.
• When data are nominal, we can (only) ask questions
regarding the proportions of occurrences (successes)
of certain outcomes.
• Thus, we hypothesise on the difference p1 – p2 and
draw an inference from the hypothesis test.
• Consider statistic (sample proportion) 𝑝1 = 𝑋1 /𝑛1
where X1 is number of successes in sample of size n1
taken from the 1st population; and statistic 𝑝2 = 𝑋2 /𝑛2
where X2 is number of successes in sample of size n2
taken from the 2nd population.
12
Example 13.6, page 551
( pˆ 1 pˆ 2 ) 0 (0.009455 0.01718) 0
z 4.999
1 1 1 1
pˆ (1 pˆ )( ) (0.01332)(0.98668)( )
n1 n2 11000 11000
13
Solution, pages 550– 552:
Step 3:
3. Make the decision/ inference:
Note:
Since p-value = P(Z<-4.999)=0, we reject H0
and accept HA at the significance level = 5%.
14
Case 2: The following statistic may be
considered as Z- statistic and used to perform
the hypothesis testing when H0 : p1 - p2 = D.
(p̂1 p̂ 2 ) D
Z
p̂1 (1 p̂1 ) p̂ 2 (1 p̂ 2 )
n1 n2
15
Solution, pages 554– 555: Three steps to follow:
1. Set up the hypotheses and state the test:
Calculate 𝑝1 = 33/300 = 0.11 << 𝑝2 - 0.08 = 84/300 - 0.08
=0.28 - 0.08=0.20) and according to the question given we
have to perform the following hypothesis testing (a right tail
test) H0 : p1 – p2= - 0.08 and HA: p1 – p2 < -0.08 .
2. Calculate the value of the test statistic and z :
Home assignment:
32
16