Professional Documents
Culture Documents
a Single Sample
41.2
Introduction
This Section introduces you to the basic ideas of hypothesis testing in a non-mathematical way by
using a problem solving approach to highlight the concepts as they are needed. We only consider
situations involving a single sample.
In Section 41.3 we will introduce you to situations involving two samples and while the basic ideas will
follow through, their practical application is a little more complex than that met in this Workbook.
However, once you have learned how to apply the basic ideas of hypothesis testing covered in this
Workbook, you should be capable of applying hypothesis testing to a very wide range of practical
problems and learning about methods of hypothesis testing which are not covered here.
'
Prerequisites
Before starting this Section you should . . .
&
Learning Outcomes
On completion you should be able to . . .
HELM (2005):
Section 41.2: Tests Concerning a Single Sample
%
1. Tests of proportion
Problem 1
SwitchRight, a manufacturer of engine management systems requires its supplier of control modules
to supply modules with at least 99% complying with their specication. The quality control operators
at SwitchRight check a random sample of 1000 control modules delivered to SwitchRight and nd
that 985 match the specication. Does this result imply that less than 99% of the control modules
supplied do not match SwitchRights specication?
Analysis
Firstly, we set up two hypotheses concerning the control modules. The rst hypothesis, called the
null hypothesis is denoted by
H0 : 99% of the control modules match SwitchRights specication.
The second hypothesis, called the alternative hypothesis and is denoted by
H1 : less than 99% of the control modules match SwitchRights specication.
The alternative hypothesis is essentially saying that in this case, that SwitchRight cannot rely on its
supplier of control modules supplying delivering batches of modules where 99% match SwitchRights
specication.
Secondly, we describe the random sample from a statistical point of view, that is we nd a statistical
distribution which describes the behaviour of the sample. Suppose that X is the number of control
modules in a random sample of 1000 matching SwitchRights specication.
We assume that the control modules are independent and that for each module the specication is
either matched or it isnt. Under these conditions, X has a binomial distribution and the problem
can be summarised as follows:
X B(1000, p)
H0 : p = 0.99
H1 : p < 0.99
Thirdly, we set up a mechanism to enable us to make a decision between the two hypotheses. This
is done by assuming that H0 is correct until we can show otherwise.
Given that H0 is correct we can calculate the mean and the standard deviation of the distribution
as follows:
= np = 1000 0.99 = 990
HELM (2005):
Workbook 41: Hypothesis Testing
occurs in the left tail of the distribution or in the main body of the distribution.
In practice, we use the tail(s) of the standard normal distribution and convert a problem involving
the distribution N (, 2 ) into one involving the distribution N (0, 1). Diagrammatically the situation
can be represented as shown below:
Z N (0, 1)
5%
1.645
Figure 1
In general, the tails of a distribution can be dened to occupy any proportion of the distribution that
we wish, the proportions chosen are usually taken as either 5% or 1%.
Given this information and a set of tables for the standard normal distribution we can assign values
to the limits dening the tails.
Throughout this Workbook we shall use the 5% proportion to
dene the tail(s) of a distribution unless otherwise stated.
In the case we have here, the alternative hypothesis states that p is less than 0.99. Because of this
we use only one tail occupying a total of 5% of the distribution.
To discover where the number 985 lies within the distribution (tail or main body) we standardise
39). The
985 with respect to the normal distribution N (990, 3.152 ) in the usual way (see
calculation is:
985.5 990
P (X 985) = P Z
= P (Z 1.43)
3.15
Notice that 985.5 is used and not 985. This because we are using a continuous normal distribution
to approximate a discrete binomial distribution and so
P (X = 985) P (984.5 X 985.5)
the right-hand side being calculated from the normal distribution.
The number 1.43 is greater than (to the right of) 1.645 and so the number 985 occurs in the
main body of the distribution not in the left tail. This suggests that the evidence does not support the
claim that the number of control modules supplied meeting SwitchRights specication is dierent
from 99%. Essentially, we accept the null hypothesis since we do not have the evidence necessary to
reject it. Note that this result does not prove that the claim is true.
Before looking at similar problems, we will look at the possible ways of dening the tails of the
standard normal distribution. As stated previously, we shall, in these notes, always use a total of 5%
for the tail or tails of a distribution.
We say that we are making a decision at the 5% level of signicance.
HELM (2005):
Section 41.2: Tests Concerning a Single Sample
H0 : p = p 0
H1 : p = p0
2.5%
2.5%
1.96
1.96
Figure 2
(2) Hypotheses:-
Z N (0, 1)
H0 : p = p 0
H1 : p > p0
5%
0
1.645
Figure 3
(3) Hypotheses:H0 : p = p 0
H1 : p < p0
Z N (0, 1)
5%
1.645
Figure 4
The values 1.96, +1.645 and 1.645 are easily obtained from the standard normal table (Table
1) given at the end of this Workbook. The appropriate lines from the table are reproduced on the
following page for ease of reference. Note that it is sometimes advisable to be 99% sure (rather than
95% sure) of either correctly accepting or rejecting a null hypothesis. In this case we say that we are
working at the 1% level of signicance. The situation diagrammatically is exactly the same as the
one shown above except that the 5% tail areas become 1% and the 2.5% areas become 0.5%.
The corresponding values of Z are 2.58, +2.33 and 2.33 depending on whether a one-tailed or a
two-tailed test is being performed.
Particular note must always be taken of the form of the hypotheses and the corresponding test,
one-tailed or two-tailed.
HELM (2005):
Workbook 41: Hypothesis Testing
1.6
1.9
0.00
.4452
.4713
0.01
4463
4719
0.02
4474
4726
0.03
4485
4732
0.04
4495
4738
0.05
4505
4744
0.06
4515
4750
0.07
4525
4756
0.08
4535
4762
0.09
4545
4767
0.03
4901
4943
0.04
4904
4945
0.05
4906
4946
0.06
4909
4948
0.07
4911
4949
0.08
4913
4951
0.09
4916
4952
2.3
2.5
0.00
.4893
.4938
0.01
4896
4940
0.02
4898
4941
We shall now look at a problem which is similar in type to Problem 1 and solve it using the ideas
discussed in the analysis of that problem.
Problem 2
The Head of Quality Control in a foundry claims that the castings produced in the foundry are
better than average. In support of this claim he points out that of a random sample of 60 castings
inspected, 59 passed. It is known that the industry average percentage of castings passing quality
control inspections is 90%. Do these results support the Heads claim?
Analysis
Let X denote the number of castings passing the quality control inspection from the sample of 60.
Assuming that a casting either passes or fails the inspection process, we can assume that X follows
the binomial distribution
X B(60, p)
where p is the probability that a casting passes the inspection.
The null hypothesis H0 , is that the probability that a casting passes the inspection is the same as
the industry average. The alternative hypothesis H1 , is that the Head of Quality Control is correct
in his claim that castings produced in his foundry have a greater chance of passing the inspection.
The problem can be summarised as:
X B(60, p)
H0 : p = 0.90
H1 : p > 0.90
H1 : p > 0.90
58.5 54
Z
2.32
= P (Z 1.94)
Z=
54
58.5 54
2.32
Z N (0, 1)
58.5
Z
1.94
Figure 5
Since 1.94 > 1.645, the result is signicant at the 5% level and so we reject the null hypothesis. The
evidence suggests that we accept the alternative hypothesis that, at the 5% level of signicance, the
Head of Quality Control is making a justied claim.
Task
A rm manufactures heavy current switch units which depend for their correct
operation on a relay. The relays are provided by an outside supplier and out of a
random sample of 150 relays delivered, 140 are found to work correctly. Can the
relay manufacturer justiably claim that at least 90% of the relays provided will
function correctly?
Your solution
10
HELM (2005):
Workbook 41: Hypothesis Testing
Answer
Let X represent the number of relays working correctly. The required hypotheses are:
X B(150, p)
H0 : p = 0.90
H1 : p > 0.90
We perform a one-tailed test with critical value Z = 1.645. The necessary calculations are:
= np = 150 0.90 = 135
HELM (2005):
Section 41.2: Tests Concerning a Single Sample
11
np n
s=
n np 1
In cases where the size of the population np is large in comparison to the sample size n, the quantity
np n
1
np 1
x
, for populations of size np ;
np n
n np 1
or
Z=
x
, for very large populations.
We may now set up an alternative hypothesis which can take one of the three forms:
H1 : x =
H1 : x >
H1 : x <
depending on the result we are looking for. A decision at the 5% level of signicance may be made
depending on whether:
|Z| > 1.645 for a two-tailed test;
Z > 1.96
Z < 1.96
In each case Z will lie in the remote tail(s) of the standard normal distribution and we would reject
the null hypothesis in favour of the alternative hypothesis at the 5% level of signicance.
In the case where n is small, (n < 30) the distribution of sample means in not normally distributed
and we need to consider the following:
12
HELM (2005):
Workbook 41: Hypothesis Testing
x
has a normal distribution
/ n
x
approximates to Students t-distribution.
s/ n
Note that for large samples the two cases dier little but that the dierences are important if the
sample size is small. In this case we can still use the alternative hypotheses stated above but in
conjunction with the t-values:
x
|t| =
s/ n
Note that we must use these values of t in conjunction with tabulated values of t and take the
number of degrees of freedom to be n 1 where n is the sample size.
So that they are available when you need them, the percentage points of the t-distribution, along
with a copy of the standard normal distribution tables (Tables 1 and 2) are included at the end of
this Workbook.
Example 1
Dishwasher powder is poured into the cartons in which it is sold by an automatic
dispensing machine which is set to dispense 3 kg of powder into each carton. In
order to check that the dispensing machine is working to an acceptable standard
(i.e. does not need adjustment), a production engineer takes a random samples
of 40 cartons and weighs them. It is found that the mean weight of the sample
is 3.005 kg. It is known that the dispensing machine operates with a variance of
0.0152 kg2 and that the manufacturer of the powder is willing to rely on a 5%
level of signicance. Does the sample provide the engineer with sucient evidence
that the machine is operating acceptably and so does not need adjustment?
Solution
Given that the dispensing machine can over-ll or under-ll the containers, the null and alternative
hypotheses are:
H0 : x = 3
H1 : x = 3
Since the sample size is large ( 30) and we can regard the population as innite but with a known
variance, we can calculate the relevant value of the test statistic Z by using the formula:
x
Z=
/ n
Hence, in this case:
3.005 3
x
= 2.108
Z= =
/ n
0.015/ 40
and since we are performing a two-tailed test at the 5% level of signicance and have found that
|Z| > 1.645, that is, Z is outside the range [1.645, 1.645], we must reject the null hypothesis and
conclude that the machine is not operating acceptably and needs adjustment.
HELM (2005):
Section 41.2: Tests Concerning a Single Sample
13
n
so that we can closely approximate the population standard deviation as
n
=s
n1
s2
the
notation indicating that we are eectively estimating the population standard deviation. The
n
factor
is called Bessels correction. Note that as the sample size increases
n1
n
1
n1
n
1.017
and that for n = 30
n1
Essentially, for sample sizes larger than 30 we can neglect Bessels correction although we must take
it into account for small samples or errors will be introduced into any calculations made which may
have an eect on decisions made when performing hypothesis tests.
For large samples ( unknown) the equation for Z quoted previously becomes
Z=
s/ n
s/ n 1
For small samples Bessels correction must be taken into account. If the population distribution is
normal, then the means of small samples follow a normal distribution. If the population is not normal,
there is nothing we can say in general about the distribution of the means of small samples.
In summary we have the following.
Population Variance Sample size
Test
Normal
Known
Small
Normal (Z)
Normal
Known
Large
Normal (Z)
Normal
Unknown
Small
t
Normal
Unknown
Large
t but Z approximates
Not Normal
Either
Small
Non-parametric
Not Normal
Known
Large
Z approximates
Not Normal Unknown
Large
Z and t approximate
Non-parametric testing is covered in
14
45.
HELM (2005):
Workbook 41: Hypothesis Testing
Example 2
The average useful life of a random sample of 33 similar calculator batteries taken
from a batch of 100 is found to be 99.5 hours continuous use. The batch is
classed as unsuitable for production purposes if the mean lifetime of the batch
under conditions of continuous usage is signicantly less than the population mean
of 100 hours. If the variance of the sample lifetime is 18.49 hours2 , determine, at
the 5% level of signicance, whether the batch is suitable for production purposes.
Solution
The null and alternative hypotheses are:
H0 : x = 100
H1 : x < 100
Since the sample size may be taken as large (33) and the population small (100) and we have
to estimate the population variance from the sample variance, we calculate Z using the formula
previously used in conjunction with nite populations
x
Z=
s
np n
n
np 1
In this case
Z =
x
s
np n
n
np 1
99.5 100
18.49 100 33
100 1
33
= 0.812
and since we are performing a one-tailed test and have found that 1.645 < 1.319 we conclude
that the value of Z is not in the remote tails of the A N (0, 1) and that, at the 5% level of
signicance the batch is suitable for production purposes.
HELM (2005):
Section 41.2: Tests Concerning a Single Sample
15
Task
Solve the problem given at the start of subsection 2 (page 11). Note the sample
is small and you will have to estimate the population variance from the sample
variance. Use the tabulated values of the t-distribution given at the end of this
Workbook in conjunction with the appropriate number of degrees of freedom.
Your solution
Answer
The null and alternative hypotheses are:
H0 : = 110
H1 : > 110
0.1 7
110.1 110
x
=
=
|t| =
= 1.415
0.187
s/ n 1
0.035/ 7
At the 5% level of signicance and using 8 1 = 7 degrees of freedom, the value of t, from tables
is 1.895. Since 1.415 < 1.895, we cannot reject the null hypothesis in favour of the alternative
hypothesis. On the basis of the evidence available, we are not able to conclude that the boiling
point of the coolant is greater than 110 C.
16
HELM (2005):
Workbook 41: Hypothesis Testing
Example 3
In order to test the hypothesis that two standard turbochargers A and B have
the same throttle reaction times, a random sample of 7 cars were tted with
the turbochargers and the throttle reaction times measured. The results were as
follows:
Car
1
2
3
4
5
6
7
Throttle Reaction time for A; R1 0.223 0.212 0.201 0.205 0.216 0.211 0.209
Throttle Reaction time for B; R2 0.208 0.207 0.203 0.204 0.205 0.202 0.206
D = R1 R2
0.015 0.005 0.002 0.001 0.011 0.009 0.003
Solution
Let D be the dierence between the throttle reaction times of the two turbochargers. We assume
that the distribution of D is normal. Let d be the sample mean. We must decide between the two
hypotheses:
H0 : d = 0
H1 : d = 0
d is the mean of the 7 dierences and the alternative hypothesis dictates that we perform a twotailed test. The sample size of 7 gives us 6 degrees of freedom so that the 5% critical values (from
tables) are +2.447 and 2.447. The sample mean is calculated as
d
0.042
d =
=
= 0.006
7
7
The value of t is given by:
d 0
0.006
= 2.658
|t| =
=
s/ n 1
0.00552914/ 6
Since 2.658 > 2.447, we reject H0 and conclude that, on the basis of the evidence available, there
is a dierence in the throttle reaction times of the two turbochargers at the 5% level of signicance.
HELM (2005):
Section 41.2: Tests Concerning a Single Sample
17
Task
Two dierent methods of analysis were used to determine the levels of impurity
present in a particular aircraft quality aluminium alloy. Eight specimens were
analysed using both methods. Does the available evidence suggest that both
methods lead to the same results
Alloy Specimen
1
2
3
4
5
6
7
8
Test 1
1.24 1.23 1.24 1.20 1.21 1.22 1.23 1.22
Test 2
1.23 1.20 1.20 1.21 1.20 1.20 1.21 1.25
D = Test1 Test2 0.01 0.03 0.04 0.01 0.01 0.02 0.02 0.03
Your solution
Answer
Let D be the dierence between the two methods of analysis. We assume that the distribution of
D is normal. Let d be the sample mean. We must decide between the two hypotheses:
H0 : d = 0
H1 : d = 0
d is the mean of the 8 dierences and the alternative hypothesis dictates that we perform a twotailed test. The sample size of 8 gives us 7 degrees of freedom so that the 5% critical values (from
tables) are +2.365 and 2.365. The sample mean is calculated as
d
d=
= 0.01125
8
The value of t is given by:
d 0
0.01125
= 1.426
|t| =
=
s/ n 1
0.02087912/ 7
Since 2.306 < 1.426 < 2.306, we do not have the evidence to reject H0 and conclude that, on
the basis of the evidence available, there is no dierence between the two methods of analysis at
the 5% level of signicance.
18
HELM (2005):
Workbook 41: Hypothesis Testing