You are on page 1of 19

Testing of hypothesis for difference between Population means (μ1 – μ2):

Steps for Testing of hypothesis about two population means:


1. Construction of hypotheses
2. Level of significance
3. Test statistic
4. Decision rule
5. Conclusion
Example: The average marks of 20 Students in Stat-302 of A Section are 50. The average

marks of 15 Students in Stat-302 of B Section are 40. The population standard deviation of A

section and B section are 2 and 3 respectively. On the basis of above sample information can

we conclude that students of Section A perform better than Section B students. Use 5% level

of significance
Solution:
1) Construction of hypotheses:
Ho : A  B OR A - B  0
H1: A > B OR A - B > 0
2) Level of significance:
 = 5%
3) Test Statistic:

( X A −X B )−(μ A −μ B ) (50−40)−(0 ) 10
= = =11.18
2
σ A σB2 2
2 3 2 √ 0 . 8

√ n n
A
+
B
√ +
20 15
Z=

4) Decision Rule: Reject Ho if


Z Cal ≥Z α

5) Result: As
Z Cal ≥Z α =1. 645 . So reject H and conclude that students of section A
0

perform better than section B students.


Example: A new chemical fertilizer, nitro plus, yielded 20,400 pounds of tomatoes on the
average on 40 randomly selected acres of farmland. On another 100 randomly selected acres
the standard organic fertilizer produced a mean yield of 19,000 pounds with a standard
deviation 1000 pounds. Do the results of the comparison indicate that the chemical fertilizer
really produces larger yields than the organic? Assume that the population standard
deviations are known to be 1200 and 1000 respectively.
Solution:
1) Construction of hypotheses:
Ho : 1  2 OR 1 - 2  0
H1: 1 > 2 OR 1 - 2 > 0
2) Level of significance:
 = 5%
3) Test Statistic:

( X 1 −X 2 )−( μ1−μ 2 ) (20400−19000)−(0 ) 1400


= = =6 . 52
2
σ1 σ2 2 2
1200 1000 2 √ 4600

√ n n
1
+
2

40
+
100
Z=

4) Decision Rule: Reject Ho if


Z Cal ≥Z α

5) Result: As
Z Cal ≥Z α =1. 645 . So reject H and conclude that the chemical fertilizer
0

produces more yield than the organic fertilizer.


Example: A random sample of 6400 wheat plants of LU26 has a mean height of 67.85 inches
with standard deviation of 2.56 inches, while a random sample of 1600 plants from Pak-81
has a mean height of 68.55 inches with a standard deviation of 2.52 inches. Do the data
indicate that plants from Pak81 are on the average taller than LU26?
Solution:
1) Construction of hypotheses:
Ho : 1 ≥ 2 OR 1 - 2 ≥ 0
H1: 1 < 2 OR 1 - 2 < 0

2) Level of significance:
 = 5%
3) Test Statistic:

( X −X 2 )−( μ1 −μ2 ) (67 .85−68 .55 )−(0)


Z= 1 = =−9 . 92
2 2 2 2
S1 S2
√ +
n1 n2 √
2 .56 2 .52
+
6400 1600

4) Decision Rule: Reject Ho if


Z Cal ≤−Z α

5) Result: As
Z Cal ≤−Z α =−1. 645 . So reject H and conclude that plants from Pak-81
0

are on the average taller than Plants from LU26.


Example: The average marks of 20 Students in Math-101 of A Section are 50 with a standard
deviation 2 and the average marks of 15 Students in Math-101 of B Section are 40 with a
standard deviation 3. On the basis of above sample information can we conclude that students
of Section A perform better than Section B students? Use 5% level of significance. Assume
Population variances are equal.
Solution:
1) Construction of hypotheses:
Ho: 1  2 OR 1 - 2  0
H1: 1 > 2 OR 1 - 2 > 0
2) Level of significance:
 = 5%

3) Test Statistic:

( X 1 −X 2 )−( μ1 −μ 2 ) (50−40)−(0 ) 10
t= = = =11 . 83
2 0. 845

