Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
54 views

6 Hypothesis Testing

The document discusses hypothesis testing, which is used to determine whether sample data supports beliefs about a population. It covers the key concepts, including specifying the null and alternative hypotheses, determining the test statistic and rejection region, and calculating type I and type II errors. An example is provided to illustrate the hypothesis testing procedure for comparing a sample mean to a hypothesized population mean. The steps include specifying the hypotheses, determining the test statistic and rejection rules based on the significance level, calculating the test statistic value, and making a conclusion about whether to reject the null hypothesis.

Uploaded by

Faidatul Inayah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views

6 Hypothesis Testing

The document discusses hypothesis testing, which is used to determine whether sample data supports beliefs about a population. It covers the key concepts, including specifying the null and alternative hypotheses, determining the test statistic and rejection region, and calculating type I and type II errors. An example is provided to illustrate the hypothesis testing procedure for comparing a sample mean to a hypothesized population mean. The steps include specifying the hypotheses, determining the test statistic and rejection rules based on the significance level, calculating the test statistic value, and making a conclusion about whether to reject the null hypothesis.

Uploaded by

Faidatul Inayah
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

HYPOTHESIS TESTING

1 Dadan Kusnandar, Ph.D.

OBJECTIVES
When you have completed this topic, you
should be able to:
 Develop the hypothesis testing procedure as a
technique for decision making
 Determine the risks involved in making these
decisions based only upon sample information

1
CONCEPTUAL EMPHASIS
1. Basic concepts of hypothesis testing
2. One sample tests for means, proportions
and variance
3. Two sample tests for a mean
4. The paired difference test

Readings
• Berenson and Levine (1992) Chapters 11, 12 & 13.
• Kusnandar (2004) Chapter 6.
3

CONCEPTS OF HYPOTHESIS TESTING


The objective of hypothesis testing is to determine
whether or not the sample data support some
belief or hypothesis about the population
Examples:
 A company that has a 10% market share launches a
new advertising campaign. At the campaign’s
completion, the company wants to know whether the
results of a random sample indicate an increase in
market share
 A firm that produce fertilizer want s to know whether
a new type of fertilizer increases crop yields.
4

2
STRUCTURE OF HYPOTHESIS TESTING
 Null hypothesis
 Alternative hypothesis
 Test statistic
 Rejection region (critical region)

THE NULL HYPOTHESIS (H0) AND


THE ALTERNATIVE HYPOTHESIS (H1)

The purpose of hypothesis testing is to choose


between two conflicting hypotheses about the
possible value of a population parameter
The null hypothesis (H0) is an assumption
concerning the value of the population
parameter.
The alternative hypothesis (H1) specifies all
possible values of the population parameter
that are not specify in the null hypothesis

3
CRUCIAL THINGS ABOUT THE TWO
HYPOTHESES

 The null hypothesis always specify that the


parameter is equal to a single value
H0: θ = θ0
 The alternative hypothesis can be expressed in
one of the following:
 H1: θ ≠ θ0 → two sided alternative hypothesis
 H1: θ < θ0 → one sided alternative hypothesis
 H1: θ > θ0 → one sided alternative hypothesis

TEST STATISTIC AND REJECTION REGION


 Test statistic is the criterion upon which
we base our decision whether to reject or
not to reject the null hypothesis
 The test statistic is the point estimator of
the parameter being tested
 The rejection region is a range of values
such that, if the test statistic falls into
that range, we decide to reject the null
hypothesis
8

4
REJECTION REGION FOR
H0: θ = θ0 VS. H1: θ ≠ θ0

Rejection Rejection
region Nonrejection region
α region α
2 2
Critical θ0 Critical θ
value value 9

REJECTION REGION FOR


H0: θ = θ0 VS. H1: θ > θ0

Rejection
region
Nonrejection
α
region
θ0 Critical θ
value
10

5
REJECTION REGION FOR
H0: θ = θ0 VS. H1: θ < θ0

