Chapter 10: Hypotheses Testing
Dr. Noha Youssef
Department of Mathematics and Actuarial Science, AUC
1 Introduction
• We are always interested about the unknown parameters of the population of interest.
• Our parameters of interest in this course are the population mean, µ, the proportion in the
population π, difference between two population means µ1 − µ2 and the difference between
two population proportions π1 − π2 .
• Usually we have some claims about the value of this unknown parameters, e.g. the population
mean of the statistics grades µ is equal 60.
• These claims are called Hypotheses.
• The Hypothesis is a statement about the unknown parameter.
• To check whether the claim is right or wrong we test the Hypothesis.
2 Hypothesis testing for the population mean µ
Before we proceed you need to understand the following:
• First: H0 is the the null hypothesis
• Second: H1 is the the alternative hypothesis
• Third: The null hypothesis H0 and the alternative hypothesis can take any of the three cases
Two tail test One tail test One tail test
H0 : µ = a H0 : µ ≥ a H0 : µ ≤ a
H1 : µ 6= a H1 : µ < a H1 : µ > a
• The null hypothesis H0 always has the equality sign.
• To check our claim we need a sample from the population of interest.
• We compute the corresponding estimator from the sample which is the sample mean x̄ in our
case.
1
• We use this estimator to compute what’s called the test statistic which is used to choose
between the two competing hypothesis.
• After performing the test: If the null hypothesis H0 is rejected then we call the test a significant
test as the sample provides us with a significant evidence against the null hypothesis. If the
null hypothesis is not rejected then we call the test an insignificant test.
• After taking your decision you draw some conclusions about your data.
3 Steps of testing hypothesis
1. Define and write your H0 and H1 .
x̄−µ
2. Compute your test statistic t or zaccording to the table used in the test = S.E(x̄) .
3. This test statistic t needs to be compared with a critical value c obtained from the normal or
t tables.
4. This critical value c depends on your pre-specified significance level α which is usually any of
0.05, 0.1 or 0.01.
5. If the sample size is big n > 30 we get the critical values corresponding to these significance
level from the normal or t tables via finding the value c in this probability P (T > c) = α, e.g.
P (Z > z) = 0.025, then z = 1.96.
6. We will explain everything on normal and what applies to normal applies to t.
• If the test is a two tail test then we need to get the value z for P (Z > z) = α/2
• If the test is a one tail test then we need to get the value z for P (Z > z) = α
• One way to take the decision is to compare the value of the test statistic with z and for
which we have 3 cases
(a) For the case where H1 : µ 6= a we reject H0 if |test statistic value| > z i.e. test statistic value <
−z or test statistic value > z
(b) For the case where H1 : µ > a we reject if test statistic value > z
(c) For the case where H1 : µ > a we reject if test statistic value < −z
• We use normal table in all cases except when the sample is coming from normal distri-
bution, the population standard deviation σ is unknown and the sample size is less than
30. To get the value from the t-table you need to determine your significance level and
your degrees of freedom which are in the case of one population mean n − 1.
7. After taking the decision with rejecting or not rejecting (we don’t say accept) we draw the
conclusion based on the original context.
2
4 Tests for other population parameters
• What is applied to the population applies to the other parameters of interest we only change
the following
1. The parameters used in H0 and H1 .
2. The test statistic used which is in general given by
point estimate − assumed value in H0
test statistic = .
SE(estimator)
3. e.g. For testing the difference between two population means, the test statistic is given
¯
by t = X
q1 −2X̄2 −a
σ σ2
.
1+ 2
n1 n2
4. You need to refer to the following table
q
5. For the difference between two population proportions you use p̄(1 − p̄) · ( n11 + 1
n2 ) as
x1 +x2
the standard error of p1 − p2 where p̄ = n1 +n2 ,
where x1 and x2 are the number of success
in both samples.
6. We use the normal table except in the cases where the samples are coming from normal
distribution, population standard deviations are unknown and the sample sizes are less
than 30 we use the t table. In this case of two populations we use the pooled variance
(n −1)s21 +(n2 −1)s22
given by 1 n1 +n 2 −2
.
5 Types of Errors in testing of hypotheses
• A Type I error occurs if we reject a null hypothesis that is true; this happens with probability
α.
3
• A Type II error occurs if we fail to reject a null hypothesis that is false; this happens with
probability β.
6 Some remarks on the significance level
• If the test is significant (rejecting H0 ) at a significance level α = .1 this does not imply that
it will be significant at smaller significance levels such as α = 0.5, 0.01.
• But if it is significant at level α = 0.01 this implies that the test is significant at the bigger
significance levels α = 0.05, 0.1. We will call this a highly significant test.
7 Some values to remember
Two tail test α = 0.1 Z0.05 = ±1.645
α = 0.05 Z0.025 = ±1.96
α = 0.01 Z0.005 = ±2.576
One tail left side α = 0.1 Z0.90 = −1.28
α = 0.05 Z0.95 = −1.645
α = 0.01 Z0.99 = −2.33
One tail right side α = 0.1 Z0.1 = 1.28
α = 0.05 Z0.05 = 1.645
α = 0.01 Z0.01 = 2.33
4
8 Examples
8.1 Example
A vice president in charge of sales for a large corporation claims that salespeople are averaging no
more than 15 sales contacts per week (He would like to increase this figure). As a check on his claim,
36 salespeople are selected at random, and the number of contacts made by each is recorded for a
single randomly selected week. The mean and the variance of the 36 measurements were 17 and 9,
respectively. Does the evidence contradict the vice president’s claim? Use a test with significance
level 0.05.
Sol:
1. Hypotheses: H0 : µ ≤ 15 H1 : µ > 15
X̄−µ 17−15
2. Test statistic: z = √s
= 3 =4
n 6
3. Rejection area: α = 0.05, it is a one tail test to the right, we compare 4 with the value from
the normal table corresponding to the area of 0.05 which is equal to 1.645, 4 > 1.645.
4. Decision: since 4 > 1.645, so 4 is falling in the rejection area and the decision is to reject H0 .
5. Conclusion:We rejected H0 so it is false, then at α = 0.05 and based on our sample results we
conclude that salespeople are not averaging no more than 15, they are averaging more than
15.
8.2 Example
A machine in a factory must be repaired if it produces more than 10% defectives among the large
lot of items it produces in a day. A random sample of 100 items from the day’s production contains
15 defectives, and the supervisor says that the machine must be repaired. Does the sample evidence
support his decision? Use a test level 0.01.
Sol:
1. Hypotheses: H0 : π ≤ 0.1 H1 : π > 0.1
2. Test statistic: z = q p−π 0.15−0.1
=q = 1.67
π(1−π) 0.1(0.9)
n 100
3. Rejection area: α = 0.01, it is a one tail test to the right, we compare 4 with the value from
the normal table corresponding to the area of 0.01 which is equal to 2.33, 1.67 < 2.33.
4. Decision: since 1.67 < 2.33, so 1.67 is falling in the non-rejection area and the decision is to
fail to reject H0 .
5. Conclusion:We failed to reject H0 so it is true, then at α = 0.01 and based on our sample
results we conclude that machine doesn’t have to be prepared.
5
8.3 Example
A psychological study was conducted to compare the reaction times of men and women to a stimulus.
Independent random samples of 50 men and 50 women were employed in the experiment. The men
have a sample mean 3.6 seconds of and a sample variance of 0.18 and the women have a sample
mean of 3.8 and a variance of 0.14. Do the data present sufficient evidence to suggest a difference
between true mean reaction times for men and women? Use α = 0.05.
Sol:
1. Hypotheses: H0 : µm − µw = 0 H1 : µm − µw 6= 0
2. Test statistic: z = X̄
qm −X̄w −0 = −2.5
2 2
sm s
nm
+ nw
w
3. Rejection area: α = 0.05, it is a two tail test, we compare -2.5 with the value from the normal
table corresponding to the area of 0.025 which is equal to -1.96, −2.5 < −1.96.
4. Decision: since −2.5 < −1.896, so -2.5 is falling in the rejection area and the decision is to
reject H0 .
5. Conclusion:We rejected H0 so it is false, then at α = 0.05 and based on our sample results we
conclude that the average reaction time for men is different from the average reaction time
for women.
8.4 Example
As part of her senior project, a marketing major at North Texas State University in Denton, Texas,
surveyed 100 men and 100 women at a local shopping mall regarding their buying habits. Of the
men, 79 said they had used a credit card to make a purchase over 10 dollars in the past month,
while 84 of the women admitted to this type of purchase. At the 5% level does this support the
claim that women are more likely to use credit?
Sol:
1. Hypotheses: H0 : πw − πm ≤ 0 H 1 : πw − πm > 0
pw −pw −0 0.84−0.79
2. Test statistic: z = q =p 2
= 0.91
p̄(1−p̄)·( n1 + n1 ) 0.815(1−0.815)· 100
w m
3. Rejection area: α = 0.05, it is a one tail test, we compare 0.91 with the value from the normal
table corresponding to the area of 0.05 which is equal to 1.645, 0.91 < 1.645.
4. Decision: since 0.91 < 1.645, so 0.91 is falling in the non-rejection area and the decision is to
fail to reject H0 .
5. Conclusion:We failed to reject H0 so it is true, then at α = 0.05 and based on our sample
results we conclude that the difference between the two population proportions is less than or
equal to zero which implies that women are not more likely to use the credit card.
6
8.5 Example
A manufacturer of gun powder has developed a new powder, which was tested in eight shells. The
resulting muzzle velocities, in feet per second, were as follows: 3005, 2925, 2935, 2965, 2995, 3005,
2937, 2905. The manufacturer claims that the new gunpowder produces an average velocity of
not less than 3000 feet per second. Do the sample data provide sufficient evidence to contradict
the manufacturer’s claim at the 0.025 level of significance? Assume that muzzle velocities are
approximately normally distributed.
Sol:
P
Xi
1. We calculate both sample mean and sample variance using the following rules X̄ = n and
1
sample variance s2 = n−1
P 2
X − ( X)2 /n
P
2. X̄ = 2959 s2 = 1528, s = 39.1
3. Hypotheses: H0 : µ ≥ 3000 H1 : µ < 3000
X̄−µ
4. Test statistic: z = √
39.1/ 8
= −2.96
5. Rejection area: α = 0.025, it is a one tail test, we compare -2.96 with the value from the
t table with degrees of freedom 8-1=7 corresponding to the area of 0.025 which is equal to
-2.365, −2.96 < −2.365.
6. Decision: since −2.96 < −2.365, so -2.96 is falling in the rejection area and the decision is to
reject H0 .
7. Conclusion:We rejected H0 so it is false, then at α = 0.025 and based on our sample re-
sults we conclude that the population mean is less than 3000 and we don’t agree with the
manufacturer’s claim.
8.6 Example
To reach maximum efficiency in performing an assembly operation in a manufacturing plant, new
employees require approximately a 1-month training period. A new method of training was sug-
gested, and a test was conducted to compare the new method with the standard procedure. Two
groups of nine new employees each were trained for a period of 3 weeks, one group using the new
method and the other following the standard training procedure. The length of time (in minutes)
required for each employee to assemble the device was recorded at the end of the 3-week period.
The resulting measurements are as shown in the following table. Is there sufficient evidence to
indicate a difference in true mean times for the two methods? Take α = 0.05. Assume that the
assembly times are approximately normally distributed and that the variances of the assembly times
are approximately equal for the two methods.
Standard 31 37 35 28 41 44 35 31 34
New 35 31 29 25 34 40 27 32 31
7
Sol:
P
Xi
1. We calculate both sample means and sample variances using the following rules X̄ = n
1
and sample variance s2 = n−1
P 2
X − ( X)2 /n
P
2. X̄s = 35.2, X̄n = 31.6 s2s = 24.4, s2n = 20.03
3. The pooled variance is calculated s2p = 25.4
4. Hypotheses: H0 : µs − µn = 0 H1 : µs − µn 6= 0
X̄s −X̄n
5. Test statistic: z = q 2 2
= p35.2−31.6
25.4 25.4
= 1.54
sp s +
9
+ 9p 9 9
6. Rejection area: α = 0.05, it is a two tail test, we compare 1.54 with the value from the t
table with degrees of freedom 9+9-2=16 corresponding to the area of 0.025 which is equal to
±2.120, 1.54 < 2.120.
7. Decision: since 1.54 < 2.120, so it is falling in the non-rejection area and the decision is to
fail to reject H0 .
8. Conclusion:We failed to reject H0 so it is true, then at α = 0.05 and based on our sample
results we conclude that there is no difference between the two population means.