Hypothesis Testing: 10.1 Testing The Mean of A Normal Population
Hypothesis Testing: 10.1 Testing The Mean of A Normal Population
Hypothesis testing
A statistical hypothesis is a statement about a set of population parameters. It is not known whether
or not it is true.
A hypothesis is made about the value of some parameter but the only facts available to estimate the
true parameter are those provided by the sample. If the statistic differs from the hypothesis made
about the parameter a decision must be made as to whether or not this difference is significant. If the
difference is significant the hypothesis is rejected. If it is not, we fail to reject the hypothesis.
H0 is the Null hypothesis. It contains the hypothesized parameter value to be compared with the
sample value. H1 is the Alternative hypothesis.
Two types of errors can occur; Type I error occurs if we reject H0 when it is correct.Type II error
occurs if we accept H0 when it is false. α is the significance level. It is the threshold for rejecting H0 .
It is also the probability of type I error.
Hypothesis tests can be one-tailed or two-tailed
• Make a decision.
Hypothesis tests can also be done using p-values and confidence intervals.
1
For a one-sided test; We test
H0 : µ ≤ µ0
vs
H1 : µ > µ0
.
To test
H0 : µ ≥ µ0
vs
H1 : µ < µ0
.
NOTE:
1. To test the hypothesis using the p-value;
P-value= 2 ∗ P(Z > Zcomputed ) for the two-sided test
P-value= P(Z > Zcomputed ) for the one-sided test
We reject H0 if p-value< α.
2. To test the hypothesis using the confidence interval, obtain the 100(1 − α)% CI and reject H0
if µ0 is not in the interval.
Solution
Test
H0 : µ = 8
vs
H1 : µ 6= 8
2
α = 0.05
Solution
Test
H0 : µ = 70
vs
H1 : µ > 70
α = 0.05
There is strong evidence to support the claim that the mean lifespan is greater than 70years.
3
Exercise
A pharmaceutical company claims that each of its pills contains exactly 20mg of a blood thinner. A
sample of 64 pills produced a mean of 20.5mg and a sample standard deviation of 0.80mg.Should the
company’s claim be rejected? Test at α = 0.05
NOTE: When the sample is large i.e n ≥ 30 we assume that s2 is close to σ 2 and use the Z test.
Example 1
An institute has published figures on the annual No. of kilowatt hours expended by various home ap-
pliances.It is claimed that the vacuum cleaner expends an average of 46Kwhrs/year. If a random sam-
ple of 12 homes indicates an average of 42Kwhrs/year with a standard deviation of 11.9Kwhrs/year
does this suggest at 0.05 level that vacuum cleaners expend on average less than 46Kwhrs/year? As-
sume the population of kilowatt hours to be normal.
Solution
Test
H0 : µ = 46
vs
H1 : µ < 46
α = 0.05
tcomputed > −tα,n−1 i.e −1.1644 > −1.796 therefore fail to reject H0
There is not enough evidence to support the claim that vacuum cleaners expend on average less than
46kwhrs/year.
Example 2
A public health official claims that the mean home water use is 350 gallons a day.To verify this claim
a study of 20 randomly selected homes was done and it gave the following data.
340 356 332 362 318
344 386 402 322 360
362 354 340 372 338
375 364 355 324 370
Do the data contradict the official’s claim?Test at 10% level of significance.
4
Solution
Test
H0 : µ = 350
vs
H1 : µ 6= 350
α = 0.05
tcomputed < t α2 ,n−1 i.e 0.7778 < 1.73 therefore fail to reject H0
Exercise
1. Suppose that an engineer is interested in testing the bias in a pH meter. Data is collected on a
neutral substance(pH=7.0). A sample of the measurements were
7.07, 7.03, 7.00, 7.01, 7.10, 7.01, 6.97, 6.98, 7.00, 7.08
2. Manufacturers of a new tire claim that its average life will be at least 40,000miles. To verify
this claim a sample of 12 tires are tested and produce the data below.
Tire 1 2 3 4 5 6 7 8 9 10 11 12
0
Li f e(in 000 s) 36.1 40.2 33.8 38.5 42 35.8 37 41 36.8 37.2 33 36
Independent samples
Case 1: Population variances are known
Suppose X1 , X2 , ..., Xm and Y1 ,Y2 , ...,Yn are independent samples from two normal populations with
unknown means µx , µy and known variances σx2 , σy2 . We test
H0 : µx = µy
5
vs
H1 : µx 6= µy
which is the same as testing
H0 : µx − µy = 0
vs
H1 : µx − µy 6= 0
We compute the test statistic
X̄ − Ȳ
Zcomp = q
σx2 σy2
m + n
Reject H0 if |Zcomp | > Z α2
Example
Two methods for producing a tire have been proposed.The first set is tested at location A and the
second set at location B.Lifetime of tires tested at location A is normally distributed with unknown
mean µA and standard deviation=4,000.Lifetime of tires tested at location B is normally distributed
with unknown mean µB and standard deviation=6,000.The manufacturer is interested in testing the
hypothesis that there is no difference in the mean life of tires tested at either location.What conclusion
can be drawn at 5% level of significance if the following samples are used?
6
We compute the test statistic
X̄ − Ȳ
tcomp = q
s2p ( m1 + n1 )
where
(m − 1)s2x + (n − 1)s2y
s2p =
m+n−2
The critical value becomes t α2 ,m+n−2
NOTE: When the variances are unknown and unequal we use the Welch test.
Example
Twenty-two volunteers at a cold research institute caught a cold after having been exposed to various
cold viruses. A random selection of 10 of these volunteers was given tablets containing 1 gram of
vitamin C. These tablets were taken four times a day.
The control group consisting of the other 12 volunteers was given placebo tablets that looked and
tasted exactly the same as the vitamin C tablets. This was continued for each volunteer until a doctor,
who did not know if the volunteer was receiving the vitamin C or the placebo tablets, decided that the
volunteer was no longer suffering from the cold. The length of time the cold lasted was then recorded.
At the end of this experiment, the following data resulted
Solution: Test
H0 : µ p ≤ µc vs H1 : µ p > µc
X sample corresponds to those receiving vitamin C and the Y sample to those receiving a placebo.
6.450 − 7.125
tcomp = q = −1.90
1 1
0.689( 10 + 12 )
tα,m+n−2 = t0.05,20 = 1.725
7
tcomp < −tα,m+n−2
thus reject H0 . At the 5% level of significance the evidence is significant in establishing that vitamin
C reduces the mean time that a cold persists.
Example
An industrial safety program was recently instituted in the computer chip industry. The average
weekly loss (averaged over 1 month) in labor-hours due to accidents in 10 similar plants both before
and after the program are as follows:
Solution: Test
H0 : µA − µB ≥ 0 vs H1 : µA − µB < 0
tcomp = −2.266
p-value = P(t ≤ −2.266) = 0.025
Since the p-value is less than 0.05, the hypothesis that the safety program has not been effective is
rejected.
NOTE: The paired t-test can be used even when the population variances are unequal.
8
Exercises
1. A small bakery sells cookies in packages of 500g. The cookies are handmade and the packag-
ing is either done by the baker himself or his wife. Some customers conjecture that the wife is
more generous than the baker. One customer does an experiment: he buys packages of cookies
packed by the baker and his wife on 16 different days and weighs the packages. He gets the
following two samples
Weight(wife) (X) 512 530 498 540 521 528 505 523
Weight(baker) (Y) 499 500 510 495 515 503 490 511
Test whether the complaint of the customers is justified.
2. In an experiment, 10 students have to solve different tasks before and after drinking a cup of
coffee. Let Y and X denote the random variables “number of points before/after drinking a cup
of coffee”. The data is given in the following table:
yi (before) xi (after)
4 5
3 4
5 6
6 7
7 8
6 7
4 5
7 8
6 5
2 5
Test whether drinking coffee increases the problem-solving capacity of the students.
(n − 1)s2 2
∼ χ(n−1)
σ2
When H0 is true then
(n − 1)s2 2
∼ χ(n−1)
σ02
We accept H0 if
2 (n − 1)s2
χ(1− α
,n−1) < 2
< χ(2α ,n−1)
2 σ0 2
The p-value
2 (n − 1)s2 2 (n − 1)s2
p-value = 2min{P(χ(n−1) < ); 1 − P(χ(n−1) < )}
σ02 σ02
9
Example
A machine that automatically controls the amount of ribbon on a tape has recently been installed.
This machine will be judged to be effective if the standard deviation σ of the amount of ribbon on a
tape is less than 0.15 cm. If a sample of 20 tapes yields a sample variance of s2 = 0.025cm2 , are we
justified in concluding that the machine is ineffective? Test at 5% level of significance.
Solution
We test
H0 : σ 2 ≤ 0.152 vs H1 : σ 2 > 0.152
Computed value=
(n − 1)s2 19(0.025)
= = 21.111
σ02 0.0225
The critical value (one sided test)
2
χα,n−1 = 30.144
2
Computed value < χα,n−1 accept H0 The machine is effective.
Exercise
A manufacturer of car batteries claims that the life of his batteries is approximately normally dis-
tributed with σ = 0.9years. If a random sample of 10 of these batteries has a standard deviation of
1.2 years, do you think that the standard deviation is more than 0.9? Test at α = 0.05.
Example
There are two different choices of a catalyst to stimulate a certain chemical process. To test whether
the variance of the yield is the same no matter which catalyst is used, a sample of 10 batches is
produced using the first catalyst, and 12 using the second.If the resulting data are s21 = 0.14 and
s22 = 0.28 can we reject, at the 5% level, the hypothesis of equal variance?
10
Solution
We test
H0 : σ12 = σ22 vs H1 : σ12 6= σ22
n1 = 10, n2 = 12,
s21 0.14
Computed value: = = 0.5
s22 0.28
1
Critical values: F0.025,9,11 = 3.59 and F0.975,9,11 = = 0.2554
3.915
Fail to reject H0
Example
An experiment was performed to compare the abrasive wear of 2 different laminated materials. 12
pieces of material1 and 10 pieces of material2 were tested. The samples of material1 gave an average
wear of 85 units with a standard deviation of 4 while the samples of material2 gave an average wear
of 81 units with a standard deviation of 5. Can we conclude at 5% significance level that;
a) The abrasive wear of material1 exceeds that of material2 by more than two units? Assume the
populations to be approximately normal with equal variances.
b) Are we justified in making the assumption of equal variance in part a?Test at 10% level of sig-
nificance.
Solution
a) We test
H0 : µ1 − µ2 = 2 vs H1 : µ1 − µ2 > 2
n1 = 12, n2 = 10, X¯1 = 85, X¯2 = 81, s1 = 4, s2 = 5
(X¯1 − X¯2 ) (85 − 81) − 2
tcomp = q =q = 1.043
s2p ( n11 + n12 ) 1
20.05( 12 1
+ 10 )
where
(11 ∗ 42 ) + (9 ∗ 52 )
s2p = = 20.05
12 + 10 − 2
Critical value: tα,n1 +n2 −2 = t0.05,20 = 1.725
Fail to reject H0 . There is not enough evidence to conclude that abrasive wear of material1 exceeds
that of material2 by more than two units
b)We test
H0 : σ12 = σ22 vs H1 : σ12 6= σ22
s21 42
Computed value: = = 0.64
s22 52
1
Critical values: F0.05,11,9 = 3.105 and F0.95,11,9 = = 0.3448
2.90
Fail to reject H0
11
10.3 Testing the proportion of a normal population
We test
H0 : p = p0
vs
H1 : p 6= p0
The test statistic to be used is Z IFF n is large and np0 (1 − p0 ) ≥ 10
Example 1
A commonly prescribed drug for relieving nervous tension is believed to be only 60% effective.
Experimental results with a new drug administered to a random sample of 100 adults who were
suffering from nervous tension show that 70 received relief. Is this sufficient evidence to conclude
that the new drug is superior to the one commonly prescribed? Use a 0.05 level of significance.
Solution
1. We test
H0 : p = 0.6
vs
H1 : p > 0.6
2. Critical value
Zα = Z0.05 = 1.645
70
3. p = = 0.7 Hence
100 √
(0.7 − 0.6) 100
Zcomputed = p = 2.04
0.6(0.4)
Since |Zcomputed | > Z α2 we reject H0 and conclude that the new drug is superior.
Example 2
Assume that a representative sample of size n = 2000 has been drawn from a population of eligible
voters, from which 700 (35%) have voted for the party of interest P. The research hypothesis (which
has to be stated as H1) is that more than 30% (i.e. p0 = 0.3) of the eligible voters cast their votes for
party P. Test this hypothesis at 0.05 level of significance.
12
Solution
Conduct a binomial test. Since n is large and np(1 − p) = 2000(0.35)(0.65) = 455 ≥ 9, the assump-
tions for the use of the test statistic are satisfied.
1. We test
H0 : p = 0.3
vs
H1 : p > 0.3
2. Critical value
Zα = Z0.05 = 1.645
3. p = 0.35 Hence √
(0.35 − 0.3) 2000
Zcomputed = p = 4.8795
0.3(0.7)
Since |Zcomputed | > Z α2 we reject H0 and conclude that the proportion of votes for party P is
greater than 30%..
13