Rejection
region
Nonrejection
α region
Critical θ0 θ
value 11

TYPE I AND TYPE II ERRORS


 Type I error occurs if the null hypothesis
is rejected when in fact it is true.
The probability of a Type I error is
denoted by α, called as the level of
significance
 Type II error occurs if the null hypothesis
is not rejected when it is false.
The probability of a Type II error is
denoted by β. The complement (1 – β) is
called the power of a statistical test
12

6
RELATIONSHIP BETWEEN α AND β
Actual situation

Statistical H0 True H0 False


Decision
Type I error
Reject H0 Correct decision
(α)
Type II error
Do not reject H0 Correct decision
(β)

13

PROCEDURE OF HYPOTHESIS TESTING


1. Specify the null hypothesis and the alternative
hypothesis
2. Specify the test statistic
3. Specify α, and set up the rejection region
4. Calculate the value of the test statistic
5. Draw the conclusion: reject or do not reject H0

14

7
TEST OF HYPOTHESIS FOR THE MEAN, Σx
KNOWN

When the sample size n is large, the Central


Limit Theorem states that the sampling
distribution of the sample mean would follow the
Normal Distribution with mean µ and variance
σ2/n. Hence the test statistic would be as follows:
X −µ
Z=
σ
n
For a specified level of significance (α), the rejection
region can then be determined by utilizing the
Standardized Normal Distribution 15

REJECTION RULES
X −µ
Test statistic: Z=
σ
n
Hypotheses Rejection rules
H0: µ = µ0 • Reject H0 if Z < – zα/2 or Z > zα/2
H1: µ ≠ µ0 • Do not reject H0 if –zα/2 ≤ Z ≤ zα/2
H0: µ = µ0 • Reject H0 if Z > zα
H1: µ > µ0 • Do not reject H0 if Z ≤ zα
H0: µ = µ0 • Reject H0 if Z < – zα
H1: µ < µ0 • Do not reject H0 if Z ≥ –zα
16

8
EXAMPLE 1
BERENSON & LEVINE (1992) PROBLEMS 11.13 P.365
Suppose that the director of manufacturing at
clothing factory needed to determine whether a
new machine was producing a particular type of
clothing according to the manufacturer’s
specification, which indicate that the cloth should
have a mean breaking strength of 70 pound and
a standard deviation of 3.5 pounds. A sample of
36 pieces revealed a sample mean of 69.7 pounds.
Is there evidence that the machine is not meeting
the manufacturer’s specification in term of the
average breaking strength? (Use the .05 level of
significance) 17

SOLUTION TO EXAMPLE 1
1. The null and alternative hypothesis were
H0: µ = 70
H1: µ ≠ 70
2. The test statistic would be the Z statistic
3. Significance level of .05 specified the size of the
rejection region. Since H1 is a two sided hypothesis, the
rejection region is divided into the two tails of the
distribution, i.e. 0.025 each. Looking up the area in the
Normal distribution the critical value that divide the
rejection and nonrejection region are +1.96 and –1.96

The rejection rule would be


Reject H0 if Z > +1.96 or Z < – 1.96 Reject H0 Reject H 0

Do not reject H0 if –1.96 ≤ Z ≤ +1.96


Do not
reject H0
0.025 0.025

Z = -1.96 Z = 1.96
µX = 70
18

9
SOLUTION TO EXAMPLE 1 (CONTINUED)
4. The value of the test statistics were
X −µ 69.7 − 70
Z= = = −0.514
σ 3.5
n 36

5. Since Z = – 0.514, our decision is not to reject H0 (we


see that –1.96 < – 0.514 < +1.96)

USING MINITAB
 Store the data in one column of Minitab spreadsheet
 Choose Stats  Basic Statistics  1-Sample z
 Click Test mean button and complete the dialog box

20

10
MINITAB OUTPUT
H0: µ = 70 H1: µ ≠ 70