√ S ( n1 + n1 )
p
1 2
√ 6 .12 ( 201 +151 )
2 2
2 (n1 −1) S1 +(n2 −1)S 2 76+126
S p= = =6 .12
(n1 −1 )+(n2 −1) 33

4) Decision Rule: Reject Ho if t Cal ≥t α (n1 −n2 −2)

5) Result: As tCal >t 0. 05 (33 )=1. 692 . So reject H0.


Example: The average salary of 10 workers from Masood textile is Rs.7300 with a standard
deviation of Rs 70 and average salary of 15 workers form Shahzad textile is 6800 with a
standard deviation o Rs.40. On the basis of above sample information can we conclude that
Masood textile is paying more to workers than Shahzad textile? Use 5% level of significance.
Assume Population variances are equal
Solution:
1) Construction of hypotheses:
Ho: 1  2 OR 1 - 2  0
H1: 1 > 2 OR 1 - 2 > 0
2) Level of significance:
 = 5%
3) Test Statistic:

( X 1 −X 2 )−( μ1 −μ 2 ) ( 7000−6800 )−(0) 200


t= = = =9 .11
2 21. 95

√ S ( n1 + n1 )
p
1 2
√ 2891. 30 (101 +151 )
2 2
2 (n1 −1) S1 +(n2 −1)S 2 44100+22400
S p= = =2891. 30
(n1 −1 )+(n2 −1) 23

4) Decision Rule: Reject Ho if t Cal ≥t α (n1 −n2 −2)

5) Result: As t Cal >t 0. 05 (24 )=1 .711 . So reject H0.


Example: The strength of ropes made out of cotton yarn and coir gave on measurement the
following values
Cotton yarn: 7.5 5.4 10.6 9.0 6.1 10.2 7.9 9.7 7.1 8.5
Coir : 8.3 6.1 9.6 10.4 6.4 10.0 7.9 8.9 7.5 9.7
Test whether there is a significant difference in the strength of the two types of ropes at 5%
level of significance. Assume population variances are equal

Cotto Coir ( X 1− X̄ 1 ) ( X 1− X̄ 1 ) 2 ( X 2− X̄ 2 ) ( X 2− X̄ 2 )2 X 1=
∑ X 1 = 82 =8 . 2
n n1 10
X2
X1
7.5 8.3 -0.7 0.49 -0.18 0.0324
5.4 6.1 -2.8 7.84 -2.38 5.6644
10.6 9.6 2.4 5.76 1.12 1.2544
9 10.4 0.8 0.64 1.92 3.6864
6.1 6.4 -2.1 4.41 -2.08 4.3264
10.2 10 2 4 1.52 2.3104
7.9 7.9 -0.3 0.09 -0.58 0.3364
9.7 8.9 1.5 2.25 0.42 0.1764
7.1 7.5 -1.1 1.21 -0.98 0.9604
8.5 9.7 0.3 0.09 1.22 1.4884
82 84.8 26.78 20.236

X 2=
∑ X 2 = 84 . 8 =8. 48
n2 10

2 ∑ ( X 1−X 1 )2 2 ∑ ( X 2 −X 2 )2
S= 1 n1 −1
26 .78
= 9 =2. 98 S=2 n2 −1 =
20 .236
9 =3 .14

2 2
2 (n1 −1) S1 +(n2 −1)S 2 26 . 78+20 . 236
S p= = =2. 612
(n1 −1 )+(n2 −1) 9+9
Solution:
1) Construction of hypotheses:
Ho : 1 = 2 OR 1 - 2 = 0
H1: 1 ≠ 2 OR 1 - 2 ≠ 0
2) Level of significance:
 = 5%
3) Test Statistic:

( X 1 −X 2 )−( μ1 −μ 2 ) ( 8. 2−8. 48 )−(0)


t= = =−0. 38
2

√S ( p
1 1
+
n1 n2 ) √ 1
2 .612 +
9 9
1
( )
|t Cal|≥t α (n 1−n 2−2 )
4) Decision Rule: Reject Ho if 2

