Anda di halaman 1dari 32

Chapter 6

Hypothesis Testing –
Single Population
Week 9
L5 - Confidence Interval for Mean,
Variance Unknown
L6 - Hypothesis Test about a Proportion
and Hypothesis Test for variance

December 17 1
 Learning Outcomes:
At the end of the lesson student should be able
to

- construct CI for mean when variance

unknown and relate the CI with the
hypothesis test;
- Perform hypothesis test about a proportion
- Perform hypothesis test for variance

December 17 2
CI FOR NORMAL MEAN
WHEN VARIANCE IS UNKNOWN
A 100 (1- a )% confidence level for the mean m of a normal
Population when the value of s is not known is given by
s s
[ x  ( t a / 2 , n 1 )( ), x  ( t a / 2,n 1 )( )]
n n
Or equivalently
s s
x  ( t a / 2,n 1 )( )  m  x  ( t a / 2,n 1 )( )
n n

December 17 3
Example 1
The flow discharge of Perak River (measured in m3/s) was obtained at
random. 20 readings were collected and the mean flow discharge was
found to be 3.85m3/s with a standard deviation of 0.5m3/s.

(a) Test the hypothesis that mean flow discharge at Perak River is not
equal to 4m3/s . Use a=0.05;

(c) Construct a 95% two-sided CI on mean flow discharge. What is

conclusion?

December 17 4
Solution: (a)
1. Problem: To test about the mean, variance unknown.
2. Hypothesis : H 0 : m  4 vs H1 : m  4

X  m0
3. Test statistics: T 
s/ n
4. Critical value: Critical value: α = 0.05
t a/2, n-1= t 0.025, 19 = 2.093
5. Rejection region: Reject Ho IF
T  2 .0 9 3 o r T   2 .0 9 3
6. Calculation: 3.85  4
T  1.34
0.5 / 20
7. Conclusion:
Since -1.34 > -2.093, so we fail to reject the null hypothesis and
conclude the true mean flow discharge is not significantly different
from 4m3/s at α = 0.05.
December 17 5
Solution: (b)
From a t-distribution table, for a t – distribution with
19 degree of freedom, that T=1.34 is falls between
two values: 1.328 for which a=0.1 and 1.729 for
which a=0.05. So the P-value is :

Since P > 0.05, thus we fail to reject H0 and conclude

that the mean flow discharge is not significantly
different from 4m3/s. Same result as in (a).

December 17 6
Solution: (c)
A 95% two-sided CI flow discharge is

x  3.85, s  0.5, n  20, ta / 2,n 1  t0.025,19  2.093

 s   s 
x  ta / 2,n 1    m  x  ta / 2,n 1  
 n  n
 0.5   0.5 
3.85  (2.093)   m  3.85  (2.093) 
 20   20 
so the 95% two sided CI is 3.616  m  4.084

Since m  4 is falls inside of the CI, so we fail to reject the null

hypothesis and conclude the true mean flow discharge is not
significantly different from 4m3/s at α = 0.05.
Same results as in (a) and (b). 7
December 17
Example 2:

A practical brand of diet margarine was analyzed to determine

the level of polyunsaturated fatty acid (in percent). A sample of
six packages resulted in the following data: 16.8, 17.2, 17.4,
16.9, 16.5 and 17.1.

a = 0.01.

iii. Construct 95% two-sided CI on the mean and what is the

conclusion?.

December 17 8
Solution: (i)
1. Problem: To test about the mean, variance unknown.
2. Hypothesis : H 0 : m  17.0 vs H1 : m  17.0

X  m0
3. Test statistics: T 
s/ n
4. Critical value: Critical value: α = 0.01
t a, n-1= t 0.01, 5 = 3.365
5. Reject region: Reject Ho IF
T   3 .3 6 5
6. Calculation: x  16.98, s  0.3188
16.98  17
T   0.1537
7. Conclusion: 0.3188 / 6
Since - 0.1537 > - 3.365, so we fail to reject the null hypothesis and
conclude the true mean is 17.0 at α = 0.01.

December 17 9
Solution: (ii)
From a t-distribution table, for a t – distribution with 5
degree of freedom, that T = 0.1537 is falls at less
then 0.267 for which a= 0.4, so the P-value > 0.4

Since P > 0.01, thus we fail reject H0 and conclude

that the mean is 17. Same result as in (a).

December 17 10
Solution: (c)
A 95% two-sided CI flow discharge is

 s   s 
x  t0.025,5    m  x  t0.025,5  
 n  n
 0.3188   0.3188 
16.98  2.571   m  16.98  2.571 
 6   6 
Thus the 95% CI is 16.645  m  17.3146

Since m 17 is falls inside of the CI, so we fail to reject the null

hypothesis and conclude the true mean is 17.
Same results as in (a) and (b).
December 17 11
Example 3(Large Sample Size)
The flow discharge of Perak River (measured in m3/s) was obtained at
random. 100 readings were collected and the mean flow discharge was
found to be 3.85m3/s with a standard deviation of 0.5m3/s.