Z-Test
The value of
Z statistic
Test of mu = 70.000 vs mu not = 70.000
The assumed sigma = 3.50

Variable N Mean StDev SE Mean Z P


strength 36 69.700 3.452 0.583 -0.51 0.61

The p value: the probability of obtaining a test statistic equal


to or more extreme than the result observed, given H0 is true 21

TEST OF HYPOTHESIS FOR THE MEAN, ΣX


UNKNOWN
X −µ
Test statistic: T = S
n
Hypotheses Rejection rules
H0: µ = µ0 • Reject H0 if T < – tα/2 or T > tα/2
H1: µ ≠ µ0 • Do not reject H0 if –tα/2 ≤ T ≤ tα/2
H0: µ = µ0 • Reject H0 if T > tα
H1: µ > µ0 • Do not reject H0 if T ≤ tα
H0: µ = µ0 • Reject H0 if T < – tα
H1: µ < µ0 • Do not reject H0 if T ≥ –tα 22

11
EXAMPLE 2

Suppose that the standard deviation of the


population in Example 1 was unknown. However, we
have the sample standard deviation, which is 3.452
pounds. Is there any evidence that the machine is
not meeting the manufacturer’s specification ?

23

MINITAB OUTPUT
Stats  Basic Statistics  1-Sample t
T-Test of the Mean

Test of mu = 70.000 vs mu not = 70.000

Variable N Mean StDev SE Mean T P


strength 36 69.700 3.452 0.575 -0.52 0.61

24

12
RULE OF THUMB
Test of hypothesis for the mean
Population variance Sample size Test statistic
X −µ
Known Any sample size Z=
σ n
X −µ
Unknown n ≥ 30 Z=
s n
X −µ
Unknown n < 30 T=
S n

25

TEST OF HYPOTHESIS FOR A PROPORTION


ps − p X − np
Test statistic: Z≅ or Z≅
p(1 − p) np(1 − p)
n
Hypotheses Rejection rules
H0: p = p0 • Reject H0 if Z < – zα/2 or Z > zα/2
H1: p ≠ p0 • Do not reject H0 if –zα/2 ≤ Z ≤ zα/2
H0: p = p0 • Reject H0 if Z > zα
H1: p > p0 • Do not reject H0 if Z ≤ zα
H0: p = p0 • Reject H0 if Z < – zα
H1: p < p0 • Do not reject H0 if Z ≥ –zα 26

13
EXAMPLE 3
A stationery supply store receives a shipment of a
certain brand of inexpensive ball point pens from
the manufacturer. The shipment can be returned if
there is more than 5% defective. A random sample
of 300 pens is tested and 30 are found to be
defective. Can the owner returned this shipment?
Use a level of significance of .10.

27

THE CHI-SQUARE DISTRIBUTION


(n − 1)s 2
The statistic: χ2 =
σ2
will follow the Chi-square distribution with (n – 1) degrees
of freedom

α α

2 2
0 χ 1−α χ α χ2
28

14
CRITICAL VALUES OF Χ2
α
2
0 χα χ2