5) Result: As
|t Cal|<t0 . 025 (18)=2.101 . So don’t reject H0 and conclude that there is
significant difference between the ropes made from cotton and coir yarn.
Example: Six horses were feed on diet A, 5 on diet B. the gains in weights for the individual
horses were as shown
Diet A 30 30 28 38 28 26 180 ∑ X 1 =180 =30
X 1=
X1 n1 6
Diet B 40 34 38 32 26 170
X2
X 2=
∑ X 2 = 170 =34
( X 1− X̄ 1 ) 0 0 -2 8 -2 -4 n2 5
2 0 0 4 64 4 16 88
( X 1− X̄ 1 )
( X 2− X̄ 2 ) 6 0 4 -2 -8 2 ∑ ( X 1 −X 1 )2
2 36 0 16 4 64 120
S=1 n1 −1
88
= 5 =17 . 6
( X 2− X̄ 2 )
∑ ( X 2 −X 2 )2
S=
2 120
2 n2 −1 = 4 =30

Can we conclude that diet B is better as compare to diet A for increasing weight? Assume
population variances are unequal.
2

df =
[ w1 +w 2 ] ≈7
( w 1 )2 ( w2 )2 S 21 S22
+ w 1= =2 . 93 w 2= =6
n1 −1 n 2−1 Where n1 and n2

Solution:
1) Construction of hypotheses:
Ho : 1  2
H1: 1 < 2
2) Level of significance:
 = 5%
3) Test Statistic:

( X 1 −X 2 )−( μ1 −μ 2 ) ( 30−34 )−( 0)


t= = =−1 . 34
S 21 S 22 17 .6 30

+
n 1 n2 6 √+
5

4) Decision Rule: Reject Ho if t Cal ≤−t α (d . f )

5) Result: As tCal >−t 0 .05 (7 )=−1 . 895 So don’t reject Ho and conclude that diet B is not
better than A.

Example:-An experiment was performed with seven hop plants. One half of each plant was
pollinated and the other half was not pollinated. The yield of seed of each hop plant is given
below
Plant No:- 1 2 3 4 5 6 7
Pollinated:- 0.78 0.76 0.43 0.92 0.86 0.59 0.68
Non-Pollinated 0.21 0.12 0.32 0.29 0.30 .20 0.14
Test whether the pollinated half of the plant gives a higher yield of seed than the non-
pollinated half.

Pollinate Non-Pollinated d= X 1− X 2 ( d−d )2


d X2
X1
0.78 0.21 0.57 0.006241
0.76 0.12 0.64 0.022201
0.43 0.32 0.11 0.145161
0.92 0.29 0.63 0.019321
0.86 0.30 0.56 0.004761
0.59 0.20 0.39 0.010201
0.68 0.14 0.54 0.002401
3.44 0.2103

3 . 44 0. 2103
d̄= =0. 491 S2d = =0 . 0349
7 6

Solution:
1) Construction of hypotheses:
Ho : 1  2 i.e. 1 - 2  0 OR d  0
H1: : 1 > 2 i.e. 1 - 2 >0 OR d > 0
2) Level of significance:
 = 5%
3) Test Statistic:
d−μd 0. 491−0
t=
S 2d
√ n = √ 0. 0349
7 = 6.96
t Cal ≥t α ( n−1 )
4) Decision Rule: Reject Ho if
t Cal >t 0. 05 (6 )=1. 943
5) Result: As . So reject Ho and may conclude there is evidence that
pollinated gives a higher mean yield of seed.
Example: Units Produced per day for a random sample of 10 workers was recorded before
and after training. Units produced are given below. Test the hypothesis that the production
increased after training than before training.
Workers Before X1 After X2 d= X 2− X 1 ( d−d )2
1 54 60 6 4
2 56 59 3 1
3 50 57 7 9
4 52 56 4 0
5 55 56 1 9
6 52 58 6 4
7 56 62 6 4
8 53 55 2 4
9 53 54 1 9
10 60 64 4 0
Total 40 44

40 44
d̄= =4 S 2d = =4 . 89
10 9

