Вы находитесь на странице: 1из 37

JURUSAN TEKNIK SIPIL

UNIVERSITAS ANDALAS



oleh :
Purnawan, PhD


----- Kuliah ke 9 -----
STATISTIKA
dan
PROBABILITAS
Chap 9-2
Chap 9-2
Chapter 9
Estimation and Hypothesis Testing
for Two Population Parameters
Chap 9-3
Chapter Goals
After completing this chapter, you should be
able to:
Test hypotheses or form interval estimates for
two independent population means
Standard deviations known
Standard deviations unknown
the difference between two population
proportions
Chap 9-4
Estimation for Two Populations
Estimating two
population values
Population
means,
independent
samples
Population
proportions
Group 1 vs.
independent
Group 2
Proportion 1 vs.
Proportion 2
Examples:
Chap 9-5
Difference Between Two Means
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30
Goal: Form a confidence
interval for the difference
between two population
means,
1

2

The point estimate for the
difference is
x
1
x
2
*
Chap 9-6
Independent Samples
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30
Different data sources
Unrelated
Independent
Sample selected from
one population has no
effect on the sample
selected from the other
population
Use the difference between 2
sample means
Use z test or pooled variance
t test
*
Chap 9-7
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30

1
and
2
known
Assumptions:

Samples are randomly and
independently drawn

population distributions are
normal or both sample sizes
are > 30

Population standard
deviations are known
*
Chap 9-8
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30
and the standard error of
x
1
x
2
is
When
1
and
2
are known and
both populations are normal or
both sample sizes are at least 30,
the test statistic is a z-value
2
2
2
1
2
1
x x
n

2 1
+ =

(continued)

1
and
2
known
*
Chap 9-9
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30
( )
2
2
2
1
2
1
/2
2 1
n

z x x +
o
The confidence interval for

1

2
is:

1
and
2
known
(continued)
*
Chap 9-10
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30

1
and
2
unknown, large samples
Assumptions:

Samples are randomly and
independently drawn

both sample sizes
are > 30

Population standard
deviations are unknown

*
Chap 9-11
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30

1
and
2
unknown, large samples
Forming interval
estimates:

use sample standard
deviation s to estimate

the test statistic is a z value


(continued)
*
Chap 9-12
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30
( )
2
2
2
1
2
1
/2
2 1
n
s
n
s
z x x +
o
The confidence interval for

1

2
is:

1
and
2
unknown, large samples
(continued)
*
Chap 9-13
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30

1
and
2
unknown, small samples
Assumptions:

populations are normally
distributed

the populations have equal
variances

samples are independent
*
Chap 9-14
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30

1
and
2
unknown, small samples
Forming interval
estimates:

The population variances
are assumed equal, so use
the two sample standard
deviations and pool them to
estimate

the test statistic is a t value
with (n
1
+ n
2
2) degrees
of freedom
(continued)
*
Chap 9-15
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30

1
and
2
unknown, small samples
The pooled standard
deviation is
(continued)
( ) ( )
2 n n
s 1 n s 1 n
s
2 1
2
2 2
2
1 1
p
+
+
=
*
Chap 9-16
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30
( )
2 1
p /2
2 1
n
1
n
1
s t x x +
o
The confidence interval for

1

2
is:

1
and
2
unknown, small samples
(continued)
Where t
o/2
has (n
1
+ n
2
2) d.f.,
and
( ) ( )
2 n n
s 1 n s 1 n
s
2 1
2
2 2
2
1 1
p
+
+
=
*
Chap 9-17
Hypothesis Tests for the Difference
Between Two Means
Testing Hypotheses about
1

2


Use the same situations discussed already:
Standard deviations known or unknown
Sample sizes > 30 or < 30
Chap 9-18
Hypothesis Tests for
Two Population Proportions
Lower tail test:

H
0
:
1
>
2

H
A
:
1
<
2


i.e.,

H
0
:
1

2
> 0
H
A
:
1

2
< 0
Upper tail test:

H
0
:
1

2
H
A
:
1
>
2
i.e.,

H
0
:
1

