Applied Statistics: Testing of Hypotheses
Applied Statistics: Testing of Hypotheses
Applied Statistics: Testing of Hypotheses
Testing of Hypotheses
Testing of Hypotheses is one of the most important aspects of the theory of decision-making, where the
decision made by a decision maker depends primarily on the strength of the evidence thrown up by a random
sample drawn from a population.
What is a Hypothesis?
A hypothesis is something that has not yet been proven to be true. It is some statement about a population
parameter.
In any testing of hypotheses problem, we are faced with a pair of hypotheses such that one and only one
of them is always true. One of this pair is called the null hypothesis and the other one the alternative
hypothesis.
A null hypothesis denoted H0, is the statement about the population parameter that is assumed to be
true unless there is convincing evidence to the contrary.
The alternative hypothesis denoted H1, is a statement about the population parameter that is
contradictory to the null hypothesis, and is accepted as true only if there is convincing evidence in
favor of it.
Illustrative examples:
A manager in a company claims that the average time taken to maintain any machine is less than 12
hours.
H 0 : μ=12
H 1 : μ< 12
An electric battery manufacturer claims that the average battery life is more than 1.5 years.
H 0 : μ=1.5
H 1 : μ> 1.5
An investor claims that the average profit percentage from investing in Saudi stocks is not equal to 0.10
H 0 : μ=10
H 1: μ ≠ 1 0
What is Testing of Hypotheses?
Hypothesis testing is a statistical procedure in which a choice is made between a null hypothesis and an
alternative hypothesis based on information in a sample.
1
Applied Dr. Mahmoud Abd El-
Statistics Raouf
The end result of a hypotheses testing procedure is a choice of one of the following two possible conclusions:
1. Reject H0 (and therefore accept H1), or Fail to reject H0 (and therefore fail to accept H1).
There are four possible outcomes of hypothesis testing procedure, as shown in the following table:
States of Population
Decision based on Sample
H0 True H0 False
Accept H0 Correct decision (No Error) Wrong Decision (Type II Error)
Reject H0 Wrong Decision (Type I Error) Correct Decision (No Error)
Choosing α smaller in order to reduce the chance of making a Type I error has the effect of increasing the
chance of making a Type II error. The only way to simultaneously reduce the chances of making either kind
of error is to increase the sample size.
the null hypothesis is used to assume that there is no difference between the average of the sample and
the claimed mean of the population. ( H 0 : μ=μ0 )
H 1 is the alternative hypothesis of null hypothesis has three states
1. Assuming that the mean of a sample is less than the assumed mean of population. H 1 : μ< μ 0
2. Assuming that the mean of the sample is greater than the assumed mean of population. H 1 : μ> μ 0
3. Assume that the mean of a sample does not equal the assumed mean of population. H 1 : μ ≠ μ0
Step 2: Specify a level of significance α and critical value
2
Applied Dr. Mahmoud Abd El-
Statistics Raouf
The number α is the probability that the test procedure will result in a Type I error. It has several values
(5 % ,1 % , 0.1 % , … .) according to the sample confidence interval. Using α , we can determine the critical
value that is the value of (Z) corresponding to the probability of error ( α ) in the standard normal distribution
is called Z α .Values of Z α at different significance levels:
3
Applied Dr. Mahmoud Abd El-
Statistics Raouf
√ p0 (1−p 0)
n
Step 4: define the critical region in terms of the test statistic
To determine the rejection region, we must know the critical value. The critical value is the value of (Z)
corresponding to the probability of error (α ) in the standard normal distribution is called Z α
The rejection region for H 0 is determined according to the H 1 states
4
Applied Dr. Mahmoud Abd El-
Statistics Raouf
3. if H 1 : μ ≠ μ0, we reject H0 if Z<−Z α or Z> Z α , so the rejection region has the form of the union of two
2 2
intervals ¿ ∪ ¿ .
In this section we describe and demonstrate the procedure for conducting a test of hypotheses about the
mean of a population μ0in the case that the sample size n ≥ 30. to test the value of mean population follows
the normal distribution with known standard deviation σ .A random sample is selected with n ≥ 30 and
average sample X ,
The null hypothesis will have the form H 0 : μ=μ0 .
The alternative hypothesis will be one of the three inequalities μ< μ0 ∨μ > μ0 ,∨μ ≠ μ 0 .
This implies that the test statistic
X−μ0
Z=
σ
√n
If we do not know σ, then we replace it by the sample standard deviation s. Since the sample is large the
resulting test statistic still has a distribution that is approximately standard normal.
X−μ0
Z=
s
√n
and hypothesis tests are performed with the previous steps.
5
Applied Dr. Mahmoud Abd El-
Statistics Raouf
Example 1:
It is hoped that a newly developed pain reliever will more quickly produce perceptible reduction in pain to
patients after minor surgeries than a standard pain reliever. The standard pain reliever is known to bring relief
in an average of 3.5 minutes with standard deviation 1.5 minutes. To test whether the new pain reliever
works more quickly than the standard one, 50 patients with minor surgeries were given the new pain reliever
and their times to relief were recorded. The experiment yielded sample mean 3.1 minutes. Is there sufficient
evidence in the sample to indicate, at the 5% level of significance, that the newly developed pain reliever
does deliver perceptible relief more quickly?
Solution
Step 1: State the Null and the Alternate Hypotheses
H 0 : μ=3.5
H 1 : μ< 3.5
Step 2: Specify a level of significance α and critical value
at the 5% level of significance this is a left-tailed test, so there is a single critical value −Z α =−1.645
Step 3: Calculate the value of the test statistic
X−μ 3.1−3.5
Z= = =−1.886
σ 1.5
√n √50
Step 4: Define the critical region
6
Applied Dr. Mahmoud Abd El-
Statistics Raouf
Conclusion: the data provide sufficient evidence, at the 5% level of significance, to conclude that the
average time until patients experience perceptible relief from pain using the new pain reliever is smaller than
the average time for the standard pain reliever.
Example 2:
A cosmetics company fills its best-selling 8-ounce jars of facial cream by an automatic dispensing machine.
The machine is set to dispense a mean of 8.1 ounces per jar. Uncontrollable factors in the process can shift
the mean away from 8.1 and cause either underfill or overfill, both of which are undesirable. In such a case
the dispensing machine is stopped and recalibrated. Regardless of the mean amount dispensed, the standard
deviation of the amount dispensed always has value 0.22 ounce. A quality control engineer routinely selects
30 jars from the assembly line to check the amounts filled. On one occasion, the sample mean is 8.2 ounces.
Determine if there is sufficient evidence in the sample to indicate, at the 1% level of significance, that the
machine should be recalibrated.
Solution
Step 1: State the Null and the Alternate Hypotheses
H 0 : μ=8.1
H 1 : μ ≠ 8.1
Step 2: Specify a level of significance α and critical value
at the 1% level of significance this is a two-tailed test, so there are two critical values± Z α =± 2.576
2
7
Applied Dr. Mahmoud Abd El-
Statistics Raouf
Conclusion: The data do not provide sufficient evidence, at the 1% level of significance, to conclude that the
average amount of product dispensed is different from 8.1 ounce. We conclude that the machine does not
need to be recalibrated.
8
Applied Dr. Mahmoud Abd El-
Statistics Raouf
Example 3:
In a random sample consisting of recording 100 deaths in a village, it was found that the mean age in the
sample was 67.5 years, and the standard deviation was 8 years. Is the average age in this village greater than
65 years? Use a 5% level of significance.
Solution
Assume µ the average age in this village.
QUOTE H 0 : μ=65
H 1 : μ QUOTE >65
Right-side test and significance level α = 0.05 then the critical value is:
Z 0.05=1.64
:The test statistic value is
X−μ 67.5−865
Z= = =3.125
σ 8
√n 100
We find that the calculated value of 3.125 is greater than the tabular value 1.64. Therefore, the calculated Z
falls in the rejection region, so we can reject H 0.
It means that the average age in this village is more than 65 years.
Both the critical value approach can be applied to test hypotheses about a population proportion p.
The null hypothesis will have the form H 0 : p= p0 .
The alternative hypothesis will be one of the three inequalities p< p0 , p> p 0 ,∨ p ≠ p0 .
The test statistic has the standard normal distribution.
p−p 0
Z c=
√ p 0 ( 1−p 0 )
n
In the formula p0 is the numerical value of p that appears in the two hypotheses , p is the sample proportion,
and n is the sample size. The distribution of the standardized test statistic and the corresponding rejection
region for each form of the alternative hypothesis (left-tailed, right-tailed, or two-tailed)
Example 4:
9
Applied Dr. Mahmoud Abd El-
Statistics Raouf
A soft drink maker claims that more than 50% of adults prefer its leading beverage over that of its main
competitor’s. To test this claim 500 randomly selected people were given the two beverages in random order
to taste. Among them, 270 preferred the soft drink maker’s brand, 211 preferred the competitor’s brand, and
19 could not make up their minds. Determine whether there is sufficient evidence, at the 5% level of
significance, to support the soft drink maker’s claim against the default that the population is evenly split in
its preference.
Solution
270
p=50 %=0.5 ,n=500 , p= =0.54
500
Step 1: State the Null and the Alternate Hypotheses
H 0 : p=0.5
H 1 : μ> 0.5
Step 2: Specify a level of significance α and critical value
at the 5% level of significance this is right-tailed test, so there are one critical value Z α =1.645
Step 3: Calculate the value of the test statistic
p− p0 0.54−0.5
Z c= = =1.789
√ p 0 (1− p0 )
n √ 0.5 (1−0.5)
500
Step 4: Define the critical region
10
Applied Dr. Mahmoud Abd El-
Statistics Raouf
Example 5:
Globally the long-term proportion of newborns who are male is 51.46%. A researcher believes that the
proportion of boys at birth changes under severe economic conditions. To test this belief randomly selected
birth records of 5,000 babies born during a period of economic recession were examined. It was found in the
sample that 52.55% of the newborns were boys. Determine whether there is sufficient evidence, at the 10%
level of significance, to support the researcher’s belief.
Solution
p=51.46 %=0.5146 , n=5000 , p=0.52 .55 %=0.5255
Step 1: State the Null and the Alternate Hypotheses
H 0 : p=0.5146
H 1 : μ ≠ 0.5146
Step 2: Specify a level of significance α and critical value
at the 10% level of significance a two-tailed test, so there are a pair of critical values ± Z α =± 1.645
Step 3: Calculate the value of the test statistic
p− p0 0.5255−0.5146
Z c= = =1.542
√ p 0 (1− p0 )
n √ 0.5146 (1−0.5146)
5000
Step 4: Define the critical region
Example 6:
11
Applied Dr. Mahmoud Abd El-
Statistics Raouf
If the proportion of smokers in a city in 1974 was 28.8%, and in 1982 a sample of the population of this city,
1283 people, was selected, 320 people who were smokers. Did the percentage of smokers decrease between
1974 and 1982? Use the significance level of α = 0.05
Solution
H 0 : P=0. 288
H 1 : P<0 .288
Left -side test and significance level α = 0.05 then the critical value is:
−z α =−z 0.05=−1.645−Z 0.05=−1.645
The test statistic value is:
P−P0 320
Z= ,r= =0. 249
√
P0 (1−P0 ) 1283
n
0 .249−0 .288 −0. 039 −0 .039 −0 . 039
¿ = = = =−3 .9
√ √ √
0. 288(1−0. 288 ) 0 . 288×0 . 712 0 . 20 0 . 01
1283 1283 1283
We find that the calculated value of -3.9 is smaller than the tabular value 1.645. Therefore, the calculated Z
falls in the rejection region, so we can reject H 0.
That is, the percentage of smokers in the year 1982 is less than 28.8%, meaning that the proportion of
smokers decreased between the years 1974 and 1982 with 95% confidence.
12
Applied Dr. Mahmoud Abd El-
Statistics Raouf
1. A center of statistical research centers claimed that the average income of an employee in a
company is $ 1000 per month. a sample of employees is collected and restricted their income as
follows: Is the claim true or not?
70 50
1800 1700 1600 1500 1400 1300 1200 1100 1000 900 800 600 400
0 0
solution
H 0 : μ=1000
H 1 : μ ≠ 1000
After entering the data to be analyzed, From the Analyze menu, choose compare means and one-
sample T Test
13
Applied Dr. Mahmoud Abd El-
Statistics Raouf
This value indicates if there is a statistically significant difference between the claim and average
income.
14
Applied Dr. Mahmoud Abd El-
Statistics Raouf
If the value is greater than 0.05, then there is no statistically significant difference (we accept
nullity).
If the value is less than 0.05, then there are statistically significant differences (we reject the null
hypothesis).
P−value=0.401> 0.05
We accept H 0,the average employee income in the company is $ 1,000 per month
2. A company selling licenses for new e-commerce computer software advertises that firms using
this software obtain, on average during the first year, a yield of 10% on their initial investments.
A random sample of 10 of these franchises produced the following yields for the first year of
operation:
11. 10.
6.1 9.2 8.6 12.1 3.9 8.4 9.4 8.9
5 1
Assuming that population yields are normally distributed, test the company’s claim.
Solution
H 0 : μ=10
H 1 : μ ≠ 10
One-Sample Test
Test Value = 10
95% Confidence Interval of the Difference
t df Sig. (2-tailed) Mean Difference Lower Upper
yields -1.554 9 .155 -1.1800 -2.898 .538
t=−1.554
P−value=0.155>0.05
Decision: we can accept H 0
Then the average during the first year, a yield of 10% on their initial investments
3. A process that produces bottles of shampoo, when operating correctly, produces bottles whose
contents weigh, on average, 20 ounces. A random sample of nine bottles from a single production
run yielded the following content weights (in ounces):
21.4 19.7 20.6 20.8 20.1 19.7 20.3 20.9
15
Applied Dr. Mahmoud Abd El-
Statistics Raouf
Assuming that the population distribution is normal, test at the 5% level against a two-sided
alternative the null hypothesis that the process is operating correctly.
Solution
H 0 : μ=20
H 1 : μ ≠ 20
One-Sample Test
Test Value = 20
95% Confidence Interval of the Difference
t df Sig. (2-tailed) Mean Difference Lower Upper
weights 2.063 7 .078 .4375 -.064 .939
t=2.063
P−value=0.078>0.05
Decision: accept H 0. Then the process is operating correctly
4. A statistics instructor is interested in the ability of students to assess the difficulty of a test
they have taken. This test was taken by a large group of students, and the average score was
78.5. A random sample of eight students was asked to predict this average score. Their
predictions were as follows:
72 83 78 65 69 77 81 71
Assuming a normal distribution, test the null hypothesis that the population mean prediction
would be 78.5. Use a two-sided alternative and a 10% significance level.
Solution
H 0 : μ=78.5
H 1 : μ ≠ 78.5
One-Sample Test
Test Value = 78.5
90% Confidence Interval of the Difference
t df Sig. (2-tailed) Mean Difference Lower Upper
scores .948 7 .375 96.0000 -95.790 287.790
t=0.948
16
Applied Dr. Mahmoud Abd El-
Statistics Raouf
P−value=0.375>0.1
Decision: accept H 0. Then the population mean prediction would be 78.5
APPLICATIONS
1. In the past the average length of an outgoing telephone call from a business office has been 143 seconds.
A manager wishes to check whether that average has decreased after the introduction of policy changes.
A sample of 100 telephone calls produced a mean of 133 seconds, with a standard deviation of 35
seconds. Perform the relevant test at the 1% level of significance.
2. The average household size in a certain region several years ago was 3.14 persons. A sociologist wishes
to test, at the 5% level of significance, whether it is different now. Perform the test using the information
collected by the sociologist: in a random sample of 75 households, the average size was 2.98 persons,
with sample standard deviation 0.82 person.
3. An automobile manufacturer recommends oil change intervals of 3,000 miles. To compare actual
intervals to the recommendation, the company randomly samples records of 50 oil changes at service
facilities and obtains sample mean 3,752 miles with sample standard deviation 638 miles. Determine
whether the data provide sufficient evidence, at the 5% level of significance, that the population mean
interval between oil changes exceeds 3,000 miles.
4. A grocery store chain has as one standard of service that the mean time customers wait in line to begin
checking out not exceed 2 minutes. To verify the performance of a store the company measures the
waiting time in 30 instances, obtaining mean time 2.17 minutes with standard deviation 0.46 minute. Use
these data to test the null hypothesis that the mean waiting time is 2 minutes versus the alternative that it
exceeds 2 minutes, at the 10% level of significance.
5. The mean household income in a region served by a chain of clothing stores is $48,750. In a sample of 40
customers taken at various stores the mean income of the customers was $51,505 with standard deviation
$6,852.
17
Applied Dr. Mahmoud Abd El-
Statistics Raouf
a) Test at the 10% level of significance the null hypothesis that the mean household income of
customers of the chain is $48,750 against that alternative that it is different from $48,750.
b) The sample mean is greater than $48,750, suggesting that the actual mean of people who patronize
this store is greater than $48,750. Perform this test, also at the 10% level of significance. (The
computation of the test statistic done in part (a) still applies here.)
6. Five years ago 3.9% of children in a certain region lived with someone other than a parent. A sociologist
wishes to test whether the current proportion is different. Perform the relevant test at the 5% level of
significance using the following data: in a random sample of 2,759 children, 119 lived with someone
other than a parent.
7. Two years ago 72% of household in a certain county regularly participated in recycling household waste.
The county government wishes to investigate whether that proportion has increased after an intensive
campaign promoting recycling. In a survey of 900 households, 674 regularly participate in recycling.
Perform the relevant test at the 10% level of significance.
8. A report five years ago stated that 35.5% of all state-owned bridges in a particular state were “deficient.”
An advocacy group took a random sample of 100 state-owned bridges in the state and found 33 to be
currently rated as being “deficient.” Test whether the current proportion of bridges in such condition is
35.5% versus the alternative that it is different from 35.5%, at the 10% level of significance.
9. According to the Federal Poverty Measure 12% of the U.S. population lives in poverty. The governor of
a certain state believes that the proportion there is lower. In a sample of size 1,550, 163 were
impoverished according to the federal measure. Test whether the true proportion of the state’s population
that is impoverished is less than 12%, at the 5% level of significance.
10. A rule of thumb is that for working individuals one-quarter of household income should be spent on
housing. A financial advisor believes that the average proportion of income spent on housing is more
than 0.25. In a sample of 30 households, the mean proportion of household income spent on housing was
0.285 with a standard deviation of 0.063. Perform the relevant test of hypotheses at the 1% level of
significance.
18
Applied Dr. Mahmoud Abd El-
Statistics Raouf
19
Applied Dr. Mahmoud Abd El-
Statistics Raouf
20
Applied Dr. Mahmoud Abd El-
Statistics Raouf
1189 1267 1268 1275 1275 1271 1272 1316 1317 1230
Does this information indicate that the population mean of tree-ring dates in the area is different
from that in 1300 A.D.?
21