Solution:
1) Construction of hypotheses:
Ho : 2  1 i.e. 2 - 1  0 OR d  0
H1: : 2 > 1 i.e. 2 - 1 > 0 OR d > 0
2) Level of significance:
 = 5%
3) Test Statistic:
d−μd 4−0
t=
S 2d
√ n = √ 4 . 89
10 = 5.72
t Cal ≥t α ( n−1 )
4) Decision Rule: Reject Ho if
t Cal >t 0. 05(9 )=1. 833
5) Result: As . So reject Ho.

Confidence interval for difference between Population means (μ1 – μ2):\


Example: The average marks of 20 Students in Stat-302 of A Section are 50. The average

marks of 15 Students in Stat-302 of B Section are 40. The population standard deviation of A

section and B section are 2 and 3 respectively. On the basis of above sample information
Construct 95 % Confidence interval for difference between mean of two sections.
Solution:
95% C.I for 1 - 2

σ 21 σ 22
( X 1 −X 2 )± Z(√ )
α /2 +
n1 n2

2
α
α=0 . 05 , =0 .025 ¿ (50−40)± Z (√ )
0 . 025
22 3 2
+
20 15
n1 =20 , X 1 =50 , σ 1=2 =10±1 . 96(0 . 89)=10±1 .74
n2 =15 , X 2 =40 , σ 2 =3 ¿ 8 . 62 ,11. 74
Example: The coagulation times in seconds for blood drawn from 200 animals randomly
allocated to two different diets were recorded. The number of animals in each treatment is
100. Their means are 66 and 61 seconds and population variances are known to be 3.3 & 3.0
respectively. Construct 95 % Confidence interval for difference between mean blood
coagulation times for two diets.
Solution: 95% C.I for 1 -  2
α
α=0 . 05 , =0 .025
2
n1 =100 , X 1 =66 , σ 21 =3 .3
n2 =100 , X 2 =61 , σ 22 =3. 0
σ 21 σ 22
( X 1 −X 2 )± Z α /2 (√ ) +
n1 n2

¿ (66−61)± Z 0 .025 (√ 3.1003 +3100.0 )


=5±1 . 96 ( 0 .251 )
¿ 4 . 51, 5 . 49

Example: A test in Statistics was given to 50 girls and 75 boys. The girls made an average
grade of 76 with a standard deviation of 6, while boys made grade of 82 with a standard
deviation of 8. Find 96% confidence interval for the difference between 1-2. Where 1 is
the mean of all boys and 2 is the mean of all girls who might take this test.
Solution: 96% C.I for 1 - 2

S 21 S 22
( X 1 −X 2 )± Z(√ )
α /2 +
n1 n2
α
α=0 . 04 , =0 . 020
2 ¿(82−76 )± Z (√ )
0 .020
82 62
+
75 50
n1 =75 , X 1 =66 , S 1=8 ¿6±(2 . 054 )(1. 254 )
n2 =50 , X 2 =61 , S 2=6 ¿3 . 42 , 8 .58
Example: The average salary of 10 workers from Masood textile is Rs.7300 with a standard
deviation of Rs 70 and average salary of 15 workers form Shahzad textile is 6800 with a
standard deviation o Rs.40. On the basis of above sample information constructs 95 %
Confidence interval for difference between mean Masood textile and Shahzad textile.
Assume Population variances are equal
Solution:

n1 =10 , X 1 =7300 , S1 =70


n2 =15 , X 2 =6800 , S 2=40
2 2
2 (n1 −1) S1 +(n2 −1)S 2 44100+22400
S p= = =2891. 30
(n1 −1 )+(n2 −1) 23

95% C.I for 1 - 2


α
α=0 . 05 , =0 .025
2

2
( X 1 −X 2 )± t α /2( n1 +n 2−2)
(√ S (1n + 1n )
p
1 2
)
¿ (7300−6800 )± t 0 . 025(23 ) (√ 2891 .30 (110 +115 ))
¿ 500±2. 069(21 . 95)=500±45. 42
¿ 454 .58 , 545 . 42