(a) Test the hypothesis that mean flow discharge at Perak River is not
equal to 4m3/s . Use a=0.05;

(c) Construct a 95% two-sided CI on mean flow discharge. What is

conclusion?

December 17 12
Solution: (a)
1. Problem: To test about the mean, variance unknown (Large Sample ).
2. Hypothesis : H 0 : m  4 vs H1 : m  4

X  m0
3. Test statistics: Z 
s/ n
4. Critical value: Critical value: α = 0.05
z a/2= Z 0.025= 1.96
5. Rejection region: Reject Ho IF
Z  1 . 96 or Z   1 . 96
6. Calculation: 3.85  4
Z  3.0
0.5 / 100
7. Conclusion:
Since -3.0 < -1.96, so we reject the null hypothesis and conclude the
true mean flow discharge is significantly different from 4m3/s at
α = 0.05.
December 17 13
Solution: (b)

P-value is :

Since P < 0.05, thus we to reject H0 at α = 0.05 and

conclude that the mean flow discharge is significantly
different from 4m3/s. Same result as in (a).

December 17 14
Solution: (c)
A 95% two-sided CI flow discharge is

x  3.85, s  0.5, n  100, Za / 2  1.96

 s   s 
x  Za / 2    m  x  Za / 2  
 n  n
 0.5   0.5 
3.85  (1.96)   m  3.85  (1.96) 
 100   100 
so the 95% two sided CI is 3.752  m  3.948

Since m  4 is falls outside of the CI, so we reject the null

hypothesis and conclude the true mean flow discharge is
significantly different from 4m3/s at α = 0.05.
Same results as in (a) and (b). 15
December 17
TEST ABOUT A PROPORTION p
 Three Test Problems about a proportion p:
1. H0: p = p0 (or p  p 0 ) against H 1 : p  p0
2. H0: p = p0 (or p  p 0 ) against H 1 : p  p0
3. H0: p = p0 against H 1: p  p 0

 Key: Test p̂  p 0 X  Z  N(0,1)

Z , p̂ 
Statistic: p 0 (1  p 0 ) / n n when p = p0

 Critical Region: (The region for Rejecting H0)

1. Z  z a
2. Z   z a
3. Z  z α/2 or Z  z α/2 , | Z |  z α/2
December 17 16
Example 4:
Regardless of age, about 20% of Malaysian adults participate in
fitness activities at least twice a week. In a local survey of 100
adults over 40 years old, a total of 30 people indicated that they
participated in a fitness activity at least twice a week. Do these
data indicate that the participation rate for adults over 40 years of
age is larger than 20%? Carry out a test at 10% significance level
and draw appropriate conclusion.
Solution: Problem: Test about a proportion p

H 0 : P  0.2 vs H1 : P  0.2
Test statistic used:

p̂  p 0 X
Z  N(0,1) , if p  p 0 , where p̂ 
p 0 (1  p 0 ) / n n

December 17 17
Critical region: Reject Ho IF Z > za

X =30 , n = 100, a = 0.1, z a = z 0.1 = 1.28 pˆ  3 0 / 1 0 0  0 . 3

pˆ  p0 X
Z  N (0,1) , if p  p0 , where pˆ 
p0 (1  p0 ) / n n

pˆ  p0 0.30  0.2
Z   2.5
p0 (1  p0 ) / n (0.2)(0.8) / 100

Decision: since Z = 2.5 > 1.28 , then we reject H0 , a strong evidence

say that the participation rate for adults over 40 years of age is
significantly larger than 20%.
December 17 18
CI FOR PROPORTION p
 Key: X: number of Success-items in an n- sample
p̂  p X
 N(0,1) , where p̂ 
p̂(1  p̂) / n n

 Therefore the Approximate (1 - a) CI for p is:

pˆ (1  pˆ ) pˆ (1  pˆ )
pˆ  ( za / 2 )( )  p  pˆ  ( za / 2 )( )
n n

December 17 19
Example 5:
Find the 90% two-sided CI for the proportion of age, about 20% of
Malaysian adults participate in fitness activities at least twice a week
if a total of 30 out of 100 people indicated that they participated in a
fitness activity.

Solution:
Problem: Two-side CI for the proportion of age, about 20% of
Malaysian adults participate in fitness activities at least twice a
week.

pˆ (1  pˆ ) pˆ (1  pˆ )
pˆ  ( za / 2 )( )  p  pˆ  ( za / 2 )( )
n n

December 17 20
Given Sample Data: n = 100, X = 30, a / 2 = 0.05, z0.05 = 1.65

Calculations:
pˆ  X / n  30 / 100  0.3

0.3  0.0756  p  0.3  0.0756

0.2244  p  0.3756
Since p = 0.2 is not in the interval, then we reject H0 ,at a =0.1.
A strong evidence say that the participation rate for adults over
40 years of age is significantly greater than 20%.
December 17 21

s
 Test Problems about variance, :
2

Null Hypothesis: H 0 :s 2  s 02 ( or H 0 : s 2  s 02 , H 0 : s 2  s 02 )

