Chapter 9 Hypothesis Testing

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

TAR UC – C.P.U.S.

Foundation in Computing & Accounting– Statistics (FPMA1014)

Chapter 9: Hypothesis Testing

At the end of chapter, students should be able to


 understand the nature of hypothesis test.
 understand the difference between one-tail and two-tail test.
 formulate a null hypothesis and an alternative hypothesis.
 understand the terms ‘significance level’, ‘rejection region’, ‘acceptance region’
and ‘test statistic’.
 carry out a hypothesis test of a population mean for a sample drawn from a
normal distribution of known variance, and also for large sample.
 to make informed decisions based on data.
 understand type I and type II errors.

An introductory example

Over a number of years a primary school has recorded the reading ages of children at
the beginning and end of each academic year. The teachers have found that during Year
3 the increase in reading age is normally distributed with mean 1.14 years and
standard deviation 0.16 years.

This year they are going to try a new reading scheme. At the end of the year the
teachers will use the mean increase in reading age, x , of the 40 children in Year 3 to
help them answer the question: ‘Does the new reading scheme give better results
than the old one in our school?’

It is easy to check whether x is greater than 1.14 years. It is not easy to know whether
a value of x greater than 1.14 years reflects the effectiveness of the new scheme or
is just due to random variation between children. This chapter describes a statistical
method for arriving at a decision. The following sections break down the process into
several stages.

1
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

9.1 Null Hypothesis and Alternative Hypothesis

A ‘hypothesis’ is a theory which is assumed to be true unless evidence is obtained


which indicates otherwise. ‘Null’ means ‘nothing’ and the term ‘null hypothesis’ means
a ‘theory of no change’, that is ‘no change’ from what would be expected from past
experience.

In this example, where the mean of the past increases in reading age is 1.14 years, the
null hypothesis can be expressed by

H0 : µ = 1.14. (The new reading scheme makes no difference)

The other theory is that the new reading scheme is more effective than the old one. This
is called alternative hypothesis and is given the symbol H1. So the alternative
hypothesis in this case is

H1 : µ > 1.14. (The new reading scheme is more effective)

The procedure which is used to decide between these two opposing theories is called a
hypothesis test or sometimes a significant test. In this example the test will be one –
tail because the alternative hypothesis proposes a change in the mean in only one
direction (an increase in the mean). It is also possible to have one-tail test in which the
alternative hypothesis proposes a decrease in the mean. Tests in which the alternative
hypothesis suggests a difference in mean in either direction are called two – tail.

2
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

Example 1
For the following situations give null and alternative hypotheses and say whether a
hypothesis test would be one-tail or two-tail.
a) In the past an athlete has run 100 meters in 10.3 seconds on average. He has been
following a new training program which he hopes will decrease the time he takes to
run 100 meters. He is going to time himself on his next six runs.

b) The bags of sugar coming off a production line have masses which vary slightly but
which should have a mean value of 1.01 kg. A sample is to be taken in order to test
whether there has been any change in the mean.

c) The mean volume of liquid in bottles of lemonade should be 2 liters. A sample of


bottles is taken in order to test whether the mean volume has increased above 2
liters.

3
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

For a hypothesis test on the population mean, µ, the null hypothesis, H0, proposes a
value, µ0, for µ,

H0 : µ = µ0.

The alternative hypothesis, H1, suggests the way in which µ might differ from µ0. H1
can take three forms:

H1 : µ < µ0, a one-tail test for a decrease;


H1 : µ > µ0, a one-tail test for an increase;
H1 : µ ≠ µ0, a two-tail test for a difference.

4
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

9.2 Critical Values

a) When it is one tail test and H1: µ > a.


Significant level
1% 5% 10%
Critical
value, c
Rejection
region
0 z
c - value on the left hand side tail of z.

b) When it is one tail test and H1: µ < a.


Significant level
1% 5% 10%
Critical
value, c
Rejection
region
0 z
c - value on the left hand side tail of z.

c) When it is two tail test and H1: µ ≠ a.


Significant level
1% 5% 10%
Critical
value, c
Rejection
0 region z
c - value on the both hand side tail of z.

5
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

x 
The value of the standardized and original variables are related by z  2 or
n
x 
z
 , where Z ~ N(0, 1).
n

Normal Distribution for X Standardized Normal Distribution for Z ~ N(0, 1)

If there is a significance level, both graphs will have their own rejection regions, the
cut off of the rejection region which one is using value of x and other using z-value
(critical value).

If the sample mean is in the rejection region, you reject H0.


From the introductory example, you can conclude that the population mean has
increased.

If the sample mean is in the acceptance region, you do not reject H0.
There is insufficient evidence to say that new reading scheme is more effective.

H0 : µ = 1.14. (The new reading scheme makes no difference)


H1 : µ > 1.14. (The new reading scheme is more effective)

Normal Distribution for Standardized Normal Distribution


X ~N(1.14, 0.162) for Z ~ N(0, 1)

6
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

1.14 x

acceptance rejection region


acceptance rejection region region 0
z
region

Since Ф(z) = (at 5% significance level), the value of the standardized


normal variable, z, corresponding to c, is c = .

The rejection region is chosen so that it is ‘unlikely’ for the sample mean to fall in the
rejection region when H0 is true. Significance level is the probability of rejecting H0 is
true. Figure below shows the rejection region and the acceptance regions for the
children’s reading scheme example give that the significance level is 5%.

