HYPOTHESIS TESTING
Dadan Kusnandar, Ph.D.
1
OBJECTIVES
When you have completed this topic, you should be able to:
2
CONCEPTUAL EMPHASIS
3
Readings
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:
4
STRUCTURE OF HYPOTHESIS TESTING
5
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
6
CRUCIAL THINGS ABOUT THE TWO HYPOTHESES
H0: θ = θ0
7
TEST STATISTIC AND REJECTION REGION
8
REJECTION REGION FOR�H0: θ = θ0 VS. H1: θ ≠ θ0
9
REJECTION REGION FOR�H0: θ = θ0 VS. H1: θ > θ0
10
REJECTION REGION FOR�H0: θ = θ0 VS. H1: θ < θ0
11
TYPE I AND TYPE II ERRORS
12
RELATIONSHIP BETWEEN α AND β
13
Statistical Decision | Actual situation | |
H0 True | H0 False | |
Reject H0 | Type I error�(α) | Correct decision |
Do not reject H0 | Correct decision | Type II error�(β) |
PROCEDURE OF HYPOTHESIS TESTING
14
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:
15
For a specified level of significance (α), the rejection region can then be determined by utilizing the Standardized Normal Distribution
REJECTION RULES
Hypotheses | Rejection rules |
H0: μ = μ0 H1: μ ≠ μ0 |
|
H0: μ = μ0 H1: μ > μ0 |
|
H0: μ = μ0 H1: μ < μ0 |
|
16
Test statistic:
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
H0: μ = 70
H1: μ ≠ 70
18
SOLUTION TO EXAMPLE 1 (CONTINUED)
USING MINITAB
20
MINITAB OUTPUT
21
Z-Test
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
H0: μ = 70
H1: μ ≠ 70
The value of Z statistic
The p value: the probability of obtaining a test statistic equal to or more extreme than the result observed, given H0 is true
TEST OF HYPOTHESIS FOR THE MEAN, ΣX UNKNOWN
22
Hypotheses | Rejection rules |
H0: μ = μ0 H1: μ ≠ μ0 |
|
H0: μ = μ0 H1: μ > μ0 |
|
H0: μ = μ0 H1: μ < μ0 |
|
Test statistic:
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
24
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
RULE OF THUMB
25
Test of hypothesis for the mean
TEST OF HYPOTHESIS FOR A PROPORTION
26
Hypotheses | Rejection rules |
H0: p = p0 H1: p ≠ p0 |
|
H0: p = p0 H1: p > p0 |
|
H0: p = p0 H1: p < p0 |
|
Test statistic:
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
28
The statistic:
will follow the Chi-square distribution with (n – 1) degrees of freedom
CRITICAL VALUES OF Χ2
29
TESTING A HYPOTHESIS ABOUT A POPULATION VARIANCE
30
Hypotheses | Rejection rules |
H0: σ2 = σ02 H1: σ2 ≠ σ02 |
|
H0: σ2 = σ02 H1: σ2 > σ02 |
|
H0: σ2 = σ02 H1: σ2 < σ02 |
|
The statistic:
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 increase above 1.2o F?
31
TWO-SAMPLE TESTS
32
Population 1
Population 2
Sample
Sample
?
!
TESTING FOR DIFFERENCE BETWEEN THE MEANS OF TWO INDEPENDENT POPULATIONS
H0: μ1 = μ2 or μ1 – μ2 = 0
H1: μ1 ≠ μ2 or μ1 – μ2 ≠ 0
H0: μ1 = μ2 or μ1 – μ2 = 0
H1: μ1 > μ2 or μ1 – μ2 > 0
or
H0: μ1 = μ2 or μ1 – μ2 = 0
H1: μ1 < μ2 or μ1 – μ2 < 0
33
Rejection regions
Rejection region
Rejection region
Case 1. Both population variances are known, or both sample sizes > 30
34
The test statistic is
or
For a specified level of significance (α), the rejection region can then be determined by utilizing the Standardized Normal Distribution
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
36
The test statistic is
where
For a specified level of significance (α), the rejection region can then be determined by utilizing the t-distribution with (n1+n2 – 2) degrees of freedom
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
38
The test statistic is
For a specified level of significance (α), the rejection region can then be determined by utilizing an approximation to a t-distribution with n degrees of freedom, where
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:
39
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?
TESTING FOR DIFFERENCE BETWEEN THE MEANS FROM TWO RELATED POPULATIONS
40
The variable of interest is the difference between the values of the observations rather than the observations themselves
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
42
Hypotheses | Rejection rules |
H0: μd = 0 H1: μd ≠ 0 |
|
H0: μd = 0 H1: μd > 0 |
|
H0: μd = 0 H1: μd < 0 |
|
Test statistic:
The paired difference test
where
EXAMPLE 8
The marketing manager of a company decided to evaluate the effectiveness of a new advertising campaign. He collected data on monthly sales before and during the campaign for eight regional stores (see the table). What should he conclude?
43
Store | Before ($) | During ($) |
1 | 63,458 | 65,496 |
2 | 48,510 | 52,462 |
3 | 51,203 | 50,864 |
4 | 75,241 | 79,520 |
5 | 60,123 | 71,145 |
6 | 55,555 | 55,600 |
7 | 45,456 | 48,654 |
8 | 57,438 | 60,897 |