You are on page 1of 123

8

Tests of Hypotheses
Based on a Single
Sample
8.1
Hypotheses and Test
Procedures
3
Hypotheses and Test Procedures
A (statistical) hypothesis is a claim or assertion such as,

= 5.9 ft, where = true mean height of all USF students

p < 0.10, where p = proportion of USF students 6.3 ft or taller

1

2
= 0.25 ft, where
1
,
2
= true mean height of male,
female USF students

USF student height has a normal distribution
4
Hypotheses and Test Procedures
For each hypothesis testing, there are 2 contradictory
hypotheses:

= 5.9 ft vs 5.9 ft

p < 0.10 vs p 0.10

1

2
= 0.25 ft vs
1

2
0.25 ft

USF student height has a normal distribution vs
student height does not have a normal distribution

One & only one of the 2 contradictory hypotheses is true!
5
Hypotheses and Test Procedures
Objective: To decide, based on sample information,
which of the two hypotheses is correct.

Null hypothesis H
0
: The claim initially assumed to be true.

Alternative hypothesis H
a
: The hypothesis contradictory to H
0
.

Conclusion from hypothesis testing: Reject H
0
, or
Fail to reject H
0
.

Reject H
0
(in favor of H
a
) only if sample evidence contradicts
H
0
and provides strong support for H
a
.

6
Hypotheses and Test Procedures
A Convention: Null hypothesis H
0
always stated as =.

Then there are 3 possible alternatives:

1. H
a
: u > u
0
(the implicit null hypothesis is u s u
0
),

2. H
a
: u < u
0
(the implicit null hypothesis is u > u
0
), or

3. H
a
: u u
0

7
Test Procedures
Consider the circuit board problem.

Test H
0
: p = 0.10 vs H
a
: p < 0.10 lower-tailed

Each board is either defective or non-defective.
Examine a random sample of n = 200 boards.

Let X = # of defective boards in the sample.
X is a binomial random variable.

Let x represent the observed value of X.
8
Test Procedures
If H
0
is true, E(X) = np = 200(0.10) = 20
we can expect < 20 defective boards if H
a
is true.

If Then
x = 25 Cannot reject H
0

x = 24 Cannot reject H
0


x = 16 ?
x = 15 ? Rejection value
x = 14 ?

x = 12 Reject H
0

x = 11 Reject H
0

9
Test Procedures
Another example

Consider burning rate of a solid propellant used to power
aircrew escape systems.

X = burning rate (cm/s), E(X) = .

Test H
0
: = 50 vs H
a
: 50 two-tailed
Randomly sample to get n burning rates of solid propellant.

If H
0
is true,
we can expect significantly deviates from 50 if H
a
is
true.