2
0
H
A
:
1

2
> 0
Two-tailed test:

H
0
:
1
=
2
H
A
:
1

2
i.e.,

H
0
:
1

2
= 0
H
A
:
1

2
0
Two Population Means, Independent Samples
Chap 9-19
Hypothesis tests for
1

2

Population means, independent samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30
Use a z test statistic
Use s to estimate unknown
, approximate with a z
test statistic
Use s to estimate unknown
, use a t test statistic and
pooled standard deviation
Chap 9-20
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30
( ) ( )
2
2
2
1
2
1
2 1
2 1
n

x x
z
+

=
The test statistic for

1

2
is:

1
and
2
known
*
Chap 9-21
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30

1
and
2
unknown, large samples
The test statistic for

1

2
is:
( ) ( )
2
2
2
1
2
1
2 1
2 1
n
s
n
s
x x
z
+

=
*
Chap 9-22
Population means,
independent
samples

1
and
2
known

1
and
2
unknown,
n
1
and n
2
> 30

1
and
2
unknown,
n
1
or n
2
< 30

1
and
2
unknown, small samples
Where t
o/2
has (n
1
+ n
2
2) d.f.,
and
( ) ( )
2 n n
s 1 n s 1 n
s
2 1
2
2 2
2
1 1
p
+
+
=
( ) ( )
2 1
p
2 1
2 1
n
1
n
1
s
x x
t
+

=
The test statistic for

1

2
is:
*
Chap 9-23
Two Population Means, Independent Samples
Lower tail test:

H
0
:
1

2
> 0
H
A
:
1

2
< 0
Upper tail test:

H
0
:
1

2
0
H
A
:
1

2
> 0
Two-tailed test:

H
0
:
1

2
= 0
H
A
:
1

2
0
o o/2 o/2 o
-z
o
-z
o/2
z
o
z
o/2
Reject H
0
if z < -z
o
Reject H
0
if z > z
o
Reject H
0
if z < -z
o/2

or z > z
o/2

Hypothesis tests for
1

2

Chap 9-24
Pooled s
p
t Test: Example
To select the best stabilisation material. Is there a difference
in the result of analysis on soil cement stabilisation and lime
stabilisation? The result of laboratory analysis is:
Cement Lime
Number 21 25
Sample mean 3.27 2.53
Sample std dev 1.30 1.16

Assuming equal variances, is
there a difference in average
yield (o = 0.05)?
Chap 9-25
Calculating the Test Statistic
( ) ( ) ( ) ( )
1.2256
2 25 21
1.16 1 25 1.30 1 21
2 n n
s 1 n s 1 n
s
2 2
2 1
2
2 2
2
1 1
p
=
+
+
=
+
+
=
( ) ( ) ( )
2.040
25
1
21
1
1.2256
0 2.53 3.27
n
1
n
1
s
x x
z
2 1
p
2 1
2 1
=
+

=
+

=
The test statistic is:
Chap 9-26
Solution
H
0
:
1
-
2
= 0 i.e. (
1
=
2
)
H
A
:
1
-
2
0 i.e. (
1

2
)
o = 0.05
df = 21 + 25 - 2 = 44
Critical Values: t = 2.0154

Test Statistic:
Decision:

Conclusion:

Reject H
0
at o = 0.05
There is evidence of a
difference in means.
t
0
2.0154 -2.0154
.025
Reject H
0
Reject H
0
.025
2.040
040 . 2
25
1
21
1
2256 . 1
53 . 2 27 . 3
=
+

= z
Chap 9-27
Two Population Proportions
Goal: Form a confidence interval for
or test a hypothesis about the
difference between two population
proportions, p
1
p
2