Test statistic:
(n  1) S 2
2  ~  2 (n  1) if s 2  s 02
s 02
Alternative Hypothesis Rejection Criteria ( Reject H0)

H1 :s  s
2 2  2   12 a / 2 , n  1 o r  2
  a2 / 2 , n  1
0

H1 :s 2  s 02  2 2
a , n 1
H1 :s 2  s 02  2   12 a , n  1
December 17 22
CI FOR VARIANCE s 2

is:

(n  1) s 2
( n  1) s 2
s 
2

a / 2,n 1
2
 2
1a / 2 , n 1

December 17 23
Example 6

An Aerospace Engineers claim that the standard

deviation of the percentage in an alloy used in
aerospace casting is greater than 0.3. 51 parts were
randomly selected and the sample standard
deviation of the percentage in an alloy used in
aerospace casting is s =0.37.

(i). At α = 0.05, do these data support the claim of

the engineers?
(ii) What is the P-value for this test?
(iii) Construct a 95% two-sided CI for s. What is
conclusion?
December 17 24
Solution:

Problem: Test about the variance of a Distribution

2. State the null hypothesis H0 an appropriate alternative
hypothesis, H1

3. Determine the appropriate test statistic

(n  1) S 2

χ 2

σ
0 2
0
December 17 25
4. Critical value given a  0.05 χ 2

0 .0 5 , 5 0
 6 7 .5 0
5. Critical region  Re ject H if   67.50 0
2
0

6. Compute any necessary sample quantities, substitute these into the

equation for the test statistic, and compute the value

n  5 1, s 2
 0 .0 9 , s 2  0 .1 3 6 9
(n  1) S 2
( 50 )( 0 . 1369 )
χ 
2
  76 . 056
σ 2
0 . 09
7. Make a decision

Since   76.056  
0
2 2
0.95 , 50
 67.50
Conclusion: We reject H0 , and conclude that the engineers
claim is true at the 0.05 level of significance. 26
Solution: (ii)
From a 2 - distribution table, 2 for a0.025 and 50
degree of freedom, that 2 = 71.42 and 2 for a0.01
and 50 degree of freedom, that 2 = 76.15. Since 2
= 76.056 is falls in between these two values for
a=0.025 and a=0.01, so the P-value 0.01<P< 0.025

Since P < 0.05, thus we reject H0 and conclude that

the variance is greater than 0.09. Same result as in
(a).

December 17 27
CI FOR VARIANCE s 2

Therefore the Approximate 95% two sided CI fors 2 is:

(n  1) s 2
(n  1) s 2
s 
2

a / 2,n 1
2
 2
1a / 2 , n 1

50(0.1369) 50(0.1369)
s 
2

71.42 32.36
0.0958  s  0.2115
2

Since variance 0.09 is outside from the CI, then we

conclude that the variance is greater than 0.09.
28
Same result as in (a) and (b).
December 17
Exercise:
Engineers designing the front-wheel-drive half shaft of a new model automobile
claim that the variance in the displacement of the constant velocity joints of the
shaft is less than 1.5 mm. 20 simulations were conducted and the following results
were obtained, x  3.39 and s = 1.41. At a  0.05, do these data support the
claim of the engineers?
Solution:
1. From the problem context, identify the parameter of interest

Problem: Test about the variance of a Distribution

2. State the null hypothesis H0 an appropriate alternative
hypothesis, H1

3. Determine the appropriate test statistic (n  1) S 2

χ 
2

σ2
December 17 29
4. Critical value given a  0.05 χ 20 .9 5 , 1 9  1 0 . 1 2
5. Critical region  Re ject H 0 if  2  10.12

6. Compute any necessary sample quantities, substitute these into the

equation for the test statistic, and compute the value

n  20, s 2
 1 .5 5 , s 2  1 .9 8 8
(n  1) S 2
(19 )(1 . 988 )
χ 
2
  21 . 8
σ 2
1 . 55
7. Make a decision

Decision: since  2  21.8  02.95,19  10.12

Conclusion: failed to reject H0 , data are not sufficient to
support the claim s 2 < (1.5)
December 17 30
P-value:
From a 2 - distribution table, 2 for a0.5 and 19
degree of freedom, that 2 = 18.34 and 2 for a0.1
and 19 degree of freedom, that 2 = 27.20. Since 2
= 21.8 is falls in between these two values for a=0.5
and a=0.1, so the P-value 0.1<P< 0.5

Since P > 0.05, thus we fail to reject H0 and conclude

that the variance is 0.15. Same result as in (a).

December 17 31
CI FOR VARIANCE s 2

Therefore the Approximate 95% two sided CI for s 2 is:

(n  1) s 2 (n  1) s 2
s 
2

a / 2,n 1
2
 2
1a / 2 , n 1
2 2
50(0.37) 50(0.37)
s 2

71.42 32.35
0.096  s 2  0.212
Since the variance 0.15 is falls inside of the CI, thus we
fail to reject H0 and conclude that the variance is 0.15.
32
Same
December 17 result as in (a) and (b).