The value, c, which separates the rejection and acceptance regions, is called a critical
value. It can be calculated as follows.

x 
The values of the standardized and original variables are related by z  or
2
n
x 
z
 , where Z ~N(0, 1).
n

x  1.14 x  1.14
Substituting in this equation gives 1.645  or 1.645  0.16 .
0.162
40 40

7
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

Rearranging gives

The rejection region is years.

At the end of the year the observed value for the sample mean was x = 1.19 years. Since
this value is in the rejection region, you can conclude that it is more likely to be due to
an increase in the population mean. This suggests that the new reading scheme does
give better results than the old one.

Decide whether H0 is rejected or accepted:


1) When it is one tail test and H1: µ > a.
Hypothesis test is conducted at 4% significance level and test statistic value, z = 1.32.

z
0

H0 : µ = a
H1: µ > a

Rejection region for x

2) When it is one tail test and H1: µ < a.


Hypothesis test is conducted at 2% significance level and test statistic value, z = –1.45.

0
z

H0 : µ = a
H1: µ < a

Rejection region,
8
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

3) When it is two tail test and H1: µ ≠ a.


Hypothesis test is conducted at 5% significance level and test statistic value, z = 0.97.

0
z
H0 : µ = a
H1: µ ≠ a

Rejection region,

4) When it is two tail test and H1: µ ≠ a.


Hypothesis test is conducted at 6% significance level and test statistic value, z = –2.12.

z
0

H0 : µ = a
H1: µ ≠ a

Rejection region,

9
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

Example 2
In the past a machine has produced rope which has a breaking load which is normally
distributed with mean 1 000 N and standard deviation 21 N. A new process has been
introduced. In order to test whether the mean breaking load has changed a sample of 50
pieces of rope is taken, the breaking system of each piece measured and the mean
calculated.
a) Define suitable null and alternative hypotheses for testing whether the breaking load
has changed.
b) Taking the sample mean as the test statistic, find the rejection region for X for a
hypothesis test at the 5% significance level.

10
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

Example 3
The blood pressure of a group of hospital patients with a certain type of heart disease
has mean 85.6. A random sample of 25 of these patients volunteered to be treated with a
new drug and a week later their mean blood pressure was found to be 70.4. Assuming a
normal distribution with standard deviation 15.5 for blood pressures, and using 1%
significance level, test whether the mean blood pressure for all patients treated with the
new drug is less than 85.6.

11
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

Example 4
Mathematics mark of students in SMK Jess is normally distributed with mean 70 and
standard deviation 16 in year 2014. A handbook equipped with downloaded
Mathematics learning applications is gifted to every student to test whether the
handbook has improved Mathematics’ knowledge among students. A sample of 20
students is chosen and their average Mathematics mark in year 2015 had been recorded.
A hypothesis test conducted at 2% significance level has proved that handbook has
improved Mathematics’ knowledge among students. Find the acceptance range of
sample mean.

12
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

9.3 Hypothesis Test

This chapter takes further the idea of hypothesis testing introduced in the previous part.
When you have completed it you should
 be able to formulate hypotheses and carry out a test of a population mean using a
normal approximation.

Hypothesis Testing
1) Write the null and alternative hypothesis.
2) Find the critical value using the tables
3) Compute the test statistic
4) Make a decision to reject or fail to reject the null hypothesis. (A picture showing the
critical value and test statistic may
be useful)Write the conclusion.

9.3.1 Testing Population Mean for Known Population Variance

Example 5
A new surgical technique has been developed in an attempt to reduce the time that
patients have to spend in hospital after a particular operation. In the past, the mean time
spent in hospital was 5.3 days. For the first 50 patients on whom the new technique was
tried, the mean time spent in hospital was 5.0 days with an estimated population
variance of 0.42 days2. Is there any evidence at the 2% significance level that the new
technique has reduced the time spent in hospital?

13
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

Example 6
The times taken by workers to complete a task are normally distributed with standard
deviation 2.2 minutes. The factory manager claims that the mean time is 16.0 minutes.
The times taken by random sample of 5 workers were 17.8, 22.4, 16.3, 23.1 and 11.4
minutes. A hypothesis test was conducted to determine whether the factory manager’s
claim should be accepted.

14
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

9.3.2 Testing Population Mean for Unknown Population Variance in a Large


Sample
If the population variance, σ2, is unknown, it can be replaced by its estimate ˆ 2.
The term ‘large’ is not very precise. A rule of thumb would be that ‘large’ means a
sample size of 30 or more.

Example 7
An inspector of items from as production line takes, on average, 21.75 seconds to check
each item. After the installation of a new lighting system the times, t seconds, to check
each of 50 randomly chosen items from the production line are summarized by Σ t = 1
107 and Σ t 2 = 24 592.35.
a) Calculate an unbiased estimate of the population variance of the time to check an
item under the new lighting system.
b) Test at the 5% significance level whether there is evidence that the population mean
time has changed from 21.75 seconds.

15
TAR UC – C.P.U.S. Foundation in Computing & Accounting– Statistics (FPMA1014)

Example 8
The plants planted by Mr. Lee in his orchard have a mean height of 45.6 cm. A new
fertilizer has been used in planting to help the plants grow taller. After a period, a
random sample of 100 plants is chosen and their heights, x cm, measured. The results
are summarized by
Σx = 4 600 Σx2 = 212 000.
Test at 3% significance level, whether the fertilizer is effective in helping the plants
grow taller.

16

You might also like