χ2 α
ν α=0,995 α=0,990 α=0,975 α=0,950 α=0,900 α=0,100 α=0,050 α=0,025 α=0,010 α=0,005
1 0,000 0,000 0,001 0,004 0,016 2,706 3,841 5,024 6,635 7,879
2 0,010 0,020 0,051 0,103 0,211 4,605 5,992 7,378 9,210 10,597
3 0,072 0,115 0,216 0,352 0,584 6,251 7,815 9,348 11,345 12,838
4 0,207 0,297 0,484 0,711 1,064 7,779 9,488 11,143 13,277 14,860
5 0,412 0,554 0,831 1,146 1,610 9,236 11,071 12,833 15,086 16,750
6 0,676 0,872 1,237 1,635 2,204 10,645 12,592 14,449 16,812 18,548
7 0,989 1,239 1,690 2,167 2,833 12,017 14,067 16,013 18,475 20,278
8 1,344 1,647 2,180 2,733 3,490 13,362 15,507 17,535 20,090 21,955
9 1,735 2,088 2,700 3,325 4,168 14,684 16,919 19,023 21,666 23,589
10 2,156 2,558 3,247 3,940 4,865 15,987 18,307 20,483 23,209 25,188
11 2,603 3,054 3,816 4,575 5,578 17,275 19,675 21,920 24,725 26,757
12 3,074 3,571 4,404 5,226 6,304 18,549 21,026 23,337 26,217 28,300
13 3,565 4,107 5,009 5,892 7,042 19,812 22,362 24,736 27,688 29,820
14 4,075 4,660 5,629 6,571 7,790 21,064 23,685 26,119 29,141 31,319
15 4,601 5,229 6,262 7,261 8,547 22,307 24,996 27,488 30,578 32,801
29

TESTING A HYPOTHESIS ABOUT A


POPULATION VARIANCE
(n − 1)s 2
The statistic: χ = 2
σ2
Hypotheses Rejection rules
H0: σ2 = σ02 • Reject H0 if χ2 < χ21-α/2 or χ2 > χ2α/2
H1: σ2 ≠ σ02 • Do not reject H0 if χ21-α /2 ≤ χ2 ≤ χ2α/2
H0: σ2 = σ02 • Reject H0 if χ2 > χ2α
H1: σ2 > σ02 • Do not reject H0 if χ2 ≤ χ2α
H0: σ2 = σ02 • Reject H0 if χ2 < χ21-α
H1: σ2 < σ02 • Do not reject H0 if χ2 ≥ χ21-α 30

15
EXAMPLE 4
A manufacture of candy must monitor the
temperature at which the candies are
baked. Too much variation will cause
inconsistency in the taste of the candy. Past
records show that the standard deviation of
the temperature has been 1.2o F. A random
sample of 30 batches of candy is selected
and the sample standard deviation of the
temperature is 2.1o F. Is there any evidence
that the population standard deviation has
31
increase above 1.2o F?

TWO-SAMPLE TESTS

Population 1 Population 2
µ1 , σ 12
? µ 2 , σ 22

Sample
Sample
n1 , x1 , s12
! n 2 , x 2 , s 22
32

16
TESTING FOR DIFFERENCE BETWEEN THE
MEANS OF TWO INDEPENDENT POPULATIONS

 Two-tailed test:
H0: µ1 = µ2 or µ1 – µ2 = 0
H1: µ1 ≠ µ2 or µ1 – µ2 ≠ 0 Rejection regions
 One-tailed tests:
H0: µ1 = µ2 or µ1 – µ2 = 0
H1: µ1 > µ2 or µ1 – µ2 > 0
Rejection region
or
H0: µ1 = µ2 or µ1 – µ2 = 0
H1: µ1 < µ2 or µ1 – µ2 < 0
33
Rejection region

Case 1. Both population variances are known,


or both sample sizes > 30

The test statistic is


( X 1 − X 2 ) − (µ1 − µ 2 ) ( X 1 − X 2 ) − (µ1 − µ 2 )
Z= Z=
σ 12 σ 22 or s12 s 22
+ +
n1 n2 n1 n2

For a specified level of significance (α), the rejection


region can then be determined by utilizing the
Standardized Normal Distribution
34

17
EXAMPLE 5
Management of the Sycamore Steel Co.
wishes to determine if there is any
difference in performance between the day
shift of workers and the evening shift of
workers. A sample of 120 day-shift workers
reveals an average output of 74.3 parts per
hour with a standard deviation of 16 parts
per hour. A sample of 100 evening-shift
workers reveals an average output of 69.7
parts per hour with a standard deviation of
18 parts per hour. Is there any evidence of a
difference in output between the day shift
and evening shift? 35

Case 2. Small sample sizes: both population


