You are on page 1of 119

Chapter 10

One- and Two-Sample Test of Hypotheses

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-1

Hypothesis Testing Content

Formulate null and alternative hypotheses and


decision rules

Type I and Type II errors


Single Sample: Testing Population Mean,
Two Sample: Testing Difference two means
Tests on Proportion, p
Tests on Variance, 2
Goodness-of-Fit Test
Test for Independence

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-2

What is a Hypothesis?
A hypothesis is a claim
(assumption) about a
population parameter:
population mean
Example: The mean monthly cell phone bill
of this city is = $42

population proportion
Example: The proportion of adults in this
city with cell phones is p = .68
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-3

The Null Hypothesis, H0


States the assumption (numerical) to be
tested
Example: The average number of TV sets in
H0 : ) 3
homes is equal to three (

Is always about a population parameter,


not about a sample statistic
H0 : 3
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

H0 : X 3
Chap 10-4

The Null Hypothesis, H0


(continued)

Begin with the assumption that the null


hypothesis is true
Similar to the notion of innocent until
proven guilty
Refers to the status quo
Always contains = , or sign
May or may not be rejected

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-5

The Alternative Hypothesis, H1


Is the opposite of the null hypothesis
e.g., The average number of TV sets in homes
is not equal to 3 ( H1: 3 )

Challenges the status quo


Never contains the = , or sign
May or may not be proven
Is generally the hypothesis that the
researcher is trying to prove

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-6

Hypothesis Testing Process


Claim: the
population
mean age is 50.
(Null Hypothesis:
H0: = 50 )

Population

Is X 20 likely if = 50?
If not likely,
REJECT
Null Hypothesis

Suppose
the sample
mean age
is 20: X = 20

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Now select a
random sample

Sample

Reason for Rejecting H0


Sampling Distribution of X

20

If it is unlikely that
we would get a
sample mean of
this value ...

= 50
If H0 is true

... if in fact this were


the population mean

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

... then we
reject the null
hypothesis that
= 50.
Chap 10-8

Level of Significance,
Defines the unlikely values of the sample
statistic if the null hypothesis is true
Defines rejection region of the sampling
distribution
Is designated by , (level of significance)
Typical values are .01, .05, or .10
Is selected by the researcher at the beginning
Provides the critical value(s) of the test
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-9

Level of Significance
and the Rejection Region
Level of significance =

H0: = 3
H1: 3
H0: 3
H1: > 3
H0: 3
H1: < 3

/2
Two-tail test

/2

Represents
critical value
Rejection
region is
shaded

Upper-tail test

Lower-tail test

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

0
Chap 10-10

Errors in Making Decisions


Type I Error
Reject a true null hypothesis
Considered a serious type of error
The probability of Type I Error is
Called level of significance of the test
Set by researcher in advance

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-11

Errors in Making Decisions


(continued)

Type II Error
Fail to reject a false null hypothesis
The probability of Type II Error is

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-12

Outcomes and Probabilities


Possible Hypothesis Test Outcomes

Decision
Key:
Outcome
(Probability)

Actual
Situation
H0 True

H0 False

Do Not
Reject
H0

No error
(1 - )

Type II Error
()

Reject
H0

Type I Error
()

No Error
(1-)

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-13

Type I & II Error Relationship


Type I and Type II errors can not happen at
the same time

Type I error can only occur if H0 is true

Type II error can only occur if H0 is false


If Type I error probability ( )

, then

Type II error probability ( )


Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-14

Factors Affecting Type II Error


All else equal,

when the difference between
hypothesized parameter and its true value

when

when

when

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-15

Review: 10 Steps in
Hypothesis Testing
1. State the null hypothesis, H0
2. State the alternative hypotheses, H1
3. Choose the level of significance,
4. Choose the sample size, n
5. Determine the appropriate statistical
technique and the test statistic to use
6. Find the critical values and determine the
rejection region(s)
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-16

Review: 10 Steps in
Hypothesis Testing
7. Collect data and compute the test statistic
from the sample result
8. Compare the test statistic to the critical
value to determine whether the test statistics
falls in the region of rejection
9. Make the statistical decision: Reject H0 if the
test statistic falls in the rejection region
10. Express the decision in the context of the
problem
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-17

Hypothesis Tests for the Mean


Hypothesis
Tests for
Known

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Unknown

Chap 10-18

10.5 Single Sample: Test of Hypothesis


for Single Mean ( Known)
Convert sample statistic ( X ) to a Z test statistic
Hypothesis
Tests for
Known

Unknown

The test statistic is:

X
Z

n
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-19

Critical Value
Approach to Testing
For two tailed test for the mean, known:
Convert sample statistic ( X) to test statistic (Z
statistic )
Determine the critical Z values for a specified
level of significance from a table or computer
Decision Rule: If the test statistic falls in the
rejection region, reject H0 ; otherwise do not
reject H0
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-20

Hypothesis Testing Example


Test the claim that the true mean # of TV
sets in homes is equal to 3.
(Assume = 0.8)
1-2. State the appropriate null and alternative
hypotheses
H0: = 3
H1: 3 (This is a two tailed test)
3. Specify the desired level of significance
Suppose that = .05 is chosen for this test
4. Choose a sample size
Suppose a sample of size n = 100 is selected
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-21

Hypothesis Testing Example


(continued)

5. Determine the appropriate technique


is known so this is a Z test
6. Set up the critical values
For = .05 the critical Z values are 1.96
7. Collect the data and compute the test statistic
Suppose the sample results are
n = 100, X = 2.84 ( = 0.8 is assumed known)
So the test statistic is:
Z

X
2.84 3
.16

2.0

0.8
.08
n
100

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-22

Hypothesis Testing Example


(continued)

8. Is the test statistic in the rejection region?


= .05/2

Reject H0 if
Z < -1.96 or
Z > 1.96;
otherwise
do not
reject H0

Reject H0

-Z= -1.96

= .05/2

Do not reject H0

Reject H0

+Z= +1.96

Here, Z = -2.0 < -1.96, so the


test statistic is in the rejection
region

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-23

Hypothesis Testing Example


(continued)

9-10. Reach a decision and interpret the result


= .05/2

Reject H0

-Z= -1.96

= .05/2

Do not reject H0

Reject H0

+Z= +1.96

-2.0

Since Z = -2.0 < -1.96, we reject the null hypothesis


and conclude that there is sufficient evidence that the
mean number of TVs in US homes is not equal to 3
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-24

p-Value Approach to Testing


p-value: Probability of obtaining a test
statistic more extreme ( or ) than the
observed sample value given H0 is true
Also called observed level of significance
Smallest value of for which H0 can be
rejected

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-25

p-Value Approach to Testing


(continued)

Convert Sample Statistic (e.g., X ) to Test


Statistic (e.g., Z statistic )
Obtain the p-value from a table or computer
Compare the p-value with
If p-value < , reject H0
If p-value , do not reject H0

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-26

p-Value Example
Example: How likely is it to see a sample mean of
2.84 (or something further from the mean, in either
direction) if the true mean is = 3.0?
X = 2.84 is translated
to a Z score of Z = -2.0
P(Z 2.0) .0228
P(Z 2.0) .0228

/2 = .025

/2 = .025

.0228

.0228

p-value
=.0228 + .0228 = .0456

-1.96
-2.0

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

1.96
2.0

Z
Chap 10-27

p-Value Example
Compare the p-value with

(continued)

If p-value < , reject H0


If p-value , do not reject H0
Here: p-value = .0456
= .05
Since .0456 < .05, we
reject the null
hypothesis

/2 = .025

/2 = .025

.0228

.0228

-1.96
-2.0
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

1.96
2.0

Z
Chap 10-28

Connection to Confidence Intervals


For X = 2.84, = 0.8 and n = 100, the 95%
confidence interval is:
0.8
2.84 - (1.96)
to
100

0.8
2.84 (1.96)
100

2.6832 2.9968
Since this interval does not contain the hypothesized
mean (3.0), we reject the null hypothesis at = .05
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Two-Tail Tests
There are two
cutoff values
(critical values),
defining the
regions of
rejection

H0: = 3
H1 :
3

/2

/2
X

3
Reject H0

-Z

Lower
critical
value
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Do not reject H0

Reject H0

+Z

Upper
critical
value
Chap 10-30

One-Tail Tests
In many cases, the alternative hypothesis
focuses on a particular direction
H0: 3
H1: < 3
H0: 3
H1: > 3

This is a lower-tail test since the


alternative hypothesis is focused on
the lower tail below the mean of 3
This is an upper-tail test since the
alternative hypothesis is focused on
the upper tail above the mean of 3

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-31

Lower-Tail Tests
There is only one
critical value, since
the rejection area is
in only one tail

H0: 3
H1: < 3

Reject H0

-Z

Do not reject H0

Z
X

Critical value

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-32

Upper-Tail Tests
There is only one
critical value, since
the rejection area is
in only one tail

H0: 3
H1: > 3

Do not reject H0

Reject H0

Critical value
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-33

Example: Upper-Tail Z Test


for Mean ( Known)
A phone industry manager thinks that
customer monthly cell phone bill have
increased, and now average over $52 per
month. The company wishes to test this
claim. (Assume = 10 is known)
Form hypothesis test:
H0: 52 the average is not over $52 per month
H1: > 52

the average is greater than $52 per month


(i.e., sufficient evidence exists to support the
managers claim)

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-34

Example: Find Rejection Region


(continued)

Suppose that = .10 is chosen for this test


Find the rejection region:

Reject H0

= .10

Do not reject H0

1.28

Reject H0

Reject H0 if Z > 1.28


Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-35

Review:
One-Tail Critical Value
What is Z given = 0.10?

.90

.10

= .10
.90

Standard Normal
Distribution Table (Portion)

0 1.28

.07

.08

.09

1.1 .8790 .8810 .8830


1.2 .8980 .8997 .9015
1.3 .9147 .9162 .9177

Critical Value
= 1.28
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-36

Example: Test Statistic


(continued)

Obtain sample and compute the test statistic


Suppose a sample is taken with the following
results: n = 64, X = 53.1 (=10 was assumed known)
Then the test statistic is:

X
53.1 52
Z

0.88

10
n
64
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-37

Example: Decision
(continued)

Reach a decision and interpret the result:


Reject H0

= .10

Do not reject H0

1.28
0
Z = .88

Reject H0

Do not reject H0 since Z = 0.88 1.28


i.e.: there is not sufficient evidence that the
mean bill is over $52
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-38

p -Value Solution
Calculate the p-value and compare to

(continued)

(assuming that = 52.0)

p-value = .1894
Reject H0
= .10
0
Do not reject H0

1.28
Z = .88

Reject H0

P( X 53.1)
53.1 52.0

P Z

10/ 64

P(Z 0.88) 1 .8106


.1894

Do not reject H0 since p-value = .1894 > = .10


Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-39

10.7 Single Sample: Test of Hypothesis


for Single Mean ( Unknown)
Convert sample statistic ( X ) to a t test statistic
Hypothesis
Tests for
Known

Unknown
The test statistic is:

t n-1

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

S
n
Chap 10-40

Example: Two-Tail Test ( Unknown)


The average cost of a
hotel room in New York
is said to be $168 per
night. A random sample
of 25 hotels resulted in
X = $172.50 and
S = $15.40. Test at the
= 0.05 level.

H0: = 168
H1:
168

(Assume the population distribution is normal)


Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-41

Solution: Two-Tail Test


H0: = 168
H1:
168
= 0.05

/2=.025

Reject H0

-t n-1,/2
-2.0639

n = 25
is unknown, so
use a t statistic
Critical Value:
t24 = 2.0639

t n1

/2=.025

Do not reject H0

1.46

Reject H0

t n-1,/2
2.0639

X
172.50 168

1.46
S
15.40
n
25

Do not reject H0: not sufficient evidence that


true mean cost is different than $168

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-42

Connection to Confidence Intervals


For X = 172.5, S = 15.40 and n = 25, the 95%
confidence interval is:
172.5 - (2.0639) 15.4/ 25

to 172.5 + (2.0639) 15.4/ 25

166.14 178.86
Since this interval contains the Hypothesized mean (168),
we do not reject the null hypothesis at = .05
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

10.8 Two Samples: Tests on Two


Means
Population means,
independent
samples

1 and 2 known
1 and 2 unknown

Goal: Test hypotheses or form


a confidence interval for the
difference between two
population means, 1 2
The point estimate for the
difference is

X1 X2
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-44

Independent Samples
Population means,
independent
samples

Different data sources


Unrelated
Independent
Sample selected from one
population has no effect on
the sample selected from
the other population

1 and 2 known
1 and 2 unknown

Use the difference between 2


sample means
Use Z test or pooled variance
t test

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-45

Difference Between Two Means


Population means,
independent
samples

1 and 2 known

Use a Z test statistic

1 and 2 unknown

Use S to estimate unknown


, use a t test statistic and
pooled standard deviation

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-46

1 and 2 Known
Population means,
independent
samples
1 and 2 known
1 and 2 unknown

Assumptions:

Samples are randomly and


independently drawn
population distributions are
normal or both sample sizes
are 30
Population standard
deviations are known

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-47

1 and 2 Known
(continued)

Population means,
independent
samples
1 and 2 known

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

and the standard error of


X1 X2 is

1 and 2 unknown

X1 X2
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

2
1

n1
n2

Chap 10-48

1 and 2 Known
(continued)

Population means,
independent
samples
1 and 2 known

The test statistic for


1 2 is:

X
Z

1 and 2 unknown

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

X 2 1 2
2
1

n1
n2

Chap 10-49

Hypothesis Tests for


Two Population Means
Two Population Means, Independent Samples
Lower-tail test:

Upper-tail test:

Two-tail test:

H0: 1 2
H1: 1 < 2

H0: 1 2
H1: 1 > 2

H0: 1 = 2
H1: 1 2

i.e.,

i.e.,

i.e.,

H0: 1 2 0
H1: 1 2 < 0

H0: 1 2 0
H1: 1 2 > 0

H0: 1 2 = 0
H1: 1 2 0

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-50

Hypothesis tests for 1 2


Two Population Means, Independent Samples
Lower-tail test:

Upper-tail test:

Two-tail test:

H0: 1 2 0
H1: 1 2 < 0

H0: 1 2 0
H1: 1 2 > 0

H0: 1 2 = 0
H1: 1 2 0

-z

Reject H0 if Z < -Z

z
Reject H0 if Z > Z

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

/2
-z/2

/2
z/2

Reject H0 if Z < -Z/2


or Z > Z/2
Chap 10-51

1 and 2 Unknown
Assumptions:

Population means,
independent
samples

Samples are randomly and


independently drawn

1 and 2 known
1 and 2 unknown

Populations are normally


distributed or both sample
sizes are at least 30
Population variances are
unknown but assumed equal

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-52

1 and 2 Unknown
(continued)

Forming interval
estimates:

Population means,
independent
samples
1 and 2 known
1 and 2 unknown

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 (n1 + n2 2) degrees
of freedom

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-53

1 and 2 Unknown
(continued)

Population means,
independent
samples

The pooled standard


deviation is

1 and 2 known
1 and 2 unknown

Sp

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

n1 1 S12 n2 1 S2 2
(n1 1) (n2 1)

Chap 10-54

1 and 2 Unknown
(continued)

The test statistic for


1 2 is:

Population means,
independent
samples

X
t

1 and 2 known
1 and 2 unknown

X 2 1 2
1 1
S

n1 n2
2
p

Where t has (n1 + n2 2) d.f.,


and

S
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

2
p

2
2

n1 1 S1 n2 1 S 2

(n1 1) (n2 1)

Chap 10-55

Pooled Sp t-Test: Example


You are a financial analyst for a brokerage firm. Is there
a difference in dividend yield between stocks listed on the
NYSE & NASDAQ? You collect the following data:

NYSE
Number
21
Sample mean
3.27
Sample std dev 1.30

NASDAQ
25
2.53
1.16

Assuming both populations are


approximately normal with
equal variances, is
there a difference in average
yield ( = 0.05)?
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-56

Calculating the Test Statistic


The test statistic is:

X
t

X 2 1 2
1 1
S

n1 n2
2
p

3.27 2.53 0
1
1
1.5021

21 25

2
2
2
2

1
S

1
S
21

1
1.30

25

1
1.16
1
2
2
S2 1

(n1 1) (n2 1)

(21 - 1) (25 1)

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

2.040

1.5021

Chap 10-57

Solution
H0: 1 - 2 = 0 i.e. (1 = 2)

Reject H0

Reject H0

H1: 1 - 2 0 i.e. (1 2)
= 0.05
df = 21 + 25 - 2 = 44
Critical Values: t = 2.0154

.025

-2.0154

.025

0 2.0154

2.040

Decision:
Test Statistic:
3.27 2.53
t
2.040 Reject H0 at = 0.05
1
1
1.5021

Conclusion:

21 25

There is evidence of a
difference in means.

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-58

Paired Observations
Tests Means of 2 Related Populations
Related
samples

Paired or matched samples


Repeated measures (before/after)
Use difference between paired values:

D = X1 - X2
Eliminates Variation Among Subjects
Assumptions:
Both Populations Are Normally Distributed
Or, if Not Normal, use large samples

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-59

Mean Difference, D Known


The ith paired difference is Di , where
Related
samples

Di = X1i - X2i
The point estimate for
the population mean
paired difference is D :

D
i 1

Suppose the population


standard deviation of the
difference scores, D, is known
n is the number of pairs in the paired sample
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-60

Mean Difference, D Known


(continued)

Paired
samples

The test statistic for the mean


difference is a Z value:

D D
Z
D
n
Where
D = hypothesized mean difference
D = population standard dev. of differences
n = the sample size (number of pairs)

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-61

Confidence Interval, D Known


Paired
samples

The confidence interval for D is

D
DZ
n
Where
n = the sample size
(number of pairs in the paired sample)

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-62

Mean Difference, D Unknown


Related
samples

If D is unknown, we can estimate the


unknown population standard deviation
with a sample standard deviation:
The sample standard
deviation is

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

SD

2
(D

D
)
i
i1

n 1

Chap 10-63

Mean Difference, D Unknown


(continued)

Paired
samples

The test statistic for D is now a


t statistic, with n-1 d.f.:

D D
t
SD
n
n

Where t has n - 1 d.f.


and SD is:
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

SD

(D
i 1

D)

n 1
Chap 10-64

Confidence Interval, D Unknown


Paired
samples

The confidence interval for D is

SD
D t n1
n
n

where

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

SD

(D D)
i1

n 1

Chap 10-65

Hypothesis Testing for


Mean Difference, D Unknown
Paired Samples
Lower-tail test:

Upper-tail test:

Two-tail test:

H0: D 0
H1: D < 0

H0: D 0
H1: D > 0

H0: D = 0
H1: D 0

-t

Reject H0 if t < -t

t
Reject H0 if t > t
Where t has n - 1 d.f.

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

/2
-t/2

/2
t/2

Reject H0 if t < -t
or t > t
Chap 10-66

Paired Samples Example


Assume you send your salespeople to a customer
service training workshop. Is the training effective?
You collect the following data:
Number of Complaints:
(2) - (1)
Salesperson Before (1) After (2)
Difference, Di
C.B.
T.F.
M.H.
R.K.
M.O.

6
20
3
0
4

4
6
2
0
0

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

- 2
-14
- 1
0
- 4
-21

D =

Di
n

= -4.2
SD

(D D)

n 1

5.67
Chap 10-67

Paired Samples: Solution


Has the training made a difference in the number of

complaints (at the 0.01 level)?


H0: D = 0
H1: D 0
= .01

D = - 4.2

Critical Value = 4.604


d.f. = n - 1 = 4

SD / n

4.2 0
5.67/ 5

Reject

/2

/2

- 4.604

4.604

- 1.66

Decision: Do not reject H0


(t stat is not in the reject region)

Test Statistic:

D D

Reject

1.66

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Conclusion: There is not a


significant change in the
number of complaints.
Chap 10-68

10.11 One Sample: Test on Proportion


Involves categorical variables
Two possible outcomes
Success (possesses a certain characteristic)
Failure (does not possesses that characteristic)

Fraction or proportion of the population in the


success category is denoted by p

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-69

Proportions
(continued)

Sample proportion in the success category is


denoted by ps
X number of successes in sample
ps n
sample size

When both np and n(1-p) are at least 5, ps


can be approximated by a normal distribution
with mean and standard deviation
p(1 p)

p s p
ps
n
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-70

Hypothesis Tests for Proportions


The sampling
distribution of ps is
approximately
normal, so the test
statistic is a Z value:

ps p
p(1 p)
n

Hypothesis
Tests for p
np 5
and
n(1-p) 5

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

np < 5
or
n(1-p) < 5
-Binomial dist., if p is common.
-Poisson dist., If p is very close
to 0 or 1.
Chap 10-71

Example: Z Test for Proportion


A marketing company
claims that it receives
8% responses from its
mailing. To test this
claim, a random sample
of 500 were surveyed
with 25 responses. Test
at the = .05
significance level.

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Check:
n p = (500)(.08) = 40
n(1-p) = (500)(.92) = 460

Chap 10-72

Z Test for Proportion: Solution


Test Statistic:

H0: p = .08
H1: p .
08= .05

n = 500, ps = .05

ps p

p(1 p)
n

Decision:

Critical Values: 1.96


Reject

Reject

.025

.025
-1.96

1.96

.05 .08
2.47
.08(1 .08)
500

-2.47
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Reject H0 at = .05

Conclusion:
There is sufficient
evidence to reject the
companys claim of 8%
response rate.
Chap 10-73

p-Value Solution
(continued)

Calculate the p-value and compare to


(For a two sided test the p-value is always two sided)
Do not reject H0

Reject H0
/2 = .025

Reject H0

p-value = .0136:

/2 = .025

P(Z 2.47) P(Z 2.47)


.0068

.0068
-1.96

Z = -2.47

2(.0068) 0.0136

1.96
Z = 2.47

Reject H0 since p-value = .0136 < = .05


Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-74

10.12 Two Population Proportions


Population
proportions

Goal: test a hypothesis or form a


confidence interval for the difference
between two population proportions,
p1 p2
Assumptions:
n1p1 5 , n1(1-p1) 5
n2p2 5 , n2(1-p2) 5
The point estimate for
the difference is

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

ps1 ps2
Chap 10-75

Two Population Proportions


Population
proportions

Since we begin by assuming the null


hypothesis is true, we assume p1 = p2
and pool the two ps estimates
The pooled estimate for the
overall proportion is:

X1 X 2
p
n1 n2
where X1 and X2 are the numbers from
samples 1 and 2 with the characteristic of
interest
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-76

Two Population Proportions


(continued)

The test statistic for


p1 p2 is a Z statistic:

Population
proportions

p
Z

where

s1

p s2 p1 p 2

1 1
p (1 p)

n1 n2

X1 X 2
X
X
, p s1 1 , p s2 2
n1 n2
n1
n2

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-77

Hypothesis Tests for


Two Population Proportions
Population proportions
Lower-tail test:

Upper-tail test:

Two-tail test:

H0: p1 p2
H1: p1 < p2

H0: p1 p2
H1: p1 > p2

H0: p1 = p2
H1: p1 p2

i.e.,

i.e.,

i.e.,

H0: p1 p2 0
H1: p1 p2 < 0

H0: p1 p2 0
H1: p1 p2 > 0

H0: p1 p2 = 0
H1: p1 p2 0

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-78

Hypothesis Tests for


Two Population Proportions

(continued)

Population proportions
Lower-tail test:

Upper-tail test:

Two-tail test:

H0: p1 p2 0
H1: p1 p2 < 0

H0: p1 p2 0
H1: p1 p2 > 0

H0: p1 p2 = 0
H1: p1 p2 0

-z

Reject H0 if Z < -Z

z
Reject H0 if Z > Z

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

/2
-z/2

/2
z/2

Reject H0 if Z < -Z
or Z > Z
Chap 10-79

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

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-80

Example:
Two population Proportions

(continued)

The hypothesis test is:


H0: p1 p2 = 0 (the two proportions are equal)
H1: p1 p2 0 (there is a significant difference between proportions)
The sample proportions are:
Men:

ps1 = 36/72 = .50

Women:

ps2 = 31/50 = .62

The pooled estimate for the overall proportion is:

X1 X 2 36 31 67
p

.549
n1 n2
72 50 122
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-81

Example:
Two population Proportions

(continued)

The test statistic for p1 p2 is:


z

s1

p s2 p1 p 2
1 1

n1 n2

p (1 p)

.50 .62 0
1
1

72
50

Reject H0

Reject H0

.025

.025

-1.96
-1.31

1.31

.549 (1 .549)

Critical Values = 1.96


For = .05
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

1.96

Decision: Do not reject H0


Conclusion: There is not
significant evidence of a
difference in proportions
who will vote yes between
men and women.

Chap 10-82

10.12 Tests 0n Variances


The Chi-square test statistic is:
2
(
n

1
)
s
2

2
0

where:
o2 = value of 2 given by the null hypotheses.
n = sample size.

(Assumed: the null hypothesis Ho that the


population variance equals a spesified value o2
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-83

Decision Rule
The 2 test statistic approximately follows a chisquared distribution with one degree of freedom

Decision Rule:
If 2 > 2U, reject H0,
otherwise, do not
reject H0

Do not
reject H0

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Reject H0

2U
Chap 10-84

Two-Sample Tests for Variances


Tests for Two
Population
Variances
F test statistic

H0: 12 = 22
H1: 12 22

Two-tail test

H0: 12 22
H1: 12 < 22

Lower-tail test

H0: 12 22
H1: 12 > 22

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Upper-tail test

Chap 10-85

Hypothesis Tests for Variances


(continued)

Tests for Two


Population
Variances
F test statistic

The F test statistic is:


2
1
2
2

S
F
S

S12 = Variance of Sample 1

n1 - 1 = numerator degrees of freedom

S 22 = Variance of Sample 2
n2 - 1 = denominator degrees of freedom
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-86

The F Distribution
The F critical value is found from the F table
The are two appropriate degrees of freedom:
numerator and denominator

S12
F 2
S2

where

df1 = n1 1 ; df2 = n2 1

In the F table,
numerator degrees of freedom determine the column
denominator degrees of freedom determine the row

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-87

Finding the Rejection Region


H0: 12 22
H1: 12 < 22

/2

0
Reject
H0

FL

Do not
reject H0

Reject
H0

FU

Reject H0

FL

Do not
reject H0

FU

rejection
region for a
two-tail test is:

Do not
reject H0

/2

Reject H0 if F < FL

H0: 12 22
H1: 12 > 22
0

H0: 12 = 22
H1: 12 22

Reject H0

S12
F 2 FU
S2
S12
F 2 FL
S2

Reject H0 if F > FU
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-88

Finding the Rejection Region


(continued)
/2

H0: 12 = 22
H1: 12 22
/2

Reject
H0

To find the critical F values:


1. Find FU from the F table
for n1 1 numerator and
n2 1 denominator
degrees of freedom

FL

Do not
reject H0

FU

Reject H0

2. Find FL using the formula: FL

1
FU*

Where FU* is from the F table with


n2 1 numerator and n1 1
denominator degrees of freedom
(i.e., switch the d.f. from FU)

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-89

F Test: An Example
You are a financial analyst for a brokerage firm. You want
to compare dividend yields between stocks listed on the
NYSE & NASDAQ. You collect the following data :
NYSE
NASDAQ
Number
2125
Mean
3.272.53
Std dev
1.301.16
Is there a difference in the
variances between the
NYSE
& NASDAQ at the = 0.05 level?

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-90

F Test: Example Solution


Form the hypothesis test:
H0: 21 22 = 0 (there is no difference between variances)
H1: 21 22 0 (there is a difference between variances)
Find the F critical values for = .05:

FU:
Numerator:

FL:
Numerator:

n1 1 = 21 1 = 20 d.f.

Denominator:

n2 1 = 25 1 = 24 d.f.

Denominator:

n2 1 = 25 1 = 24 d.f.

FU = F.025, 20, 24 = 2.33

n1 1 = 21 1 = 20 d.f.

FL = 1/F.025, 24, 20 = 1/2.41


= .41

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-91

F Test: Example Solution


(continued)

The test statistic is:


2
1
2
2

H0: 12 = 22
H1: 12 22

S
1.30
F

1.256
2
S
1.16

/2 = .025
0

Reject H0

/2 = .025
Do not
reject H0

Reject H0

FU=2.33
F = 1.256 is not in the
FL=0.41
rejection region, so we do not
reject H0
Conclusion: There is not sufficient evidence
of a difference in variances at = .05
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-92

10.14 Goodness-of-Fit Test


The Chi-square test statistic is:
2
(
f

f
)
2 o e
fe
all cells

where:
fo = observed frequency in a particular cell
fe = expected frequency in a particular cell if H0 is true
2 for the 2 x 2 case has 1 degree of freedom
(Assumed: each cell in the contingency table has expected
frequency of at least 5)
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-93

Decision Rule
The 2 test statistic approximately follows a chisquared distribution with one degree of freedom

Decision Rule:
If 2 > 2U, reject H0,
otherwise, do not
reject H0

Do not
reject H0

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Reject H0

2U
Chap 10-94

Computing the Average Proportion


X1 X 2 X
The average
p

proportion is:
n1 n2
n
120 Females, 12
were left handed
180 Males, 24 were
left handed

Here:

12 24
36
p

0.12
120 180 300

i.e., the proportion of left handers overall is 12%

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-95

Finding Expected Frequencies


To obtain the expected frequency for left handed
females, multiply the average proportion left handed (p)
by the total number of females
To obtain the expected frequency for left handed males,
multiply the average proportion left handed (p) by the
total number of males
If the two proportions are equal, then
P(Left Handed | Female) = P(Left Handed | Male) = .12
i.e., we would expect (.12)(120) = 14.4 females to be left handed
(.12)(180) = 21.6 males to be left handed
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-96

Observed vs. Expected Frequencies

Hand Preference
Gender

Left

Right

Female

Observed = 12
Expected = 14.4

Observed = 108
Expected = 105.6

120

Male

Observed = 24
Expected = 21.6

Observed = 156
Expected = 158.4

180

36

264

300

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-97

Chi-Square Test Statistic


Hand Preference
Gender

Left

Right

Female

Observed = 12
Expected = 14.4

Observed = 108
Expected = 105.6

120

Male

Observed = 24
Expected = 21.6

Observed = 156
Expected = 158.4

180

36

264

300

The test statistic is:


( fo fe )2

fe
all cells
2

(12 14.4)2 (108 105.6)2 (24 21.6)2 (156 158.4)2

0.6848
14.4
105.6
21.6
158.4
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-98

Decision Rule
The test statistic is 2 0.6848 , U2 with 1 d.f. 3.841
Decision Rule:
If 2 > 3.841, reject H0,
otherwise, do not reject H0

Do not
reject H0

Reject H0

2U=3.841

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Here,
2 = 0.6848 < 2U = 3.841,
so we do not reject H0
and conclude that there is
not sufficient evidence
that the two proportions
are different at = .05
Chap 10-99

10.15 Test for Independence


Similar to the 2 test for equality of more than
two proportions, but extends the concept to
contingency tables with r rows and c columns
H0: The two categorical variables are independent
(i.e., there is no relationship between them)
H1: The two categorical variables are dependent
(i.e., there is a relationship between them)

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-100

2 Test of Independence
(continued)

The Chi-square test statistic is:


2
(
f

f
)
2 o e
fe
all cells

where:
fo = observed frequency in a particular cell of the r x c table
fe = expected frequency in a particular cell if H0 is true
2 for the r x c case has (r-1)(c-1) degrees of freedom
(Assumed: each cell in the contingency table has expected
frequency of at least 1)
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-101

Expected Cell Frequencies


Expected cell frequencies:

row total column total


fe
n
Where:
row total = sum of all frequencies in the row
column total = sum of all frequencies in the column
n = overall sample size

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-102

Decision Rule
The decision rule is
If 2 > 2U, reject H0,
otherwise, do not reject H0
Where 2U is from the chi-squared distribution
with (r 1)(c 1) degrees of freedom

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-103

Example
The meal plan selected by 200 students is shown below:
Number of meals per week
20/week 10/week
Class
Standing
Fresh.
24
32

none

Total

14

70

Soph.

22

26

12

60

Junior

10

14

30

Senior

14

16

10

40

Total

70

88

42

200

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-104

Example
(continued)

The hypothesis to be tested is:

H0: Meal plan and class standing are independent


(i.e., there is no relationship between them)
H1: Meal plan and class standing are dependent
(i.e., there is a relationship between them)

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-105

Example:
Expected Cell Frequencies

(continued)

Observed:
Number of meals
per week
Class
Standing

20/wk

10/wk

Expected cell
frequencies if H0 is true:

none
Total

Fresh.

24

32

14

70

Soph.

22

26

12

60

Junior

10

14

30

Senior

14

16

10

40

Class
Standing

Total

70

88

42

200

Fresh.

24.5

30.8

14.7

70

Soph.

21.0

26.4

12.6

60

Junior

10.5

13.2

6.3

30

Senior

14.0

17.6

8.4

40

70

88

42

200

Example for one cell:


fe

row total column total


n
30 70
10.5
200

Number of meals
per week

Total

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

20/wk

10/wk

none
Total

Chap 10-106

Example: The Test Statistic


(continued)

The test statistic value is:


2
(
f

f
)
2 o e
fe
all cells

(24 24.5)2 (32 30.8)2


(10 8.4)2

0.709
24.5
30.8
8. 4

2U = 12.592 for = .05 from the chi-squared


distribution with (4 1)(3 1) = 6 degrees of
freedom

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-107

Example:
Decision and Interpretation

(continued)

The test statistic is 2 0.709 , U2 with 6 d.f. 12.592


Decision Rule:
If 2 > 12.592, reject H0,
otherwise, do not reject H0

Do not
reject H0

Reject H0

2U=12.592

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Here,
2 = 0.709 < 2U = 12.592,
so do not reject H0
Conclusion: there is not
sufficient evidence that meal
plan and class standing are
related at = .05
Chap 10-108

10.17 Testing for Proportions


Extend the 2 test to the case with more than
two independent populations:
H 0: p 1 = p 2 = = p c
H1: Not all of the pj are equal (j = 1, 2, , c)

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-109

The Chi-Square Test Statistic


The Chi-square test statistic is:
2
(
f

f
)
2 o e
fe
all cells

where:
fo = observed frequency in a particular cell of the 2 x c table
fe = expected frequency in a particular cell if H0 is true
2 for the 2 x c case has (2-1)(c-1) = c - 1 degrees of freedom
(Assumed: each cell in the contingency table has expected
frequency of at least 1)
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-110

Computing the Overall Proportion


The overall
proportion is:

X1 X 2 Xc X
p

n1 n2 nc
n

Expected cell frequencies for the c categories


are calculated as in the 2 x 2 case, and the
decision rule is the same:
Decision Rule:
If 2 > 2U, reject H0,
otherwise, do not
reject H0

Where 2U is from the


chi-squared distribution
with c 1 degrees of
freedom

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-111

Using PHStat

Options

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-112

Sample PHStat Output

Input

Output

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-113

Two-Sample Tests in EXCEL


For independent samples:
Independent sample Z test with variances known:
Tools | data analysis | z-test: two sample for means

For paired samples (t test):


Tools | data analysis | t-test: paired two sample for means

For variances
F test for two variances:
Tools | data analysis | F-test: two sample for variances

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-114

Two-Sample Tests in PHStat

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-115

Sample PHStat Output

Input

Output

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-116

Sample PHStat Output


(continued)

Input

Output

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-117

Chapter Summary
Addressed hypothesis testing methodology
Performed Z Test for the mean ( known)
Discussed critical value and pvalue approaches to
hypothesis testing
Performed one-tail and two-tail tests
Performed t test for the mean ( unknown)
Performed Z test for the proportion

Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-118

Chapter Summary

Compared two independent samples


Performed Z test for the differences in two means
Performed pooled variance t test for the differences in two means
Formed confidence intervals for the differences between two means

Compared two related samples (paired samples)


Performed paired sample Z and t tests for the mean difference
Formed confidence intervals for the paired difference

Compared two population proportions


Formed confidence intervals for the difference between two population
proportions
Performed Z-test for two population proportions

Performed F tests for the difference between two population


variances
Used the F table to find F critical values
Walpole,Probability and Statistics for Engineers & Scientists, 8th e., Pearson Edu.

Chap 10-119

You might also like