. 50 ) ( = = X E
X
10
Test Procedures
If Then
61 Reject H
0

60 Reject H
0

: ? Rejection value = ? 55?
: ?
51 Do not reject H
0

50 Do not reject H
0

49 Do not reject H
0

: ?
: ? Rejection value = ? 45?
x = 40 Reject H
0

x = 39 Reject H
0

= x
11
Test Procedures
Need two things to test a hypothesis:

(1) a test statistic (function of the sample data)

(2) a rejection value

Compare test statistic to rejection value to conclude:
either reject H
0

or fail to reject H
0

12
Test Procedures
In the circuit board example,

x is the test statistic

15 is the rejection value

If x 15, reject H
0

If x > 15, cannot reject H
0


x 15 (or x < 16) is called the rejection region.
13
Test Procedures
In the propellant burning rate example,

is the test statistic

45 and 55 are the rejection values

If 45, or 55 reject H
0

If 45 < < 55 , do not reject H
0


45 and 55 are called the rejection regions.
x
x x
x
x x
14
Errors in Hypothesis Testing
If the null hypothesis H
0
: p = 0.10 is true, then it should
not be rejected.

That is, not to reject H
0
is the correct decision!

But H
0
does get rejected when x s 15, which is an error!

It is called the type I error: wrongly reject a true H
0
.

In the circuit board problem, even when H
0
: p = 0.1 is true,
an unusual sample with x = 13 would lead to H
0
being
errornously rejected.
15
Errors in Hypothesis Testing
On the other hand, if the null hypothesis H
0
: p = 0.10 is
false, then it should be rejected.

That is, to reject H
0
is the correct decision!

But we cannot reject H
0
when x > 15, which is also an error!

It is called the type II error: fail to reject a false H
0
.

In the circuit board example, even when H
a
: p < 0.1 is true,
an unusual sample with x = 20 would lead to H
0
not being
rejected which is an incorrect conclusion.

16
Errors in Hypothesis Testing
Summary

When H
0
is true, we should not reject H
0
. But if H
0
does get
rejected, a type I error has been made.

When H
0
is false, we should reject H
0
. But if we fail to reject
H
0
, we are making a type II error.

= P(type I error) = P(reject H
0
when H
0
is true)

= P(type II error) = P(not reject H
0
when H
0
is false)
17
Example 8.1
Some car can sustain no visible damage 25% of the time in
10-mph crash tests. A modified bumper design has been
proposed in an effort to increase this percentage.

Let p = proportion of all 10-mph crashes with this new
bumper that result in no visible damage.

Test hypotheses
H
0
: p = 0.25 vs H
a
: p > 0.25 (improvement)

Sample n = 20 independent crashes with prototypes of the
new design.
18
Example 8.1
H
0
should be rejected if a large # of the crashes show no
damage. Consider the following test procedure:

Test statistic: X = the number of crashes with no visible
damage

Rejection region: R
8
= {8, 9, 10,,19, 20}.
Reject H
0
if x > 8, and
cannot reject H
0
if x < 8.
contd
19
Example 8.1
When H
0
is true, X has a binomial probability distribution
with n = 20 and p = 0.25.

o = P(type I error)
= P(H
0
is rejected when it is true)
= P(X > 8 when X ~ Bin(20, 0.25))
= 1 B(7; 20, 0.25)
= 1 0.898
= 0.102

Even when H
0
is actually true, about 10% of all
experiments of 20 crashes result in H
0
being incorrectly
rejected (a type I error).
contd
20
Example 8.1
If H
0
is false (p 0.25), a type II error is made when x < 8.

But the value of depends on what is the actual value of p.

Example Consider p = 0.3

|(p=0.3) = P(type II error when p = 0.3)
= P(fail to reject H
0
when p = 0.3)
= P(X s 7 when X ~ Bin(20, 0.3))
= B(7; 20, 0.3)
= 0.772

When p = 0.3 (not 0.25), about 77% of all experiments
of 20 crashes result in H
0
being incorrectly not rejected!

contd
21
Example 8.1
Table below presents | values for various true p values.




| decreases as the true p value moves farther away from
the null value 0.25.

This agrees with the intuition that the greater the departure
from H
0
, the less likely it is that such a departure will not be
detected.
contd
22
Errors in Hypothesis Testing
The type I error probability o is often referred to as the
significance level of the test.

Typical levels of significance are 0.10, 0.05, and 0.01.

The corresponding test procedure is called a level o test
(e.g., a level 0.05 test or a level 0.01 test).


23
Exercise Problem 12
True mean braking distance at 40 mph is 120 ft for the
current braking system.
A new design for the brake system was proposed.
New design be implemented only if sample data strongly
indicates a reduction in for the new design.

a. Define the parameter of interest and state test hypothesis.

Solution
= true mean braking distance at 40 mph for new design.

Test hypotheses H
0
: = 120 vs H
a
: < 120

24
Exercise Problem 12
b. Suppose braking distance for new system is normally
distributed with = 10. For a random sample of size n = 36,
which rejection region is appropriate?
R1 = R2 =
R3 =

Solution
when H
0
is true, when H
a
is true.
R2 should be used, as support for H
a
is provided only by
an value substantially below 120.

} 8 . 124 : { > x x } 2 . 115 : { s x x
} 13 . 125 87 . 114 : { > s x or x either x
x
120 ) ( = X E 120 ) ( < X E
25
Exercise Problem 12
c. What is significant level for the rejection region of part
(b): ? How would you change the region to
obtain a test with = 0.01.

Solution

=
= 0.002

To obtain = 0.001, replace 115.2 by
120 3.08(1.6667) = 114.87, so that
} 2 . 115 : { s x x
6667 . 1
36
10
= = =
n
X
o
o
)
6667 . 1
120 2 . 115
( ) 120 2 . 115 (

s = = s Z P when X P
001 . 0 )
6667 . 1
120 87 . 114
( ) 120 87 . 114 ( =

s = = s Z P when X P
26
Exercise Problem 12
d. What is the probability that the new design is not
implemented when its true mean braking distance is actually
115 ft for rejection region ?

Solution


= 1 (0.12) = 0.4522

)
6667 . 1
115 2 . 115
( ) 115 2 . 115 ( ) 115 (

> = = > = Z P when X P |
} 2 . 115 : { s x x
27
Exercise Problem 12
c. Let .

What is for rejection region {z: z 2.33}?
What is for rejection region {z: z 2.88}?

Solution

Since Z is the standardization of when = 120,

for {z: z 2.33}, = P(Z 2.33) = 0.01, and

for {z: z 2.88}, = P(Z 2.88) = 0.002, equivalent to R2.
n
X
Z
/
120
o

=
X
28
Section Summary
Concepts Discussed

Statistics Hypothesis
Null Hypothesis H
0

Alternative Hypothesis H
a

Hypothesis Test
Test Statistic & Rejection Criteria
Type I Error
Type II Error
Significance Level of a Test
29
8.2
Tests About a Population
Mean
30
Tests About a Population Mean
We discussed CIs for for three different cases:

- A normal population with known
- Large-sample CI
- A normal population with unknown

This section presents hypothesis tests for these 3 cases.

- Hypothesis Tests for a normal population with known
- Large-sample Statistical hypothesis tests
- Hypothesis tests for a normal population with unknown

31
Case I: A Normal Population with Known o
Let X
1
,, X
n
be a random sample of size n from N(,
2
).

Then the sample mean


Null Hypothesis H
0
: =
0
.

When H
0
is true,


From sample data, compute


) , ( ~
2
n
N X
o

). 1 , 0 ( ~
/
0
N
n
X
Z
o

=
.
/
0
n
x
z
o

=
32
Case I: A Normal Population with Known o
3 possible alternative hypotheses: H
a
: >
0

H
a
: <
0

H
a
:
0



a. Upper-tailed Test H
0
: =
0
vs H
a
: >
0


b. Lower-tailed Test H
0
: =
0
vs H
a
: <
0


c. Two-tailed Test H
0
: =
0
vs H
a
:
0


33
Case I: A Normal Population with Known o
The rejection regions are illustrated below.
34
Case I: A Normal Population with Known o
Null hypothesis: H
0
: =
0


Test statistic value :

Alternative Hypothesis Rejection Criteria for Level o Test
35
Case I: A Normal Population with Known o
To test a hypothesis, do the following:

1. State the null and alternative hypotheses.

2. Compute the z value.

3. Find the z

(or z
/2
) value.

4. Conclude by comparing z and z

(or z
/2
).
36
Example 8.6
A manufacturer of sprinkler systems used for fire protection
in office buildings claims that the true average
system-activation temperature is 130.

A sample of n = 9 systems yields a sample average
activation temperature of 131.08F.

If the distribution of activation times is normal with =
1.5F, does the data contradict the manufacturers claim at
significance level o = 0.01?
37
Example 8.6
1. H
0
: = 130 vs H
a
: 130

2. Compute

3. = 0.01, z
/2
= z
0.005
= 2.58.

4. Cannot reject H
0
, as 2.58 < z < 2.58.

The data does not give strong support to the claim that
the true average differs from the design value of 130.


contd
. 16 . 2
9 / 5 . 1
130 08 . 131
/
0
=

=
n
x
z
o

38
Case I: A Normal Population with Known o
Compute |

Consider the upper-tailed test with rejection region z > z
o
.

z > z
o
is equivalent to

H
0
will not be rejected if
39
Case I: A Normal Population with Known o
Type II error: H
0
( =
0
) is false, but H
0
is not rejected!

H
0
is false >
0
.

Suppose = (>
0
). Then depends on .







decreases, as increases!




40
Case I: A Normal Population with Known o
Type II Error Probability for
Alternative Hypothesis a Level Test .








Note: H
0
is false, and = .
41
Case I: A Normal Population with Known o
Determine a proper sample size n

The sample size n for which a level o test also has
|( ') = | at the alternative value ' is




for a one-tailed
(upper or lower) test
for a two-tailed test
(an approximate solution)
42
Example 8.7
Let = true average tread life of some type of tire.

Test H
0
: = 30,000 vs H
a
: > 30,000

based on a sample of size n = 16 from N(, 1500
2
).

Consider o = 0.01. Then z
o
= z
0.01
= 2.33.

Here
0
= 30,000.

If = = 31,000. Then







3669 . 0 ) 34 . 0 ( )
16 / 1500
31000 30000
33 . 2 ( = u =

+ u = |
43
Example 8.7
If we want to be no more than 0.1, what should n be?

For = 0.1, z

= z
0.1
= 1.28. Then

= 29.32


The sample size of n = 30 tires should be used.
contd
44
Case II: Large-Sample Tests
A large n implies that the standardized variable



has approximately a standard normal distribution,
regardless what distribution the sample is taking from.

When H
0
is true, ~ N(1, 0).

The rule of thumb n > 40 will again be used to characterize
a large sample size.

45
Case II: Large-Sample Tests
a. Upper-tailed Test H
0
: =
0
vs H
a
: >
0


b. Lower-tailed Test H
0
: =
0
vs H
a
: <
0


c. Two-tailed Test H
0
: =
0
vs H
a
:
0



46
Null hypothesis: H
0
: =
0


Test statistic value :

Alternative Hypothesis Rejection Criteria for Level o Test
Case II: Large-Sample Tests
n s
x
z
/
0

=
47
Example 8.8
A dynamic cone penetrometer (DCP) is used for measuring
material resistance to penetration (mm/blow) as a cone is
driven into pavement or subgrade.

Suppose the true average DCP value () for a certain type
of pavement ir required to be less than 30.

The pavement will not be used unless there is conclusive
evidence that the specification has been met.
48
Example 8.8
52 data points are obtained and presented below.






The sample mean DCP < 30.

But there is a substantial amount of variation in the data
(sample coefficient of variation = = 0.4265).

contd
49
Example 8.8
1. Test H
0
: = 30 vs Ha: < 30 with = 0.05

Do not use the pavement unless H
0
is rejected.

2. Compute z. n = 52, = 28.76, and s = 12.2647



3. z

= z
0.05
= 1.645.

4. Cannot reject H
0
, as z < -1.645.

The use of the pavement is not justified!


contd
50
Case II: Large-Sample Tests
Determination of | and the necessary sample size for
these large-sample tests can be based either on specifying
a plausible value of o and using the case I formulas
(even though s is used in the test) or on using the
methodology to be introduced shortly in connection with
case III.
51
Compute
Type II Error Probability for
Alternative Hypothesis a Level Test .








Note: H
0
is false, and = .
Case II: Large-Sample Tests
|
.
|

\
|
+ u
n s
z
/
'
0

o
|
.
|

\
|
+ u
n s
z
/
'
1
0

o
|
.
|

\
|
+ u |
.
|

\
|
+ u
n s
z
n s
z
/
'
/
'
0
2 /
0
2 /

o o
52
Case III: A Normal Population Distribution
Let X
1
, X
2
,, X
n
be sampled from a normal distribution.

If n is small & is unknown, the standardized variable




has a t distribution with n 1 degrees of freedom (df).

53
Case III: One-Sample t Test
Null hypothesis: H
0
: =
0


Test statistic:

Alternative Hypothesis Rejection Criteria for a Level o Test
54
To test a hypothesis, do the following:

1. State the null and alternative hypotheses.

2. Compute the t value.

3. Find the t
, n-1
(or t
/2, n-1
) value.

4. Conclude by comparing t and t
, n-1
(or z
/2, n-1
).
Case III: One-Sample t Test
55
Example 8.9
Glycerol is a major by-product of ethanol fermentation in
wine production and contributes to the sweetness, body,
and fullness of wines.

A sample of n = 5 glycerol concentrations (mg/mL) for
standard-quality (uncertified) white wines are obtained:
2.67, 4.62, 4.14, 3.81, 3.83.

Suppose the desired concentration value is 4.

Does the sample data suggest that true average
concentration is something other than the desired value
with 95% confidence?
56
Example 8.9
The following normal probability plot from Minitab strongly
support the assumption that the population distribution of
glycerol concentration is normal.






contd
57
Example 8.9
1. Test hypothesis H
0
: = 4 vs H
a
: 4

2. Compute t
Sample mean = 3.814 and s = 0.718
t = (3.814 4)/(0.718/5) = 0.58

3. For n = 5 and = 0.05, t
/2, n-1
= t
0.025, 4
= 2.766

4. H
0
cannot be rejected since, 2.776 < t < 2.776.

contd
58
Case III: A Normal Population Distribution
Determine | & a Proper Sample Size n

When H
0
( =
0
) is false & = , the computation of type II
error is challenging, and must be done numerically.

The results are summarized in Appendix Table A.17.

The curves in Table A.17 are called Operating Characteristic
(OC) curves.



59
Case III: A Normal Population Distribution
Use the OC curves to find .

1. Compute d = |
0


'|/o (or |
0


'|/s) .
2. Find the degree of freedom df = n-1.
3. Determine the proper graph to use, based on
- one-tailed or two-tailed alternative hypothesis
- the value of
4. The intersection of d and the OC curve of df = n-1
determines the value.

60
Case III: A Normal Population Distribution
This procedure is illustrated below.
61
Case III: A Normal Population Distribution
Use the OC curves to fetermine a proper n.

1. Compute d = |
0


'|/o (or |
0


'|/s).
2. Determine the proper graph to use, based on
- one-tailed or two-tailed alternative hypothesis
- the value of
3. Identify the OC curve that passes through the
point (d, ).
4. n = df + 1, where df is associated with the OC curve
identified in (3).
62
Example 8.10
The true average voltage drop from collector to emitter of
insulated gate bipolar transistors of a certain type is
supposed to be at most 2.5 volts.

Test H
0
: = 2.5 vs H
a
: > 2.5
based on a sample of n = 10, and o = 0.05.

If o = 0.1, how likely is it that H
0
will not be rejected when in
fact = 2.6?

What is , if = 2.6?
63
Example 10
1. Compute d = |2.5 2.6|/0.1 = 1.0
2. df = 10 1 = 9.
3. Use the top-left graph: o = 0.05, one-tailed.
3. The intersection leads to | ~ 0.13.

What should be n, if one wants | = 0.05?

Locate point (d, |) = (1.0, 0.05).
Identify the OC curve passing (1, 0.05): 13 df curve.

Use n = 13: it will give both o = 0.05 and | = 0.05 when
the true value of is 2.6 and o = 0.10.

contd
64
Case III: A Normal Population Distribution

The power of a test: Power = 1 |.

A powerful test is one that has high power and therefore
good ability to detect when the null hypothesis is false.
65
Exercise Problem 18
In Example 8.2, drying time is normally distributed with =9.

Test hypothesis H
0
: = 75 vs H
a
: < 75 n = 25

a. How many sds of below hull hypothesis is = 72.3?
b. If = 72.3, what is the test conclusion using = 0.01?
c. What is for test procedure what reject H
0
when z 2.88?
d. For the test procedure of part (c), what is (70)?
e. For test procedure of part (c), what n ensures (70) = 0.1?
f. For a level 0.01 test with n = 100, what is the probability of
a type I error when = 76?
x
x
X
66
Exercise Problem 18
a.
(72.3 75)/1.8 = 1.5, so 72.3 is 1.5 sds below 75.

b. For = 0.01, z

= 2.33. Reject H
0
if z 2.33.
z = 1.5 > 2.33, do not reject H
0
.

c. = P(Z 2.88) = 0.002.

d. (70) = 1 [2.88+(75 70)/1.8] = 1 0.4602 = 0.5398.

e. n = [9(2.88+2.33)/(7570)]
2
= 87.95. Use n = 88.

f. = 0, as a type I error occurs only when H
0
is ture!
But = 76 means H
0
is actually false!
8 . 1 25 / 9 / = = = n
X
o o
67
Exercise Problem 29
12 data points on time (min) to repair a rail break yield a
sample mean of 249.7 and a sample sd of 145.1
A normal probability plot indicates normal assumption OK.

a. Is there compelling evidence for concluding that true mean
repair time exceeds 200 min? Carry out a test of hypotheses
using = 0.05.

b. Using = 150, (300) = ?

68
Exercise Problem 29
a. 1. Test hypothesis H
0
: = 200 vs H
a
: > 200 n=12
2. Compute t = (249.7 200)/(145.1/12) = 1.19
3. = 0.05, t
0.05, 11
= 1.796.
4. t < 1.796 Cannot reject H
0
.
There is insufficient evidence to conclude that true mean
repair time exceeds 200 min

c. For = 150, d =
0
/ = 200300/150 = 2/3, df = 11.
Using OC curves in the top-left graph in Table A.17,
(300) = 0.3
69
Section Summary
Concepts Discussed

3 statistical hypothesis testing
a. Upper-tailed Test H
0
: =
0
vs H
a
: >
0

b. Lower-tailed Test H
0
: =
0
vs H
a
: <
0

c. Two-tailed Test H
0
: =
0
vs H
a
:
0

for the following 3 cases:
- A normal population with known
- Large-sample CI
- A normal population with unknown
Compute type II error
Determine a proper sample size n
OC curves






70
8.3
Tests Concerning a
Population Proportion
71
Tests Concerning a Population Proportion
p = proportion of individuals in a population who possess a
specified property, labeled S (success).

3 statistical hypothesis testing:

a. Upper-tailed Test H
0
: p = p
0
vs H
a
: p > p
0

b. Lower-tailed Test H
0
: p = p
0
vs H
a
: p < p
0

c. Two-tailed Test H
0
: p = p
0
vs H
a
: p p
0


based on a sample of size n, and X = # of Ss in the sample.
72
Tests Concerning a Population Proportion
There are 2 cases:

1. If n is large (i.e., np > 10 and n(1 p) > 10), then X is
approximately a normal rv.

2. If n is small, then X is (approximately) a binomial rv.

73
Large-Sample Tests
Null hypothesis: H
0
: p = p
0

Test statistic: , with

Alternative Hypothesis Rejection Criteria
H
a
: p > p
0
z > z
o
(upper-tailed)

H
a
: p < p
0
z s z
o
(lower-tailed)

H
a
: p p
0
either z > z
o/2
or z s z
o/2
(two-tailed)

These test procedures are valid provided that
np
0
> 10 and n(1 p
0
) > 10.
n p p
p p
z
/ ) 1 (

0 0
0

= n x p /

=
74
Example 8.11
Natural cork in wine bottles is subject to deterioration, and
as a result wine in such bottles may experience
contamination.

In a tasting of commercial chardonnays, 16 of 91 bottles
were considered spoiled to some extent by cork-associated
characteristics. (n = 91, x = 16)

Does this data provide strong evidence for concluding that
more than 15% of all such bottles are contaminated in this
way with 90% confidence?
75
Example 8.11
1. Hypotheses: H
0
: p = 0.15 vs H
a
: p > 0.15.

2. np
0
= 91(0.15) = 13.65 > 10, n(1p
0
) = 77.35 > 10
Large-sample z test can be used.
Compute z = (16/91 0.15)/[0.15(0.85)/91] = 0.69.

3. = 0.10. z

= z
0.10
= 1.28.

4. H
0
can not be rejected as z < 1.28.

The sample does not support the conclusion that the
percentage of contaminated bottles in the population
percentage exceeds 15%.


contd
76
Large-Sample Tests
| and Sample Size Determination When H
0
is true, the
test statistic Z has approximately a standard normal
distribution.

Now suppose that H
0
is not true and that p = p'. Then Z still
has approximately a normal distribution (because it is a
linear function of ), but its mean value and variance are no
longer 0 and 1, respectively. Instead,




The probability of a type II error for an upper-tailed test is
|(p') = P(Z > z
o
when p = p').
77
Large-Sample Tests
This can be computed by using the given mean and
variance to standardize and then referring to the standard
normal cdf.

In addition, if it is desired that the level o test also have
|(p') = | for a specified value of |, this equation can be
solved for the necessary n.
78
Large-Sample Tests
Compute |(p'), if p = p.

Alternative Hypothesis |(p')


H
a
: p > p
0



H
a
: p < p
0




H
a
: p p
0
79
Large-Sample Tests
Compute the proper sample size n for which the level o test
also satisfies |(p') = |
80
Example 8.12
A package-delivery service advertises that at least 90% of
all packages brought to its office by 9 A.M. for delivery in the
same city are delivered by noon that day.

Statistical hypotheses: H
0
: p = 0.9 vs H
a
: p < 0.9

(1) If only 80% of the packages are delivered as advertised,
how likely is it that a level 0.01 test based on n = 225
packages will detect such a departure from H
0
?
(2) What should the sample size be to ensure that |(0.8) =
0.01?
81
Example 8.12
(1) With o = 0.01, p
0
= 0.9, p' = 0.8, and n = 225,






P(H
0
will be rejected, when p = 0.8) = 0.9772
About 98% of all samples lead to correct rejection of H
0
.
contd
82
Example 8.12
(2) = = 0.01. So z
o
= z
|
= 2.33.


contd
83
Small-Sample Tests
We now discuss case 2: Sample size n is small.

X (= # of successes in the sample) is a binomial rv with p.

Test procedures are based on binomial distribution!

Consider H
0
: p = p
0
vs H
a
: p > p
0

Test statistic: X

Find the smallest x

such that 1 B(x

1; n, p
0
) .

Reject H
0
if x x

.

Remark As X is discrete, in general 1B(x

1; n, p
0
) < .
84
Rejection Criteria for Small-Sample Tests
Null hypothesis: H
0
: p = p
0

Test statistic: x

Alternative Hypothesis Rejection Criteria
H
a
: p > p
0
x > x
o
(upper-tailed)

H
a
: p < p
0
x s x
o
(lower-tailed)

H
a
: p p
0
x > x
o/2
or x s x
o/2
(two-tailed)

where x
t
is the smallest c such that 1B(c1; n, p
0
) t, &

x
t
is the largest c such that B(c; n, p
0
) t,

t = or /2.
85
Small-Sample Tests
Compute if H
0
(p =p
0
) is false, and p = p'

Consider H
0
: p = p
0
vs H
a
: p > p
0


|(p') = P(type II error when p = p')

= P(X < x
o
when X ~ Bin(n, p'))

= B(x
o
1; n, p')
86
Small-Sample Tests
Compute |(p'), if p =p.

Alternative Hypothesis |(p')

H
a
: p > p
0
B(x
o
1; n, p')



H
a
: p < p
0
1 B(x
o
; n, p')




H
a
: p p
0
B(x
o/2
1; n, p') B(x
o/2
; n, p')

87
Example 8.13
A plastics manufacturer has developed a new type of
plastic trash can and proposes to sell them with an
unconditional 6-year warranty.

To see whether this is economically feasible, 20 prototype
cans are subjected to an accelerated life test to simulate 6
years of use.

The proposed warranty will be modified only if the sample
data strongly suggests that fewer than 90% of such cans
would survive the 6-year period.
88
Example 8.13
Let p = proportion of cans that survive the accelerated test.

Test hypotheses H
0
: p = 0.9 vs H
a
: p < 0.9 for o=0.05

The smallest c satisfying B(c; 20, 0.9) s 0.05 is c = 15.

x
o
= x
0.05
= 15.

Reject H
0
if x s 15.

Remark P(type I error) = B(15; 20, 0.9) = 0.043 < .
contd
89
Example 8.13
Test conclusion

If the accelerated test results in x 14, H
0
would be
rejected in favor of H
a
, necessitating a modification of the
proposed warranty.

On the other hand, if the accelerated test results in x 15,
then H
0
cannot be rejected, and no modification necessary.

contd
90
Example 8.13
Find if p = p' = 0.8 (p 0.9)

|(0.8) = 1 B(x
o
; n, p')
= 1 |(15; 20, 0.8)
= 1 0.370
= 0.630

When p = 0.8, 63% of all samples consisting of n = 20
cans would result in H
0
being incorrectly not rejected.

This error probability is high because 20 is a small sample
size and p' = 0.8 is close to the null value p
0
= 0.9.

contd
91
Exercise Problem 38
A battery maker randomly tested 100 nickel plates and
found 14 have blistered.

a. Does this provide compelling evidence for concluding
that more than 10% plates blister? State and test
appropriate hypotheses using = 0.05. In reaching your
conclusion, what type of error might you have committed?

b. For the test in part (a), (0.15) = ?
If n = 200, (0.15) = ?

c. What n value ensures (0.15) = 0.1 for test in part (a)?
92
Exercise Problem 38
a. 1. Hypotheses H
0
: p = 0.1 vs H
a
: p > 0.1 n = 100
np
0
= 10, and n(1-p
0
) = 90 Large sample size

2. Compute z = (14/100 0.15)/[0.1(10.1)/100] = 1.33

3. z

= z
0.05
= 1.645

4. Do not reject H
0
as z < 1.645.

Data does not provide compelling evidence do conclude
that more than 10% plates blister.
contd
93
Exercise Problem 38
b. (0.15)
= [(0.10.15+1.645(0.10.9/100))/(0.150.85/100)]
= (0.02) = 0.4920

For n = 200, (0.15)
= [(0.10.15+1.645(0.10.9/200))/(0.150.85/200)]
= (0.60) = 0.2743

c. z

= 1.645, and z

=1.28


Use n = 362.
contd
4 . 361 01 . 19
1 . 0 15 . 0
85 . 0 15 . 0 28 . 1 9 . 0 1 . 0 645 . 1
2
2
= =
|
|
.
|

\
|

+
= n
94
Exercise Problem 45
A firm developed a new faucet.
p = (a faucet develops a leak within 2 years in normal use)
New faucets be made unless p is too large, with p = 0.1 as
borderline.
Test n new faucets, X = # of faucets that leak.
Management Decision:
If p = 0.1, P(not making new faucets) 0.1
If p = 0.3, P(making new faucets) 0.1

a. Can n = 10 be used?
b. Can n = 20 be used?
c. Can n = 30 be used?
contd
95
Exercise Problem 45
Hypotheses H
0
: p = 0.1 vs H
a
: p > 0.1
n = 10, 20, or 25 np
0
< 10 Small sample size
Use binomial distribution!
Rejection region has the form R = {c, c+1, , n}.

a. For n = 10, c = 3.Then
= 1 B(2; 10, 0.1) = 0.07 < 0.1 OK
(0.3) = B(2; 10, 0.3) = 0.383 > 0.1 Not OK
n = 10 is too small.
b. Can n = 20 be used?
c. Can n = 30 be used?
96
Exercise Problem 45
b. For n = 20, c = 5.Then
= 1 B(4; 20, 0.1) = 0.043 < 0.1 OK
(0.3) = B(4; 20, 0.3) = 0.238 > 0.1 Not OK
n = 20 is also too small.

c. For n = 25, c = 5.Then
= 1 B(4; 25, 0.1) = 0.098 < 0.1 OK
(0.3) = B(4; 25, 0.3) = 0.098 < 0.1 OK
n = 25 can be used.

contd
97
Section Summary
Concepts Discussed

Large-sample z test for a population proportion
- Rejection Criteria
- Computation of type II error
- Determination of a proper sample size n
Small-sample test for a population proportion
- Rejection Criteria
- Computation of type II error



98
8.4
P-Values
99
P-Values
For all the hypothesis testing, the rejection criteria are
functions of the significance level o.

Can a conclusion of a hypothesis testing be made
without being selected first?

Yes! It is done based on calculation of a P-value.
100
P-Values
Decision rule based on the P-value

For any significance level o,

(i) reject H
0
if P-value s o, or
(ii) do not reject H
0
if P-value > o.

If the P-value exceeds the chosen significance level ,
the null hypothesis H
0
cannot be rejected at level .

But if the P-value o, then there is enough evidence
to justify rejecting H
0
.


101
P-Values
Proposition

The P-value is the smallest significance level o at which the
null hypothesis can be rejected.



How to compute the P-values?


102
P-Values for z Tests
For a z test, the P-values are computed as follows.





103
Example 8.17
The target thickness for silicon wafers used in a certain
type of integrated circuit is 245 m.

A sample of 50 wafers is obtained and the thickness of
each one is determined, resulting in a sample mean
thickness of 246.18 m and a sample sd of 3.60 m.

Does this data suggest that true average wafer thickness is
something other than the target value?

104
Example 8.17
1. Test hypotheses H
0
: = 245 vs H
a
: 245

2. Calculate test statistic
z = (246.18 245)/(3.6/50) = 2.32

3. Determine P-value
P-value = 2[1 u(2.32)] = 0.0204

4. Conclusion
Using a significance level of 0.01, cannot reject H
0
,
since 0.0204 > 0.01.

At this significance level, there is insufficient evidence to
conclude that true mean thickness differs from target value.



contd
105
P-Values for t Tests
Recall Case III in Section 8.2, test statistic

P-values are computed as follows.

for an upper-tailed t test
for a lower-tailed t test
for a two-tailed t test


Use Appendix Table A.8 to find P-value for a t test.





n s
x
t
/
0

=

= >
= >
= >
=
) 1 ( 2
) 1 ( 1
) 1 (
n df t T P
n df t T P
n df t T P
value P
106
Example 8.18 (Example 8.9 contd)
Test H
0
: = 4 vs H
a
: 4
based on a sample of n = 5 observations from a normal
population distribution.

Test statistic t = 0.594 ~ 0.6. df = 5 1 = 4.

In Appendix Table A.8, mark the 4 df column & the 0.6 row.
The entry at the intersection is 0.290.
P(T > 0.6df = 4) = 0.29

For a two-tailed t test, P-value ~ 2(0.29) = 0.580.

This P-value > any reasonable o (0.01, 0.05, or 0.10).
No reason to reject the null hypothesis H
0
.
107
Exercise Problem 52
= true mean reflectometer reading of a new paint
Assume reflectometer reading is normally distributed.

Test hypotheses H
0
: = 20 vs H
a
: > 20

What conclusion is appropriate for the following?

a. n = 15, t = 3.2, = 0.05

b. n = 9, t = 1.8, = 0.01

c. n = 24, t = 0.2
108
Exercise Problem 52
a. df = 14, P-value = P(T 3.2df=14) = 0.003.
= 0.05 > P-value Reject H
0
.

b. df = 8, P-value = P(T 1.8df=8) = 0.055.
= 0.01 < P-value Do not reject H
0
.

c. df = 23, P-value = P(T 0.2df=23) = 0.578.
Do not reject H
0
at any reasonable significant level (<0.578).
109
Exercise Problem 58
A sample of n=30 on amount of organic matter in soil obtained
Sample mean = 2.481 Sample sd = 1.616

Test hypotheses H
0
: = 3 vs H
a
: 3 = 0.1

Assuming normality, we use t test.
t = (2.4813)/(1.616/30) = 1.759
P-value = 2P(T > 1.759df = 29) = 2(0.041) = 0.082
= 0.1 > P-value, reject H
0
.
True mean organic matter is something other than 3%.

For = 0.05, we would not have rejected H
0
.
110
Section Summary
Concepts Discussed

P-values
Use of P-values to draw conclusions for hypothesis tests
Compute P-values for a z test
Compute P-values for a t test
111
Test on
2
& of a Normal Distribution
A random sample of size n from a normal distribution

3 statistical hypothesis testing:

a. Upper-tailed Test H
0
:
2
=
0
2
vs H
a
:
2
>
0
2

b. Lower-tailed Test H
0
:
2
=
0
2
vs H
a
:
2
<
0
2

c. Two-tailed Test H
0
:
2
=
0
2
vs H
a
:
2

0
2


Equivalent hypothesis testing:

a. Upper-tailed Test H
0
: =
0
vs H
a
: >
0

b. Lower-tailed Test H
0
: =
0
vs H
a
: <
0

c. Two-tailed Test H
0
: =
0
vs H
a
:
0



112
Test on
2
& of a Normal Distribution
Null hypothesis: H
0
:
2
=
0
2



Test statistic:

Alternative Hypothesis Rejection Criteria
H
a
:
2
>
0
2

0
2
>
2
o, n-1
(upper-tailed)

H
a
:
2
<
0
2

0
2

2
1-, n-1
(lower-tailed)

H
a
:
2

0
2

0
2
>
2
o/2, n-1
or
0
2

2
1-/2, n-1
(two-tailed)


2
0
2
2
0
) 1 (
o
_
s n
=
113
Test on
2
& of a Normal Distribution
Compute P-values

Null hypothesis: H
0
:
2
=
0
2



Test statistic:

Alternative Hypothesis P-value
H
a
:
2
>
0
2
P(
2
>
0
2
df = n1)

H
a
:
2
<
0
2

P(
2

0
2
df = n1)

H
a
:
2

0
2
2P(
2
>
0
2
n1 df), or 2P(
2

0
2
n1 df)

Reject H
0
at significant level , if P-value.


2
0
2
2
0
) 1 (
o
_
s n
=
114
Test on
2
& of a Normal Distribution
Example
An automatic filling machine to fill bottles with liquid detergent.
A sample of n=20 yields s
2
= 0.0153 (liquid ounces)
2
.

If > 0.01, an unacceptable proportion of bottles will be
underfilled or overfilled.

Is there evidence in the data to suggest that the manufacturer
has a problem with underfilled or overfilled bottles?

Use = 0.05, and assume the fill volume is a normal rv.
115
Test on
2
& of a Normal Distribution
Solution

1. Test H
0
:
2
= 0.01 (=
0
2
) vs H
0
:
2
> 0.01


2. Compute

3. Determine
2
o, n-1
=
2
0.05, 19
= 30.14

4. Conclusion: Can not reject H
0
, as
0
2
< 30.14.
There is no strong evidence that the variance of fill
volume exceeds 0.01 (liquid ounces)
2
.
07 . 29
01 . 0
) 0153 . 0 )( 1 20 (
2
0
=

= _
116
Test on
2
& of a Normal Distribution
The P-value of this statistical hypothesis test is

P-value = P(
2
> 29.07df = 19) = 0.0649

Again, we cannot reject H
0
at 95% conficence level, since
P-value > = 0.05.

117
Goodness-of-Fit Test
So far we have discussed testing hypotheses for some
parameters of a given distribution.

But we also need to test hypotheses for a population
distribution itself.

Example H
0
: The population distribution is normal vs
H
a
: The population distribution is not normal.

We have learned to use a probability plot to test such
hypotheses. But such a conclusion is subjective.

We now present a formal goodness-of-fit test procedure,
based on a sample of size n & the chi-square distribution.
118
Goodness-of-Fit Test
Arrange the n observations in a frequency histogram with k
class intervals.
O
i
= observed frequency in class interval i (= 1, 2, , k).
E
i
= expected frequency in class interval i, computed from
the hypothesized probability distribution.

If H
0
is true, O
i
and E
i
should be roughly equal to each other.

Test statistic

Rejection Criterion: Reject H
0
if
0
2
>
2
o, k-p-1
with p = # of
parameters in the hypothesized probability distribution.

=
k
i
i
i i
E
E O
1
2
2
0
) (
_
119
Goodness-of-Fit Test
The P-value of this statistical hypothesis test

P-value = P(
2
>
0
2
df = kp1).

Reject H
0
at 100(1)% confidence level for any P-value.

120
Goodness-of-Fit Test
Example A Poisson distribution
# of defects in printed circuit boards is hypothesized to
follow a Poisson distribution.
A sample of 60 PCBs is presented below

# of Defects Observed Frequency O
i

0 32
1 15
2 9
3 4

Test H
0
: Defect has a Poisson distribution
vs H
a
: Defect does not has a Poisson distribution.
121
Goodness-of-Fit Test
Solution

Use the sample average (0.75) to estimate the mean # of
defects per board.

From the Poisson distribution with = 0.75, the following
probabilities and expected frequencies can be computed.

# of defects Probability Expected Frequency E
i

0 0.472 28.32
1 0.354 21.24
2 0.133 7.98
3 or more 0.041 2.46
122
Goodness-of-Fit Test
Remark If the expected frequency in any cell < 3, combine
the cell with its adjacent cell.

The expected frequency in the last cell < 3, combine the last
two cells.

# of defects O
i
E
i

0 32 28.32
1 15 21.24
2 or more 13 11.44

k = 3, p = 1. df = 3 1 1 = 1.
123
Goodness-of-Fit Test
1. Compute test statistic:



2. Use = 0.05. Then

3. Conclusion: Cannot reject H
0
, since
0
2
< 3.84.

It is reasonable to assume that # of defects in PSBs has
a Poisson distribution.

P-value = P(
2
> 2.94

df = 1) = 0.0864.

Again, cannot reject H
0
, since P-value > = 0.05.

94 . 2
44 . 10
) 44 . 10 13 (
24 . 21
) 24 . 21 15 (
32 . 28
) 32 . 28 32 (
2 2 2
2
0
=

= _
. 84 . 3
2
1 , 05 . 0
2
1 ,
= =

_ _
o p k