variances are unknown, but can be
assumed to be equal
The test statistic is
( X 1 − X 2 ) − ( µ1 − µ 2 )
T=
1 1
S p2  + 
 n1 n2 
( n1 − 1) s12 + (n 2 − 1) s 22
where S = 2
p
n1 + n2 − 2
For a specified level of significance (α), the
rejection region can then be determined by
utilizing the t-distribution with (n1+n2 – 2)
36
degrees of freedom

18
EXAMPLE 6
A quality control manager at a light bulb factory
would like to determine if there is any difference
in the average life of bulb manufactured on two
different types of machines. A random sample of
25 light bulbs obtained from machine 1 indicated
a sample mean of 375 hours with a sample
standard deviation of 110 hours, and a similar
sample of 25 from machine 2 indicated a sample
mean of 362 hours with a sample standard
deviation of 125 hours. Is there any evidence of a
difference in the average life of bulbs produced by
the two types of machines?

37

Case 3. Small sample sizes: both population


variances are unknown, and cannot be
assumed to be equal
( X 1 − X 2 ) − ( µ1 − µ 2 )
The test statistic is T '=
s12 s 22
+
n1 n2
For a specified level of significance (a), the
rejection region can then be determined by
utilizing an approximation to a t-distribution
with n degrees of freedom, where
2
 s12 s 22 
 + 
ν=  n1 n 2 
 ( s12 / n1 ) 2 ( s 22 / n 2 ) 2  38
 + 
 1 n − 1 n2 − 1 

19
EXAMPLE 7
An experiment was conducted to compare the mean
number of tapeworm in the stomachs of sheep that have
been treated for worms against the mean number in
those that were untreated. A sample of 14 worm-
infected lambs was randomly divided into two groups.
Seven were injected with the drug and the remainder
were left untreated. After a six-month period only 13
animals were available for analysis and the following
worm counts were recorded:

Drug-treated sheep 5 13 18 6 4 2 15
Untreated 40 54 26 63 21 37
Is there any difference in the mean number of worms
between treated and untreated lambs? 39

TESTING FOR DIFFERENCE BETWEEN


THE MEANS FROM TWO RELATED
POPULATIONS

 Two samples are related when the items or


individuals in the first sample are not independent of
the second sample
 The dependency occurs either because the items are
paired or matched according to some characteristics or
because repeated measurements are obtained from the
same set of items

The variable of interest is the difference between


the values of the observations rather than the
observations themselves 40

20
Observations Sample 1 Sample 2 Difference

1 x11 x21 d1 = x11 – x21

2 x12 x22 d2 = x12 – x22

⋮ ⋮ ⋮ ⋮
i x1i x2i di = x1i – x2i

⋮ ⋮ ⋮ ⋮
n x1n x2n dn = x1n – x2n
41

The paired difference test


d − µd
Test statistic: T = S where d = 1n ∑ d i
d
n Sd = 1
n −1 ∑ (d i − d )2

Hypotheses Rejection rules


H0: µd = 0 • Reject H0 if T < – tα/2 or T > tα/2
H1: µd ≠ 0 • Do not reject H0 if –tα/2 ≤ T ≤ tα/2
H0: µd = 0 • Reject H0 if T > tα
H1: µd > 0 • Do not reject H0 if T ≤ tα
H0: µd = 0 • Reject H0 if T < – tα
H1: µd < 0 • Do not reject H0 if T ≥ –tα 42

21
EXAMPLE 8
The marketing manager of a
company decided to evaluate Store Before ($) During ($)
the effectiveness of a new 1 63,458 65,496
advertising campaign. He 2 48,510 52,462
collected data on monthly 3 51,203 50,864
sales before and during the
4 75,241 79,520
campaign for eight regional
stores (see the table). What 5 60,123 71,145
should he conclude? 6 55,555 55,600
7 45,456 48,654
8 57,438 60,897
43

22

You might also like