Example: Following are the protein contents measured in two types of species

Species 1 0.72 1.12 0.81 0.89 0.72 0.81 1.01 0.75 0.83 7.659
(X1)
Species 2 1.21 0.93 0.80 1.12 1.22 0.94 0.87 7.070
(X2)
2 0.0172 0.0724 0.0017 0.0015 0.0172 0.0017 0.0253 0.0102 0.0004 0.1472
( X 1− X̄ 1 )
2 0.0400 0.0064 0.0441 0.0121 0.0441 0.0049 0.0196 0.1712
( X 2− X̄ 2 )

Construct 95% Confidence interval for difference between means. Assume population
variances are equal.
Solution:

X 1=
∑ X 1 = 7 . 659 =0 .851 X 2=
∑ X 2 = 7 . 07 =1 .013
n1 9 n2 7

2 ∑ ( X 1−X 1 )2 2 ∑ ( X 2 −X 2 )2
S= 1 n1 −1 =
0 . 1472
8 =0 .0184 S= 2 n2 −1 =
0 . 1712
6 =0 .0285
2 2
2 (n1 −1) S1 +(n2 −1)S 2 0 . 1472+0. 1712
S p= = =0 . 0227
(n1 −1 )+(n2 −1) 8+6
95% C.I for 1 - 2
α
α=0 . 05 , =0 .025
2

2
( X 1 −X 2 )± t α /2( n1 +n 2−2)
(√ S (1n + 1n )
p
1 2
)
¿ (0 .851−1. 013 )± t 0 . 025( 14 ) ( √ ( ))
0 . 0227
1 1
+
9 7
¿−0 . 162±0 .1629
¿−0 . 325 ,0 . 0001
Example: A random sample of 20 plants from Variety I showed a mean height of 63 cm with
standard deviation of 6 cm, while another random sample of 25 plants from Varity II showed
a mean height of 60 cm with standard deviation of 2 cm. Construct 90% confidence interval
for the difference between two variety means. Assume population variances are unequal
population variances are unequal.
Solution:
α
α=0 .10 , =0. 05
2
n1 =20 , X 1 =63 , S 1=6
n2 =25 , X 2 =60 , S 2=2
2
[ w1 +w 2 ]
df = ≈23
( w 1 )2 ( w2 )2 S 21 S22
+ w 1= =1 . 8 w 2= =0. 16
n1 −1 n 2−1 Where n1 and n2
S 21 S 22
( X 1 −X 2 )± t α /2( df ) (√ ) +
n1 n 2

¿ (63−60 )± t 0. 05( 23 ) (√ )6 2 22
+
20 25
¿ 3±(1 .71 )(1. 4 )
90% C.I for 1 - 2 ¿ 0 . 606 , 5. 394
Example: Six horses were feed on diet A, 5 on diet B. the gains in weights for the individual
horses were as shown
Diet A 30 30 28 38 28 26 180 ∑ X 1 =180 =30
X 1=
X1 n1 6
Diet B 40 34 38 32 26 170
X2
X 2=
∑ X 2 = 170 =34
( X 1− X̄ 1 ) 0 0 -2 8 -2 -4 n2 5
2 0 0 4 64 4 16 88
( X 1− X̄ 1 )
( X 2− X̄ 2 ) 6 0 4 -2 -8 ∑ ( X 1 −X 1 )2
S=
2 88
2 1 n1 −1 = 5 =17 . 6
( X 2− X̄ 2 ) 36 0 16 4 64 120

2 ∑ ( X 2 −X 2 )2
S= 2 n2 −1
120
= 4 =30

Can we construct 95% confidence interval to difference between diet A and diet B.
Assume population variances are unequal.
2

df =
[ w1 +w 2 ] ≈7
( w 1 )2 ( w2 )2 S 21 S22
+ w 1= =2 . 93 w 2= =6
n1 −1 n 2−1 Where n1 and n2

Solution:

S 21 S 22
( X 1 −X 2 )± t α /2( df ) (√ ) +
n1 n2

