Testing of Hypothesis
Definition:
Testing of hypothesis is a procedure which enable us to decide whether to
accept or reject a particular statement or assumption about the population
parameter (s) on the basis of information obtained from sample data.
Types of Hypotheses: - Hypothesis: Hypothesis is a
- statement or assumption
1. Null Hypothesis
about the population
-
2. Alternative Hypothesis parameter under the
- assumption that it is true.
3. Simple Hypothesis -
4. Composite Hypothesis -
-
Null Hypothesis and Alternative Hypotheses
A hypothesis which is to Types of Hypotheses under the assumption
be tested for possible rejection
that is true is called, null hypothesis. On the other hand, if the null
hypothesis is rejected we consider another hypothesis which is called
alternative hypothesis. The null and alternative hypotheses are denoted by
H0 and H1 respectively. For example:
a). H0: µ = 7500 (average wage of a group of workers (population) is 7500 per
month)
H1: µ 7500 (average wage of a group of workers (population) is not equal 7500
per month)
b). H0: P = 0.70 (proportion of people in a population above poverty line is 0.70)
H1: µ 0.70 (proportion of people in a population above poverty
line is not equal 0.70)
Dr. Yousaf Hayat 2
C). H0: µ1-µ2 = 0 (There is no significant difference between the average
Types of (populations)
consumption of two group of workersHypotheses
H1: µ1-µ2 0 (There is significant difference between the average consumption of
two group of workers (populations)
D). H0: P1-P2 = 0 (there is no significant difference between the proportion of
educated people in two different localities (populations)
H1: P1-P2 0 (there is significant difference between the proportion of educated
people in two different localities (populations)
Dr. Yousaf Hayat 3
Mean
Some Basic Definitions: Comparison: Testing of
Hypothesis
1. Significance level
2. One sided and two sided tests (One tailed and two-tailed tests)
3. Test statistic
4. Critical region and critical values
5. Type-I and Type-II errors
Dr. Yousaf Hayat 4
Main Steps in Testing of Hypotheses
Steps Involved in Testing of
State/formulate the null and alternative hypotheses Hypothesis
Choose the level of significance, generally, 1%, 5% and 10% levels of
significance are used in literature. It is denoted by
Choose the test statistic to be used i.e. Z-test, t-test, F-test etc.
Compute the value of test statistic from the sample data and available
information given under the null hypothesis, the value so obtain is called
“calculated value”.
Define the critical value of the test statistic, called tabulated value; OR calculate
the P-value of the test statistic
Compare the calculated and tabulated values of the test statistic. Reject the null
hypothesis if calculated value of the test statistic is greater than the tabulated
value, OR, reject the null hypothesis if P-value is less than or equal to
significance level (). After making a decision, conclude the results.
Dr. Yousaf Hayat 5
At a 5% significance level (i.e. = 0.05), we have
/2 = .025. Thus, z.025 = 1.96 and our rejection region is:
-1.96 0 +1.96
Dr. Yousaf Hayat 6
Example
Acceptance Region
(1-)
-Z/2 Z/2
-1.96 1.96
Dr. Yousaf Hayat 7
Summary of One- and Two-Tail Tests
One-Tail Test Two-Tail Test One-Tail Test
(left tail) (right tail)
Dr. Yousaf Hayat 8
Interpreting the P-value
Overwhelming Evidence
(Highly Significant)
Strong Evidence
(Significant)
Weak Evidence
(Not Significant)
No Evidence
(Not Significant)
0 .01 .05 .10
p=.0069 Increase of P-value
Dr. Yousaf Hayat 9
Interpreting the P-value
The smaller the p-value, the more statistical evidence exists to support the
alternative hypothesis in favour of the null hypothesis.
If the p-value is less than 1%, there is overwhelming evidence that supports
the alternative hypothesis.
If the p-value is between 1% and 5%, there is a strong evidence that
supports the alternative hypothesis.
If the p-value is between 5% and 10% there is a weak evidence that supports
the alternative hypothesis.
If the p-value exceeds 10%, there is no evidence that supports the alternative
hypothesis.
Note: Generally, if p-value is -value (the significance level), the test is
defined to be significant and the null hypothesis will be rejected.
Dr. Yousaf Hayat 10
Steps Involved in Testing of Hypothesis
TESTING OF HYPOTHESIS ABOUT
THE MEAN OF A NORMAL
POPULATION
Dr. Yousaf Hayat 11
In order to test the hypothesis that the population mean (µ) has a specified
value (µ0) i.e. H0: µ = µ0 vs H1: µ µ0, the following tests are applied
depending on the type of population (normal or non-normal), its variance
(known or unknown) and the sample size (whether large or small):
1. The population is normal having known variance ( 2 )
(regardless of sample size, n)
X-
Z= N (0, 1)
/ n
2. The population is normal having unknown variance ( 2 )
( sample size is large, n 30) (X X ) 2
S= , and
X- n
Z= N (0, 1)
S/ n
3. The population is normal having unknown variance ( 2 ) s= (X X ) 2
(sample size is samll, n 30) n 1
X-
t , which follow a t-distribution with ( n 1) degrees of freedom
s/ n
Dr. Yousaf Hayat 12
Concepts of Hypothesis Testing
The two possible decisions that can be made:
Conclude that there is enough evidence to support the alternative hypothesis
(also stated as: reject the null hypothesis in favor of the alternative)
Conclude that there is not enough evidence to support the alternative hypothesis
(also stated as: failing to reject the null hypothesis in favor of the alternative)
NOTE: we do not say that we accept the null hypothesis or reject the null
hypothesis (in case, if some one want to mention it, it is better to provide the
information of significance level and the sample size that are used in the study)
Dr. Yousaf Hayat 13
Selecting/determining the sample size
Steps Involved in Testing of Hypothesis
Different approaches are used for determining the sample size to be
taken/selected from a given universe (population):
1. Use arbitrary approach (expertise) to decide about the sample size that will be
representative one.
2. Review the existing literature (if similar type of study is available), and decide
that how much percent of the total population will be a required sample (if
population is finite).
3. Use statistical method (formula) for taking an appropriate sample size (n), which
are discussed below.
Dr. Yousaf Hayat 14
Sample Size for Estimating the Population Mean
Z / 2 Steps Involved in Testing of Hypothesis
2
n (1)
e
Z / 2 the value of standard normal variate at specifed
level of significance ( )
populaion standard deviation (Debatable, from where to take)
e absolute difference between the sample and population mean (Debatable)
Equation (1) is used for estimating the sample size when the population is infinite
(theretically). In case of finit population (N is known), then equation (2)can be
used for determining the sample size:
N 2 Z 2 / 2
n (2)
( N 1)e Z / 2
2 2 2
Dr. Yousaf Hayat 15
Sample Size for Estimating the Population Proportion
2
Z Steps Involved in Testing of Hypothesis
n pq / 2 (3)
ˆˆ
e
Z / 2 the value of standard normal variate at specifed
level of significance ( )
p proportion of success, and q (1 p) (Debatable, from where to take)
ˆ ˆ ˆ
e absolute difference between the sample and population proportions (Debatable)
Equation (3) is used for estimating the sample size when the population is infinite
(theretically).
In case of finit population (N is known), then equation (4)can be
used for determining the sample size:
ˆˆ
NpqZ 2 / 2
n (4)
( N 1)e pqZ / 2
ˆˆ
2 2
Dr. Yousaf Hayat 16
Example 1: In order to test the hypothesis that the average income of a group
of people (population mean (µ)) living in a certain locality is Rs. 7000 per
month, a random sample of 25 respondents was selected and yielded the
average income (X-bar) of Rs. 7200 per month. Assume that the population
variance is known to be 3000. Draw conclusions at 5% level of significance
whether the claim will be accepted?
H 0 : µ = 7000 (average income of a group of people) is Rs. 7000 per month
H1: µ 7000 (average income of a group of people) is not equal Rs. 7000 per month)
ii. Significance level, = 0.05
X-
iii.Test statistic to be used: Z =
/ n
7200-7000
iv. Computations: 3000 54.77, so Z = =18.26 =Zcalculated
54.77 / 25
v. Critical region: Reject H 0 , if Zcalculated Z / 2 , where Z / 2 1.96
vi. Decision: Since falls in the critical region, so H 0 : µ = 7000 will be rejected,
and it is concluded that the average income of a group of people from which the
sample is drawn is not equal to Rs. 7000 per month.
Dr. Yousaf Hayat 17
Example 2: In order to test the hypothesis that the average income of a group
of people (population mean (µ)) living in a certain locality is Rs. 7000 per
month, a random sample of 35 respondents was selected and yielded the
average income (X-bar) is Rs. 7200 per month and standard deviation (S) of
49. Draw conclusions at 5% level of significance whether the claim will be
accepted?
H 0 : µ = 7000 (average income of a group of people) is Rs. 7000 per month
H1: µ 7000 (average income of a group of people) is not equal Rs. 7000 per month)
ii. Significance level, = 0.05
X-
iii.Test statistic to be used: Z =
S/ n
7200-7000
iv. Computations: S 49, So Z = = 24.15 = Z calculated
49 / 35
v. Critical region: Reject H 0 , if Zcalculated Z / 2 , where Z / 2 1.96
vi. Decision: Since falls in the critical region, so H 0 : µ = 7000 will be rejected,
and it is concluded that the average income of a group of people from which the
sample is drawn is not equal to Rs. 7000 per month.
Dr. Yousaf Hayat 18
Example 3: In order to test the hypothesis that the average income of a group
of people (population mean (µ)) living in a certain locality is Rs. 7000 per
month, a random sample of 25 respondents was selected and yielded the
average income (X-bar) is Rs. 7200 per month and standard deviation (s) of
49. Draw conclusions at 5% level of significance whether the claim will be
accepted?
H 0 : µ = 7000 (average income of a group of people) is Rs. 7000 per month
H1: µ 7000 (average income of a group of people) is not equal Rs. 7000 per month
ii. Significance level, = 0.05
X-
iii.Test statistic to be used: t =
s/ n
7200-7000
iv. Computations: s 49, So t = = 20.41 = t calculated
49 / 25
v. Critical region: Reject H 0 , if t calculated t / 2( 24) , where t / 2( 24) 2.064
vi. Decision: Since falls in the critical region, so H 0 : µ = 7000 will be rejected,
and it is concluded that the average income of a group of people from which the
sample is drawn is not equal to Rs. 7000 per month.
Dr. Yousaf Hayat 19
Example 4: The manufacturer of a certain medicine claimed that it was 90%
effective in relieving an allergy for a period of 8 hours. In a sample of 200
people who had the allergy, the medicine provided relief for 160 people. Test
the manufacturer’s claim is legitimate at 1% level of significance.
H 0 : P = 0.90 (the company claim is legitimate)
H1: P 0.90 (the company claim is not legitimate)
ii. Significance level, = 0.01
ˆ
p-P X - nP
iii.Test statistic to be used: Z = =
pq / n npq
ˆ
iv. Computations: X = 160, n = 200, so p =X/n = 0.80
0.80 - 0.90
So, Z = = -4.72 = Zcalculated
(0.90 0.10) / 200
v. Critical region: Reject H 0 , if Z calculated Z / 2 , where Z / 2 2.58
vi. Decision: Since falls in the critical region, so H 0 : P = 0.90 will be rejected,
and it is concluded that the company claim is not legitimate.
Dr. Yousaf Hayat 20
Example 5: A researcher wishes to estimate the average production (yield) of
a group of farmers (population of farmers). Assume that the population
standard deviation is 10. How large a sample should he take so that the
probability is 0.95 that his estimate will not be in error by more than 0.4 units.
To estimate the required sample size, the following formula
will be used:
Z / 2
2
n (1)
e
put Z / 2 1.96, because 1- 0.95 0.05, 10 (given)
and e 0.4 (given) in equation (1), we have:
2
1.96 10
n 2401 which is the required sample size
0.4
Dr. Yousaf Hayat 21
COMPARISON OF MEANS OF TWO NORMAL
POPULATION
1. When population variances are known (regardless of sample sizes)
2. When population variances are unknown and the sample sizes are large
Dr. Yousaf Hayat 22
2. When both the population variances are known
In order to test the hypothesis,
H0: µ1-µ2 = ∆ (The difference between two population means take a specified value ∆).
H1: µ1-µ2 ∆ (The difference between two population means is not equal to a
specified value ∆).
OR
H0: µ1-µ2 = 0 (There is no significant difference between the means of two
populations)
H1: µ1-µ2 0 (There is significant difference between the means of two populations)
The following test statistic will be used:
(X 1 X 2 ) (1 2 )
Z=
12 22
n1 n2 Remaining procedure is same
where 12 and 22 are the variances of like those described earlier
population 1 and population 2, respectively. (See slide number 17 to 20)
Dr. Yousaf Hayat 23
1. When both the population variances are unknown but both
the sample sizes are large (n1 and n2 both greater 30)
In order to test the hypothesis,
H0: µ1-µ2 = ∆ (The difference between two population means take a specified value ∆).
H1: µ1-µ2 ∆ (The difference between two population means is not equal to a
specified value ∆).
OR
H0: µ1-µ2 = 0 (There is no significant difference between the means of two
populations)
H1: µ1-µ2 0 (There is significant difference between the means of two populations)
The following test statistic will be used:
(X 1 X 2 ) (1 2 ) Remaining procedure is same
Z=
S12 S22 like those described earlier
(See slide number 17 to 20)
n1 n2
where S12 and S22 are the sample variances
(to be computed from the sample data)
Dr. Yousaf Hayat 24