Chapter 3 Hypothesis Testing
Chapter 3 Hypothesis Testing
HYPOTHESIS TESTING
@sry19
Expected Outcomes
Test a population mean when the population variance is known or
unknown.
Test the difference between two population means of independent
samples when the population variances are known or unknown.
Test the difference between two population means of dependent
samples.
Test a population proportion and the difference between two population
proportions.
Test a population variance and the ratio of two population variances.
Conduct a hypothesis testing using confidence interval approach.
Conduct a hypothesis testing using Microsoft Excel and the P-value
approach.
@sry19
CONTENTS
3.1 Introduction to Hypothesis Testing
3.1.1 Terms and Definitions
3.1.2 Procedure in Hypothesis Testing
3.2 Hypothesis Testing for a Population Mean
3.3 Hypothesis Testing for the Difference Between Two Population Means
3.3.1 Independent Samples
3.3.2 Dependent Samples
3.4 Hypothesis Testing for Population Proportion
3.5 Hypothesis Testing for Difference Between Two Population Proportions
3.6 Hypothesis Testing for Population Variance
3.7 Hypothesis Testing for The Ratio of Two Population Variances
3.8 Hypothesis Testing Using Confidence Interval Approach
3.9 Hypothesis Testing Using P-Value Approach
3.10 Type I and Type II Errors
@sry19
3.1 INTRODUCTION TO HYPOTHESIS TESTING
Describe the terms used in hypothesis testing.
State the null and alternative hypotheses.
• Many problems arise among scientists or engineers are related to a data-based decision
procedure that can produce a conclusion about the statement of population under study.
• The decision is made based on a statistical decision-making process in evaluating the
claim or the statement about the population(s).
@sry19
3.1.1 TERMS AND DEFINITIONS
Definition 1:
A null hypothesis, denoted by H 0 , is a statistical hypothesis that states an
assertion about one or more population parameters.
An alternative hypothesis, denoted by H 1 , is a statistical hypothesis that states
the assertion of all situations that not covered by H 0 .
Types of Test for Statistical Hypotheses
hypothesised
value
parameter
Common Phrases for Hypothesis
@sry19
EXERCISE 3.1.1(page 144)
1. State the null and alternative hypotheses for each conjecture.
a) A researcher thinks that if expectant mothers use vitamin pills, the birth
weight of the babies will increase. In previous report, the average birth
weight of the babies without consumption of vitamin pills is 3.0 kg.
c) A psychologist feels that playing soft music during a test will change the
results of the test. The psychologist is not sure whether the grades will be
higher or lower. In the past, the mean of the test scores without playing
soft music was 73.
@sry19
Definition 2:
A test statistic is a sample statistic calculated from the data obtained by
probability sampling.
@sry19
Definition 3:
A rejection region (or critical region) is the range of values of the test statistic(s)
that leads to rejection of the null hypothesis.
Definition 4:
An acceptance region is the range of values of the test statistic(s) that fail to reject
the null hypothesis.
The probability of acceptance region is 1 – α.
@sry19
Definition 5:
A critical value is the value of boundary that separates the rejection and
acceptance regions.
Definition 6:
A decision rule of a statistical hypothesis test is a rule that specifies the
conditions under which the null hypothesis may be rejected.
@sry19
Types of Hypotheses Test and Its Rejection Region
@sry19
3.1.2 PROCEDURE IN HYPOTHESIS TESTING
@sry19
@sry19
3.2 HYPOTHESIS TESTING FOR A
POPULATION MEAN
Test a population mean when population variance is known or unknown.
x 0
2
𝜎 is known ztest
/ n x 0
Test statistics for 𝝁 ztest
s/ n
𝑛 ≥ 30
𝜎2 is unknown
x 0
𝑛 < 30 ttest
s/ n
@sry17
EXAMPLE 3.2:
Most water-treatment facilities monitor the quality of
their drinking water on an hourly basis. One variable
monitored is pH, which measures the degree of alkalinity
or acidity in the water. A pH below 7.0 is acidic, above
7.0 is alkaline and 7.0 is neutral. A water-treatment plant
has targeted a pH of 8.5 (most try to maintain a slightly
alkaline level). The mean and standard deviation of 1
hour’s test results based on 31 water samples at this
plant are 8.42 and 0.16 respectively. Does this sample
provide sufficient evidence that the mean pH level in the
water differs from 8.5? Use the 0.05 level of significance
to test the hypothesis.
@sry19
EXAMPLE 3.2 (Solution)
@nym17
EXERCISE 3.2
1. A lecturer state that the IQ score for IPT students should be higher than other
people IQ’s which is known to be normally distributed with mean 110 and standard
deviation 10. To prove his hypothesis, 25 IPT students were chosen and they were
given an IQ test. The result shows that the mean IQ score for 25 IPT students is
114. Based on previous study, it is known that the standard deviation of the IQ
score for IPT students is 10. Can we accept his hypothesis at 𝛼 = 0.05?
2. In a wood cutting process to produce rulers, the mean of rulers height is set to be
equal 100 cm at all times. If the mean height of rulers is not equal to 100 cm, the
process will stop immediately. The height for a sample of 10 rulers produced by
the process were shown below:
100.13 100.11 100.02 99.99 99.98
100.14 100.03 100.10 99.97 100.21
Based on the sample, can we stop the wood cutting process at 𝛼 = 0.01?
3. UMP students said that they have not enough time to sleep. A sample of 36
students give that the mean of sleep time is 6 hours and the standard deviation is
0.9 hours. It is known that the mean sleep time for adult is 6.5 hours. Can we
reject their hypothesis at 1% significance level?
@sry19
EXERCISE 3.2 (Cont.)
4. A motorcycle manufacturer introduces a new method of assembling a
particular component. The old method had a mean assembly time of 42
minutes. The manufacturer would like the assembly time to be as short
as possible, thus he expects the new method to have a smaller mean
than the old method of assembly time. A random sample of assembly
times (in mins) taken after the new method had become established was
27 39 28 41 47 42 35 32 38
Investigate the manufacturer's expectation at 𝛼 = 0.03.
@sry19
3.3 HYPOTHESIS TESTING FOR THE
DIFFERENCE BETWEEN TWO POPULATION MEANS
Test the difference between two population means of independent samples
when the population variances are known or unknown.
Test the difference between two means of dependent samples.
@sry19
Test Statistics for 𝜇1− 𝜇2
Yes!!
! x1 x2 o
ztest
1 12 22
n1 n2
5
ttest
x1 x2 o
x x o
1 2
x x o x x o s12 s22
ztest ttest 1 2 ztest 1 2
2 1 1 3 1 1 4 s12 s22 n1 n2
sp sp
n1 n2 n1 n2 n1 n2 s12 s 22
2
v n1 n2
(n1 1) s12 (n2 1) s22 s12
2
s 22
2
sp
n1 n2 2 n1 n2
n1 1 n2 1
EXAMPLE 3.3:
The overall distance (in m) travelled of a golf ball is tested by hitting the ball
with the golf stick. Ten balls selected randomly from two different brands
are tested and the overall distance is measured and the data are given as
follows.
Brand 1 251 262 263 248 259 248 255 251 240 244
Brand 2 236 223 238 242 250 257 248 247 240 245
By assuming that the data for both brands are normally distributed with
different population variances, can we say that both brands of ball have
similar average overall distance? Use 0.05.
@sry19
EXAMPLE 3.3 (Solution)
@sry17
EXAMPLE 3.4:
The following summary data is the Brinell hardness values obtained from
samples of two magnesium alloys.
Test the claim that the mean of Alloy 1 exceeds the mean of Alloy 2 by more
than 0.5 at 1% significance level. Use the assumption that both types of
alloy have the same population variances.
@sry19
EXAMPLE 3.4 (Solution)
@sry19
EXERCISE 3.3.1
1. The standard deviation of lifetime for the battery type A is 1 hour and the standard
deviation of lifetime for the battery type B is 0.7 hours. If the mean lifetime for 30
batteries type A is 5.3 hours while the mean lifetime for 35 batteries type B is 4.8
hours, can we conclude that the lifetime for both batteries type A and type B are
the same at α = 0.05?
2. A sample of 60 maids from Country A earns an average of RM300 per week with a
standard deviation of RM16, while a sample of 60 maids from Country B earns an
average of RM250 per week with a standard deviation of RM18. Test at 10%
significance level that Country A maids’ average earning exceed Country B maids’
average earning by more than RM40 per week. Assuming both population variances
are equal.
3. A study was conducted to investigate the effectiveness of using music during the
working hours of a business. When the music was turned off during the working
hours, the mean and standard deviation of productivity level for 45 employees were
found to be 5.2 and 2.4, respectively. On a different day, the music was turned on
and the mean and standard deviation of productivity level for 40 employees were 4.8
and 1.2, respectively. Do employees perform better at work with music playing?
What can we conclude at the 0.05 level of significance if both population variances
are the same?
@sry19
EXERCISE 3.3.1(Cont.)
4. Two catalysts are being analysed to determine the mean yield of a chemical
process. A test is run in the pilot plant and the results (in cm3) are shown below.
Catalyst 1: 91.50, 94.18, 92.18, 95.39, 91.79, 89.07, 94.72, 89.21
Catalyst 2: 89.19, 90.95, 90.46, 93.21, 97.19, 97.04, 91.07, 92.75
Is there any difference between the mean yields? Assume the population
variances are equal.
5. The breaking strength of hockey stick shafts (in Newtons) made of two different
graphite-Kevlar composites are given in table as follows.
Composite A 487.3 444.5 467.7 456.3 449.7 459.2 478.9 461.5 477.2
488.5 501.2 475.3 467.2 462.5 499.7 470.0 469.5 481.5
Composite B
485.2 509.3 479.3 478.0
Determine whether the mean of breaking strength for composite A is similar to
composite B at 0.01 level of significance. Assume both population variances
are different.
@sry19
3.3.1 DEPENDENT SAMPLES
Test Statistic:
@sry19
EXAMPLE 3.5:
A new gadget is installed to air conditioner units in a factory to
minimise the number of bacteria floating in the air. The number
of bacteria floating (in CFU/ml) in the air before and after the
installation for a week in the factory is recorded and the data are
as follows.
@sry19
EXAMPLE 3.5(Solution)
@sry17
EXERCISE 3.3.2
1. Table below shows the average weekly losses of worker hours due to
accidents in ten industrial plants for before and after the installation of an
elaborate safety program.
Before 45 57 60 77 46 29 119 26 33 11
After 36 51 73 83 44 34 124 24 35 17
By assuming the data are approximately normally distributed, test the hypothesis at
0.05 level of significance either the safety program is effective or not.
@sry19
3.4 HYPOTHESIS TESTING FOR POPULATION
PROPORTION
Test a population proportion using z-test.
@sry17
EXAMPLE 3.6:
An attorney claims that at least 25% of all lawyers advertise their services. A sample of
200 lawyers in a certain city showed that 63 had used some form of advertising. At
α = 0.05, is there enough evidence to support the attorney’s claim?
@sry17
EXERCISE 3.4
1. An auditor claims that 10% of invoices for a company are
inaccurate. To test this claim, a random sample of 200 invoices is
checked and 24 are found to be inaccurate. Test at 1% significance
level whether the auditor's claim can be supported by the sample
evidence.
2. A group of scientist believes that their new medicine can heal more
than 40% of patients. The current medicine in market can only heal
30% of patients. A research is done to test the hypothesis made by
the scientists. The new medicine is given to the 100 patients and it
shows that only 26 patients are recovered. Can we accept their
hypothesis at α = 0.03?
@sry19
3.5 HYPOTHESIS TESTING FOR
DIFFERENCE BETWEEN TWO POPULATION PROPORTIONS
Test the difference between two population proportions using z-test.
Test Statistic
@sry17
EXAMPLE 3.7:
An experiment was conducted in order to determine
whether the increased levels of carbon dioxide (CO2) will kill
the leaf-eating insects. Two containers, labelled X and Y
were filled with two levels of CO2. Container Y had double
of CO2 level compared to container X. Assume that 80
insect larvae were placed at random in each container.
After two days, the percentage of larvae that died in
container X and Y were five percent and ten percent,
respectively. Do these experimental results demonstrate
that an increased level of CO2 is effective in killing leaf-
eating insects’ larvae? Test at 1% significance level.
@sry19
EXAMPLE 3.7 (Solution)
@sry17
EXERCISE 3.5
1. Two different types of polishing solutions are being evaluated for possible
use in a tumble-polish operation for manufacturing intraocular lenses
used in the human eye following cataract surgery. From previous record,
lenses using the first-type polishing solution with no defect is 50% while
lenses using the second-type polishing solution with no defect is 40%.
Three hundred lenses were tumble-polished using the first polishing
solution and of this number, 240 had no polishing-induced defects.
Another 300 lenses were tumble-polished using the second polishing
solution, and 180 lenses were satisfactory upon completion.
c. Is there any reason to believe that the first polishing solution is better
than the second polishing solution at least by 10%?
@sry19
EXERCISE 3.5(Cont.)
2. A particular consumer association wants to determine whether there is a
difference between the population proportions of two leading car
manufacturers that need major repairs within two years of their
purchase. A sample of 400 two-year owners of car Model 1 is contacted,
and a sample of 500 two-year owner of Model 2 is contacted. The
number of owners for Model 1 and Model 2 who report that their cars
needed major repairs within the first two years are 53 and 78,
respectively.
@sry19
3.6 HYPOTHESIS TESTING FOR POPULATION VARIANCE
Test Statistic
@sry17
EXAMPLE 3.8:
Listed are waiting times (in mins) of customers at a bank.
6.5 6.8 7.1 7.3 7.4 7.7
The management will open more teller windows if the standard deviation of waiting
times is at least 0.9 minutes. Is there enough evidence to open more teller windows
at 𝛼 = 0.01
@sry18
EXERCISE 3.6
1. A cigarette manufacturer wishes to test the claim that the variance of
nicotine content of its cigarettes is 0.644 milligram. The nicotine content
is assumed to be normally distributed. A sample of 20 cigarettes is
randomly selected and it is found that the standard deviation is 1.75
milligram. Is there enough evidence to reject the manufacturer’s claim?
Test Statistic
@sry17
EXAMPLE 3.9:
A manager in a large computer operation company wants to study the use of
computer from two departments within the company. The departments are
the Human Resource Department and the Research Department. The usage
time (in seconds) for each job is recorded as follows:
Human Resource 9 3 8 7 12
Research 4 13 10 9 9 6
@sry19
EXAMPLE 3.9(a)(Solution)
@sry17
EXAMPLE 3.9(b)(Solution)
@sry1i9
EXERCISE 3.7
1. Before service, a machine can pack 10 packets of sugar with variance
weight of 64 while after it was serviced, the variance weight for 5 packets of
sugar packed by the machine is 25. Do the service improves the packaging
process of the machine?
Machine A 23 26 19 24 27 22 20 18
Machine B 21 24 23 25 24 28 24 23
@sry19
EXAMPLE 3.10: (By considering Example 3.2)
Most water-treatment facilities monitor the quality of their drinking water on an hourly basis. One
variable monitored is pH, which measures the degree of alkalinity or acidity in the water. A pH
below 7.0 is acidic, above 7.0 is alkaline and 7.0 is neutral. One water-treatment plant has target a
pH of 8.5 (most try to maintain a slightly alkaline level). The mean and standard deviation of 1
hour’s test results based on 31 water samples at this plant are 8.42 and 0.16 respectively. Does this
sample provide sufficient evidence that the mean pH level in the water differs from 8.5 by using the
confidence interval concept? Use 0.05 level of significance to test the hypothesis.
@sry19
EXERCISE 3.8
1. Based on past record of a pharmaceutical company, the cure rates for a standard
medication in treating a particular ailment is ten percent. After five years, the
company has produced a new medication. The hired pharmacist in the company
claims that the new medication produced by the company is effective in treating a
particular ailment compared to a standard medication. In a simple random
sample of two hundred subjects who took the new medication, it was found that
sixty subjects are uncured. Meanwhile, one hundred and eighty subjects are
completely cured from three hundred subjects who took the standard medication.
Given that the 97.8% confidence interval for the cure rates of the standard
medication is (0.5352, 0.6648). Can we conclude that the cure rates of the
standard medication do not change from the past record?
@sry19
3.9 HYPOTHESIS TESTING USING P-VALUE APPROACH
@sry19
(i) Procedure of Hypothesis Testing for a Population Mean
using Microsoft Excel
@sry19
EXAMPLE 3.11
A petroleum company is studying to buy an additive for
improving the distilled product. The company estimates the
cost of the additive, which is RM1 million for 5 tonnes. Ten
consultant companies submitted their tenders with the
following estimates (in million RM):
0.97 0.95 1.10 1.30 1.10 0.96 0.97 1.20 1.50 1.70
@sry19
Solution 3.11
@sry17
(ii) Procedure of Hypothesis Testing for the Difference between Two
Population Means for Independent Samples using Microsoft Excel
@sry17
EXAMPLE 3.12: (see exercise 3.7(3))
A company is considering installing a new machine to assemble its
product. The company is considering two types of machine, Machine A
and Machine B but it will buy only one machine. The company will
install Machine B if the mean time taken to assemble a unit of the
product is less than mean time taken by Machine A. The following
table shows the time taken (in minutes) to assemble one unit of the
product on each type of machine.
Machine A 23 26 19 24 27 22 20 18
Machine B 21 24 23 25 24 28 24 23
@sry19
Solution 3.12
@sry19
Solution 3.12 (Cont.)
@sry19
Solution 3.12 (Cont.)
@sry19
Solution 3.12 (Cont.)
@sry19
(iii) Procedure of Hypothesis Testing of the Difference
between Two Population Means for Dependent Samples
using Microsoft Excel
@sry19
EXAMPLE 3.13: (see Example 3.5)
A new gadget is installed to air conditioner units in a factory to
minimise the number of bacteria floating in the air. The number
of bacteria floating (in CFU/ml) in the air before and after the
installation for a week in the factory is recorded as follows.
@sry19
Solution 3.13
@sry19
(iv) Hypothesis Testing for the
Ratio of Variances Using Microsoft Excel
@sry19
EXAMPLE 3.14: (see Exercise 3.7(2))
A firm is conducting a study to compare two different physical
arrangements of its assembly line. It has been determined that both
arrangements yield approximately the same average number of finished
units per day. The arrangement with the smaller variance in the
number of finished units produced per day will be adopted as the new
arrangement of its assembly line. The results of two independent random
samples are shown in table below.
Using 0.01 significance level, do the data support the claim that assembly Line 1
will be adopted?
Solve this problem by using Microsoft Excel and P-value approaches.
@sry19
Solution 3.14
@sry19
Solution 3.14 (Cont.)
@sry19
3.10 TYPE I AND TYPE II ERRORS
Definition 7:
A Type I error is an error of rejecting the null hypothesis when it is true.
Definition 8:
A Type II error is an error of failing to reject the null hypothesis when it
is false.
@sry19
Possible Outcomes of a Jury Trial
@sry19
Definition 9:
The significance level (or level of significance) is the maximum
probability of committing a Type I error, denoted by 𝛼.
@sry19
EXAMPLE 3.15:
An additive is added to car batteries in a sample to test whether it will increase the lifetime of
the batteries or not. Identify the type of error involved in each of the following situations and
state the reason.
a) The additive is not significantly increased the lifetimes of car batteries in the population.
However, the result by a sample of car batteries added with the additive shows that the
additive increases the lifetime of the batteries. In this test, the P-value is lower than the
given significance level.
Solution:
→ The type of error is Type I error.
Note
@sry19
EXAMPLE 3.15 (cont.):
b) The additive was to be used in the general population of batteries,
which is significantly increased their lifetime. Based on the sample
of car batteries which use the additive, the P-value shows the
result of 0.1. Thus, it is concluded that the additive does not work
on the car batteries selected for the sample at 1% significance level.
Solution:
→ The type of error is Type II error.
@sry19
EXERCISE 3.10
For the following situation, identify the type of error involved and state
your reason.
@sry19
MIND EXPANDING EXERCISES
ME1 What is the difference between a test statistics and a critical
value?
ME3 You have developed a new treatment and you claim that it will
lower the cholesterol levels. You express the claim as 100 ,
where 100 is a standardised index of cholesterol. Which P-value
would you prefer to get, 0.05 or 0.01, in order to investigate the
efficiency of the new treatment? Why?
@sry19
MIND EXPANDING EXERCISES
ME5 Using data from the Department of Statistics Malaysia, a researcher
obtains the mean income of men and women for each 14 states.
Then, she conducts a t-test of the null hypothesis that the men and
women in Malaysia have equal mean incomes. Is this procedure correct?
Why or why not?
ME7 When testing the claim that the mean weight lost on a diet is greater
than 0 kg, we use sample results showing that 10,000 people lost weight
with a mean of 0.1 kg and standard deviation of 0.8 kg. Given that the
statistics result is the t-test value of 12.5000 with P-value of 0.00001. Is
the mean weight loss statistically significant? Does the mean weight loss
suggest that the diet is practical? Should it be recommended?
@sry19
MIND EXPANDING EXERCISES
ME8 Highway safety engineer tests newly designed road
signboards with the objective to increase the
reflectivity so that the signboards will be more visible
to drivers. Volunteers drive through a test course with
new and old design signboards and rate which design is
more visible.
@sry19
Thank You
“Practice make better and then perfect”