¿(30−34 )± t 17 . 6 30
+
0.05(7 )
6 5 (√ )
¿−4±(2. 365 )(8. 93 )=−4±21. 12
95% C.I for 1 - 2 ¿−25 .12 , 17 .12
Example:-An experiment was performed with seven hop plants. One half of each plant was
pollinated and the other half was not pollinated. The yield of seed of each hop plant is given
below
Plant No:- 1 2 3 4 5 6 7
Pollinated:- 0.78 0.76 0.43 0.92 0.86 0.59 0.68
Non-Pollinated 0.21 0.12 0.32 0.29 0.30 .20 0.14
Construct 90 % confidence interval for difference between mean seed for pollinated and non-
pollinated half.

Pollinate Non-Pollinated d= X 1− X 2 ( d−d )2


d X2
X1
0.78 0.21 0.57 0.006241
0.76 0.12 0.64 0.022201
0.43 0.32 0.11 0.145161
0.92 0.29 0.63 0.019321
0.86 0.30 0.56 0.004761
0.59 0.20 0.39 0.010201
0.68 0.14 0.54 0.002401
3.44 0.2103

3 . 44 0. 2103
d̄= =0. 491 S2d = =0 . 0349
7 6
Solution: 90% C.I for 1 - 2

2

(d )± t α /2( n−1) (√ S )n
d

¿(0 . 491)±
7
t
0 . 0349
0. 05 (6 ) (√ )
¿(0 . 491)±(1. 943 )(0. 0706 )
¿(0 .354, 0 . 628)

Example: Units Produced per day for a random sample of 10 workers was recorded before
and after training. Units produced are given below. Test the hypothesis that the production
increased after training than before training.
Workers Before X1 After X2 d= X 2− X 1 ( d−d )2
1 54 60 6 4
2 56 59 3 1
3 50 57 7 9
4 52 56 4 0
5 55 56 1 9
6 52 58 6 4
7 56 62 6 4
8 53 55 2 4
9 53 54 1 9
10 60 64 4 0
Total 40 44

40 44
d̄= =4 S 2d = =4 . 89
10 9

Solution: 90% C.I for 1 - 2

2

(d )± t α /2( n−1) (√ S ) n
d

¿ (4 )± t 0. 025( 9) ( √104 . 89 )
¿ (4 )±(2. 262(0 .6988 )=4±1. 58
¿ (2. 42, 5,58 )

Testing of hypothesis for equality of two population variances:


Steps for Testing of hypothesis for equality of two population variances:
1. Construction of hypotheses
2. Level of significance
3. Test statistic
4. Decision rule
5. Conclusion
Example: The average marks of 20 Students in Math-101 of A Section are 50 with a standard
deviation 3 and the average marks of 15 Students in Math-101 of B Section are 40 with a
standard deviation 2.5. On the basis of above sample information can we conclude that
Population variances are equal? Use 5% level of significance.
Solution:
1) Construction of hypotheses:
Ho : 12 = 22
H1 : 12  22
2) Level of significance:
 = 5%
3) Test Statistic:
S 22 32
F= = =1 . 44
S12 2 .5 2
FCal ≥F α (n1 −1, n 2−1 )
4) Decision Rule: Reject Ho if 2

5) Result: As FCal <F 0.05 (19 ,14 )=2. 39 . So don’t reject H0 and conclude that population
variances are equal.
Example: The average salary of 10 workers from Masood textile is Rs.7300 with a standard
deviation of Rs 70 and average salary of 15 workers form Shahzad textile is 6800 with a
standard deviation o Rs.40. On the basis of above sample information can we conclude that
Population variances are equal? Use 5% level of significance.
Solution:
1) Construction of hypotheses:
Ho : 12 = 22
H1 : 12  22
2) Level of significance:
 = 5%

3) Test Statistic:
2
S2 702
F= = =3 . 0625
S12 402
FCal ≥F α (n1 −1, n 2−1 )
4) Decision Rule: Reject Ho if 2

5) Result: As FCal >F 0.05 (9 , 14 )=2 .62 . So reject H0 and conclude that population
variances are equal.

You might also like