The point estimate for
the difference is
p
1
p
2
Population
proportions
Assumptions:
n
1
p
1
> 5 , n
1
(1-p
1
) > 5
n
2
p
2
> 5 , n
2
(1-p
2
) > 5
Chap 9-28
Confidence Interval for
Two Population Proportions
Population
proportions
( )
2
2 2
1
1 1
/2 2 1
n
) p (1 p
n
) p (1 p
z p p


o
The confidence interval for
p
1
p
2
is:
Chap 9-29
Hypothesis Tests for
Two Population Proportions
Population proportions
Lower tail test:

H
0
: p
1
> p
2

H
A
: p
1
< p
2


i.e.,

H
0
: p
1
p
2
> 0
H
A
: p
1
p
2
< 0
Upper tail test:

H
0
: p
1
p
2
H
A
: p
1
> p
2
i.e.,

H
0
: p
1
p
2
0
H
A
: p
1
p
2
> 0
Two-tailed test:

H
0
: p
1
= p
2
H
A
: p
1
p
2
i.e.,

H
0
: p
1
p
2
= 0
H
A
: p
1
p
2
0
Chap 9-30
Two Population Proportions
Population
proportions
2 1
2 1
2 1
2 2 1 1
n n
x x
n n
p n p n
p
+
+
=
+
+
=
The pooled estimate for the
overall proportion is:
where x
1
and x
2
are the numbers from
samples 1 and 2 with the characteristic of interest
Since we begin by assuming the null
hypothesis is true, we assume p
1
= p
2

and pool the two p estimates
Chap 9-31
Two Population Proportions
Population
proportions
( ) ( )
|
|
.
|

\
|
+

=
2 1
2 1 2 1
n
1
n
1
) p 1 ( p
p p p p
z
The test statistic for
p
1
p
2
is:
(continued)
Chap 9-32
Hypothesis Tests for
Two Population Proportions
Population proportions
Lower tail test:

H
0
: p
1
p
2
> 0
H
A
: p
1
p
2
< 0
Upper tail test:

H
0
: p
1
p
2
0
H
A
: p
1
p
2
> 0
Two-tailed test:

H
0
: p
1
p
2
= 0
H
A
: p
1
p
2
0
o o/2 o/2 o
-z
o
-z
o/2
z
o
z
o/2
Reject H
0
if z < -z
o
Reject H
0
if z > z
o
Reject H
0
if z < -z
o/2

or z > z
o/2

Chap 9-33
Example:
Two population Proportions
Is there a significant difference between the
proportion of men and the proportion of
women who will vote Yes on Proposition A?


In a random sample, 36 of 72 men and 31 of
50 women indicated they would vote Yes

Test at the .05 level of significance
Chap 9-34
The hypothesis test is:

H
0
: p
1
p
2
= 0 (the two proportions are equal)
H
A
: p
1
p
2
0 (there is a significant difference between proportions)
The sample proportions are:
Men: p
1
= 36/72 = .50
Women: p
2
= 31/50 = .62
.549
122
67
50 72
31 36
n n
x x
p
2 1
2 1
= =
+
+
=
+
+
=
The pooled estimate for the overall proportion is:
Example:
Two population Proportions
(continued)
Chap 9-35
The test statistic for p
1
p
2
is:
Example:
Two population Proportions
(continued)
.025
-1.96

1.96

.025
-1.31

Decision: Do not reject H
0

Conclusion: There is not
significant evidence of a
difference in proportions
who will vote yes between
men and women.
( ) ( )
( ) ( )
1.31
50
1
72
1
.549) (1 .549
0 .62 .50
n
1
n
1
p) (1 p
p p p p
z
2 1
2 1 2 1
=
|
.
|

\
|
+

=
|
|
.
|

\
|
+

=
Reject H
0
Reject H
0
Critical Values = 1.96
For o = .05
Chap 9-36
Two Sample Tests in EXCEL
For independent samples:
Independent sample Z test with variances known:
Tools | data analysis | z-test: two sample for means
Independent sample Z test with large sample
Tools | data analysis | z-test: two sample for means
If the population variances are unknown, use sample variances

For paired samples (t test):
Tools | data analysis | t-test: paired two sample for means
Chap 9-37
Chapter Summary
Compared two independent samples
Formed confidence intervals for the differences between two
means
Performed Z test for the differences in two means
Performed t test for the differences in two means
Compared two population proportions
Formed confidence intervals for the difference between two
population proportions
Performed Z-test for two population proportions